Update-Script
Syntax
Update-Script
[[-Name] <String[]>]
[-RequiredVersion <Version>]
[-MaximumVersion <Version>]
[-Proxy <Uri>]
[-ProxyCredential <PSCredential>]
[-Credential <PSCredential>]
[-Force]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
The Update-Script cmdlet updates the specified script from the repository from which it was previously installed.
Examples
Example 1: Update the specified script
PS C:\> Update-Script -Name "Fabrikam-Script" -RequiredVersion 1.5
PS C:\> Get-InstalledScript -Name "Fabrikam-Script"
Version Name Type Repository Description
------- ---- ---- ---------- -----------
1.5 Fabrikam-Script Script local1 Description for the Fabrkiam-Script script
The first command updates the script Fabrikam-Script to version 1.5.
The second command gets Fabrikam-Script and displays the results.
Optional Parameters
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 |
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 |
Specifies the maximum, or newest, version of the script to update. The MaximumVersion and RequiredVersion parameters are mutually exclusive; you cannot use both parameters in the same command.
Type: | Version |
Position: | Named |
Default value: | None |
Accept pipeline input: | True (ByPropertyName) |
Accept wildcard characters: | False |
Specifies an array of names of scripts to update.
Type: | String[] |
Position: | 1 |
Default value: | None |
Accept pipeline input: | True (ByPropertyName) |
Accept wildcard characters: | False |
Type: | Uri |
Position: | Named |
Default value: | None |
Accept pipeline input: | True (ByPropertyName) |
Accept wildcard characters: | False |
Type: | PSCredential |
Position: | Named |
Default value: | None |
Accept pipeline input: | True (ByPropertyName) |
Accept wildcard characters: | False |
Specifies the exact version number of the script to update. The MinimumVersion and RequiredVersion parameters are mutually exclusive; you cannot use both parameters in the same command.
Type: | Version |
Position: | Named |
Default value: | None |
Accept pipeline input: | True (ByPropertyName) |
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 |