| external help file | PSModule-help.xml |
|---|---|
| Locale | en-US |
| Module Name | PowerShellGet |
| ms.custom | 3.0.22-beta22 |
| ms.date | 09/19/2023 |
| online version | https://learn.microsoft.com/powershell/module/powershellget/update-scriptfileinfo?view=powershellget-2.x&WT.mc_id=ps-gethelp |
| schema | 2.0.0 |
| title | Update-ScriptFileInfo |
Updates information for a script.
Update-ScriptFileInfo [-Path] <String> [-Version <String>] [-Author <String>] [-Guid <Guid>]
[-Description <String>] [-CompanyName <String>] [-Copyright <String>] [-RequiredModules <Object[]>]
[-ExternalModuleDependencies <String[]>] [-RequiredScripts <String[]>]
[-ExternalScriptDependencies <String[]>] [-Tags <String[]>] [-ProjectUri <Uri>] [-LicenseUri <Uri>]
[-IconUri <Uri>] [-ReleaseNotes <String[]>] [-PrivateData <String>] [-PassThru] [-Force] [-WhatIf]
[-Confirm] [<CommonParameters>]
Update-ScriptFileInfo [-LiteralPath] <String> [-Version <String>] [-Author <String>] [-Guid <Guid>]
[-Description <String>] [-CompanyName <String>] [-Copyright <String>] [-RequiredModules <Object[]>]
[-ExternalModuleDependencies <String[]>] [-RequiredScripts <String[]>]
[-ExternalScriptDependencies <String[]>] [-Tags <String[]>] [-ProjectUri <Uri>] [-LicenseUri <Uri>]
[-IconUri <Uri>] [-ReleaseNotes <String[]>] [-PrivateData <String>] [-PassThru] [-Force] [-WhatIf]
[-Confirm] [<CommonParameters>]
The Update-ScriptFileInfo cmdlet updates a script's property values. For example, the values for
version, author, or description.
This is a proxy cmdlet for the Update-PSScriptFileInfo cmdlet in the
Microsoft.PowerShell.PSResourceGet. For more information, see
Update-PSScriptFileInfo.
In this example, an existing script file is updated with new property values.
Splatting is used to pass parameters to the Update-ScriptFileInfo cmdlet. For more information,
see about_Splatting.
$Parms = @{
Path = "C:\Test\Temp-Scriptfile.ps1"
Version = "2.0"
Author = "bob@contoso.com"
CompanyName = "Contoso"
Description = "This is the updated description"
}
Update-ScriptFileInfo @Parms -PassThru<#PSScriptInfo
.VERSION 2.0
.GUID 4609f00c-e850-4d3f-9c69-3741e56e4133
.AUTHOR bob@contoso.com
.COMPANYNAME Contoso
.COPYRIGHT
.TAGS
.LICENSEURI
.PROJECTURI
.ICONURI
.EXTERNALMODULEDEPENDENCIES
.REQUIREDSCRIPTS
.EXTERNALSCRIPTDEPENDENCIES
.RELEASENOTES
.PRIVATEDATA
#>
<#
.DESCRIPTION
This is the updated description
#>
Param()
$Parms stores the parameter values for Path, Version, Author, CompanyName, and
Description. Update-ScriptFileInfo gets the parameter values from @Parms and updates the
script. The PassThru parameter displays the script's contents in the PowerShell console.
Specifies the script author.
Type: System.String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies the company or vendor who created the script.
Type: System.String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies a copyright statement for the script.
Type: System.String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies a description for the script.
Type: System.String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies an array of external module dependencies.
Type: System.String[]
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies an array of external script dependencies.
Type: System.String[]
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseThe proxy cmdlet ignores this parameter since it's not supported by Update-PSScriptFileInfo.
Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies a unique ID for a script.
Type: System.Guid
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies the URL of an icon for the script. The specified icon is displayed on the gallery web page for the script.
Type: System.Uri
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies the URL of licensing terms.
Type: System.Uri
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies a path to one or more locations. The LiteralPath parameter's value is used exactly as it's entered. No characters are interpreted as wildcards. If the path includes escape characters, enclose them in single quotation marks. Single quotation marks tell PowerShell not to interpret any characters as escape sequences.
The proxy cmdlet maps this parameter to the Path parameter of Update-PSScriptFileInfo.
Type: System.String
Parameter Sets: LiteralPathParameterSet
Aliases: PSPath
Required: True
Position: 0
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: FalseThe proxy cmdlet ignores this parameter since it's not supported by Update-PSScriptFileInfo.
Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies the script file's location. Wildcards are permitted.
Type: System.String
Parameter Sets: PathParameterSet
Aliases:
Required: True
Position: 0
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: TrueSpecifies the private data for the script.
Type: System.String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies the URL of a web page about this project.
Type: System.Uri
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies a string array that contains release notes or comments that you want available for this version of the script.
Type: System.String[]
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies modules that must be in the global session state. If the required modules aren't in the global session state, PowerShell imports them.
Type: System.Object[]
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies an array of required scripts.
Type: System.String[]
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies an array of tags.
Type: System.String[]
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies the script's version.
Type: System.String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseThe proxy cmdlet ignores this parameter since it's not supported by Update-PSScriptFileInfo.
Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases: cf
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseThe proxy cmdlet ignores this parameter since it's not supported by Update-PSScriptFileInfo.
Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases: wi
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseThis cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
Use the Test-ScriptFileInfo cmdlet to validate a script's metadata. Scripts must include values
for Version, GUID, Description, and Author.