The Update-Script cmdlet updates a script that is installed on the local computer. The updated
script is downloaded from the same repository as the installed version.
Examples
Example 1: Update the specified script
This example updates an installed script and displays the updated version.
Version Name Repository Description
------- ---- ---------- -----------
1.1 UpdateManagement-Template PSGallery This is a template script for Update Management...
Update-Script uses the Name parameter to specify the script to update. The RequiredVersion
parameter specifies the script version. Get-InstalledScript displays the updated version of the
script.
Parameters
-AcceptLicense
Automatically accept the license agreement during installation if the package requires it.
Specifies the maximum, or newest, version of the script to update. The MaximumVersion and
RequiredVersion parameters can't be used in the same command.
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
-InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable,
-ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see
about_CommonParameters.
As of April 2020, the PowerShell Gallery no longer supports Transport Layer Security (TLS)
versions 1.0 and 1.1. If you are not using TLS 1.2 or higher, you will receive an error when
trying to access the PowerShell Gallery. Use the following command to ensure you are using TLS
1.2:
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.