external help file | Locale | Module Name | ms.custom | ms.date | online version | schema | title |
---|---|---|---|---|---|---|---|
PSModule-help.xml |
en-US |
PowerShellGet |
3.0.22-beta22 |
09/19/2023 |
2.0.0 |
Update-Script |
Updates a script.
Update-Script [[-Name] <String[]>] [-RequiredVersion <String>] [-MaximumVersion <String>]
[-Proxy <Uri>] [-ProxyCredential <PSCredential>] [-Credential <PSCredential>] [-Force]
[-AllowPrerelease] [-AcceptLicense] [-WhatIf] [-Confirm] [<CommonParameters>]
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.
This is a proxy cmdlet for the Update-PSResource
cmdlet in the
Microsoft.PowerShell.PSResourceGet. For more information, see
Update-PSResource.
This example updates an installed script and displays the updated version.
Update-Script -Name UpdateManagement-Template -RequiredVersion 1.1
Get-InstalledScript -Name UpdateManagement-Template
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.
Automatically accept the license agreement during installation if the package requires it.
Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Allows you to update a script with the newer script marked as a prerelease.
The proxy cmdlet maps this parameter to the Prerelease parameter of Update-PSResource
.
Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Specifies a user account that has permission to update a script.
Type: System.Management.Automation.PSCredential
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
Forces Update-Script
to run without asking for user confirmation.
Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
The proxy cmdlet uses the value of this parameter to create a NuGet version search string for use
with the Version parameter of Update-PSResource
.
Type: System.String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
Specifies one script name or an array of script names to update.
Type: System.String[]
Parameter Sets: (All)
Aliases:
Required: False
Position: 0
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
The proxy cmdlet ignores this parameter since it's not supported by Update-PSResource
.
Type: System.Uri
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
The proxy cmdlet ignores this parameter since it's not supported by Update-PSResource
.
Type: System.Management.Automation.PSCredential
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
The proxy cmdlet uses the value of this parameter to create a NuGet version search string for use
with the Version parameter of Update-PSResource
.
Type: System.String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
Prompts you for confirmation before running Update-Script
.
Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases: cf
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
Shows what would happen if Update-Script
runs. The cmdlet isn't run.
Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases: wi
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
The PowerShell Gallery no longer supports Transport Layer Security (TLS) versions 1.0 and 1.1. You must use TLS 1.2 or higher. Use the following command to ensure you are using TLS 1.2:
[Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12