-->![How How](http://www.neilblevins.com/cg_tools/assets/3dsmax/env/Soulburn_EnvAssetPack_Free.jpg)
![Install Install](http://www.neilblevins.com/cg_tools/assets/3dsmax/mat/Soulburn_MaterialAssetPack.jpg)
Syntax
I found a script on ScriptSpot called Select Similar, which will find all objects similar to the one selected. But it doesn't seem to have a function to replace them. What I want, once I have all the instances selected, is to replace them with instances of the new object. 104 rows Or to be safe, uninstall the old scripts first, then install the new pack. But overwiring the old pack should be fine. All of these scripts are run as macroscripts, ie, as buttons, keyboard shortcuts, quad menus, etc, just go to Customize, Customize User Interface, category SoulburnScripts.
Description
The
Install-Script
cmdlet acquires a script payload from a repository, verifies that thepayload is a valid PowerShell script, and copies the script file to a specified installationlocation.The default repositories
Install-Script
operates against are configurable through theRegister-PSRepository
, Set-PSRepository
, Unregister-PSRepository
, and Get-PSRepository
cmdlets. When operating against multiple repositories, Install-Script
installs the first scriptthat matches the specified search criteria (Name, MinimumVersion, or MaximumVersion)from the first repository without any error.Examples
Example 1: Find a script and install it
The first command finds the script named
Required-Script2
from the Local1 repository and displaysthe results.The second command finds the
Required-Script2
script, and then uses the pipeline operator to passit to the Install-Script
cmdlet to install it.The third command uses the
Get-Command
cmdlet to get Required-Script2
, and then displays theresults.The fourth command uses the
Get-InstalledScript
cmdlet to get Required-Script2
and display theresults.The fifth command gets
Required-Script2
and uses the pipeline operator to pass it to theFormat-List
cmdlet to format the output.Example 2: Install a script with AllUsers scope
The first command installs the script named
Required-Script3
and assigns it AllUsers scope.The second command gets the installed script
Required-Script3
and displays information about it.The third command gets
Required-Script3
and uses the pipeline operator to pass it to theFormat-List
cmdlet to format the output.Example 3: Install a script and its dependencies
![How How](http://www.neilblevins.com/cg_tools/assets/3dsmax/env/Soulburn_EnvAssetPack_Free.jpg)
The first command finds the script named
Script-WithDependencies2
and its dependencies in theLocal1 repository and displays the results.The second command installs
Script-WithDependencies2
.The third command uses the
Get-InstalledScript
script cmdlet to get installed scripts and displaythe results.The fourth command uses the
Get-InstalledModule
cmdlet to get installed modules and display theresults.The fifth command uses the
Find-Script
cmdlet to find scripts where the name begins withRequired-Script
and display the results.The sixth command installs the scripts where the name begins with
Required-Script
in the Local1repository.The final command gets installed scripts and displays the results.
Parameters
-AcceptLicense
Automatically accept the license agreement during installation if the module requires it.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Allows you to install a script marked as a prerelease.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Prompts you for confirmation before running the cmdlet.
Type: | SwitchParameter |
Aliases: | cf |
Position: | Named |
Default value: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies a user account that has rights to install a script for a specified package provider orsource.
Type: | PSCredential |
Position: | Named |
Default value: | None |
Accept pipeline input: | True (ByPropertyName) |
Accept wildcard characters: | False |
Forces the command to run without asking for user confirmation.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Used for pipeline input.
Type: | PSObject[] |
Position: | 0 |
Default value: | None |
Accept pipeline input: | True (ByPropertyName, ByValue) |
Accept wildcard characters: | False |
Specifies the maximum version of a single scripts to install. You cannot add this parameter if youare attempting to install multiple scripts. The MaximumVersion and the RequiredVersionparameters are mutually exclusive; you cannot use both parameters in the same command.
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | True (ByPropertyName) |
Accept wildcard characters: | False |
Specifies the minimum version of a single script to install. You cannot add this parameter if youare attempting to install multiple scripts. The MinimumVersion and the RequiredVersionparameters are mutually exclusive; you cannot use both parameters in the same command.
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | True (ByPropertyName) |
Accept wildcard characters: | False |
Specifies an array of names of scripts to install.
Type: | String[] |
Position: | 0 |
Default value: | None |
Accept pipeline input: | True (ByPropertyName) |
Accept wildcard characters: | False |
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies a proxy server for the request, rather than connecting directly to the Internet resource.
Type: | Uri |
Position: | Named |
Default value: | None |
Accept pipeline input: | True (ByPropertyName) |
Accept wildcard characters: | False |
Specifies a user account that has permission to use the proxy server that is specified by theProxy parameter.
Type: | PSCredential |
Position: | Named |
Default value: | None |
Accept pipeline input: | True (ByPropertyName) |
Accept wildcard characters: | False |
Specifies the friendly name of a repository that has been registered with the
Register-PSRepository
cmdlet. The default is all registered repositories.Type: | String[] |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies the exact version number of the script to install.
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | True (ByPropertyName) |
Accept wildcard characters: | False |
Specifies the installation scope of the script.Valid values are: AllUsers and CurrentUser.
The AllUsers scope lets modules be installed in a location that is accessible to all users of thecomputer, that is,
$env:ProgramFilesWindowsPowerShellScripts
.The CurrentUser scope lets modules be installed only to
$homeDocumentsWindowsPowerShellScripts
, so that the module is available only to the currentuser.When no Scope is defined, the default will be set based on the current session:
![Install Install](http://www.neilblevins.com/cg_tools/assets/3dsmax/mat/Soulburn_MaterialAssetPack.jpg)
- For an elevated PowerShell session, Scope defaults to AllUsers;
- For non-elevated PowerShell sessions in PowerShellGet versions 2.0.0and above, Scope is CurrentUser;
- For non-elevated PowerShell sessions in PowerShellGet versions 1.6.7 and earlier, Scope isundefined, and
Install-Module
fails.
Type: | String |
Accepted values: | CurrentUser, AllUsers |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Type: | SwitchParameter |
Aliases: | wi |
Position: | Named |
Default value: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |