< Back

Update-Script

Wed Jan 30, 2019 5:57 pm

NAME Update-Script



SYNOPSIS

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.





PARAMETERS

-Confirm [<SwitchParameter>]

Prompts you for confirmation before running the cmdlet.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-Credential <PSCredential>

@{Text=}



Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-Force [<SwitchParameter>]

Forces the command to run without asking for user confirmation.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-MaximumVersion <Version>

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.



Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-Name <String[]>

Specifies an array of names of scripts to update.



Required? false

Position? 0

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-Proxy <Uri>

@{Text=}



Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-ProxyCredential <PSCredential>

@{Text=}



Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-RequiredVersion <Version>

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.



Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-WhatIf [<SwitchParameter>]

Shows what would happen if the cmdlet runs. The cmdlet is not run.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS



NOTES









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.



RELATED LINKS

Online Version: http://go.microsoft.com/fwlink/?LinkId=822342

Find-Script

Install-Script

Publish-Script

Save-Script

Uninstall-Script