Update-ScriptFileInfo
Updates information for a script.
Syntax
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>]
Description
The Update-ScriptFileInfo cmdlet updates a script's property values. For example, the values for
version, author, or description.
Examples
Example 1: Update the version of a script file
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.
Parameters
Specifies the script author.
| Type: | System.String |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Specifies the company or vendor who created the script.
| Type: | System.String |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Prompts you for confirmation before running Update-ScriptFileInfo.
| Type: | System.Management.Automation.SwitchParameter |
| Aliases: | cf |
| Position: | Named |
| Default value: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Specifies a copyright statement for the script.
| Type: | System.String |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Specifies a description for the script.
| Type: | System.String |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Specifies an array of external module dependencies.
| Type: | System.String[] |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Specifies an array of external script dependencies.
| Type: | System.String[] |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Forces Update-ScriptFileInfo to run without asking for user confirmation.
| Type: | System.Management.Automation.SwitchParameter |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Specifies a unique ID for a script.
| Type: | System.Guid |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Specifies the URL of an icon for the script. The specified icon is displayed on the gallery web page for the script.
| Type: | System.Uri |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Specifies the URL of licensing terms.
| Type: | System.Uri |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Specifies 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.
| Type: | System.String |
| Aliases: | PSPath |
| Position: | 0 |
| Default value: | None |
| Accept pipeline input: | True |
| Accept wildcard characters: | False |
Returns an object that represents the item with which you're working. By default,
Update-ScriptFileInfo doesn't generate any output.
| Type: | System.Management.Automation.SwitchParameter |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Specifies the script file's location. Wildcards are permitted.
| Type: | System.String |
| Position: | 0 |
| Default value: | None |
| Accept pipeline input: | True |
| Accept wildcard characters: | True |
Specifies the private data for the script.
| Type: | System.String |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Specifies the URL of a web page about this project.
| Type: | System.Uri |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Specifies a string array that contains release notes or comments that you want available for this version of the script.
| Type: | System.String[] |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Specifies 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[] |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Specifies an array of required scripts.
| Type: | System.String[] |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Specifies an array of tags.
| Type: | System.String[] |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Specifies the script's version.
| Type: | System.String |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Shows what would happen if Update-ScriptFileInfo runs. The cmdlet isn't run.
| Type: | System.Management.Automation.SwitchParameter |
| Aliases: | wi |
| Position: | Named |
| Default value: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Inputs
System.String
Outputs
System.Object
Notes
Use the Test-ScriptFileInfo cmdlet to validate a script's metadata. Scripts must include values
for version, GUID, description, and author.