Update-​Script

Updates a script.

Syntax

Update-Script
      [[-Name] <String[]>]
      [-Confirm]
      [-Credential <PSCredential>]
      [-Force]
      [-MaximumVersion <Version>]
      [-Proxy <Uri>]
      [-ProxyCredential <PSCredential>]
      [-RequiredVersion <Version>]
      [-WhatIf]
      [<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

-Confirm

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
-Credential

@{Text=}

Type:PSCredential
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-Force

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
-MaximumVersion

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
-Name

Specifies an array of names of scripts to update.

Type:String[]
Position:0
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-Proxy

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
-ProxyCredential

Specifies a user account that has permission to use the proxy server that is specified by the Proxy parameter.

Type:PSCredential
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-RequiredVersion

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
-WhatIf

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