Update-ScriptFileInfo

Updates information for a script.
Update-ScriptFileInfo [-Path*] <String> [-Author [<String>]] [-CompanyName [<String>]] [-Copyright [<String>]][-Description [<String>]] [-ExternalModuleDependencies [<String[]>]] [-ExternalScriptDependencies [<String[]>]][-Force] [-Guid [<Guid>]] [-IconUri [<Uri>]] [-LicenseUri [<Uri>]] [-PassThru] [-ProjectUri [<Uri>]][-ReleaseNotes [<String[]>]] [-RequiredModules [<Object[]>]] [-RequiredScripts [<String[]>]] [-Tags [<String[]>]][-Version [<Version>]] [-Confirm] [-WhatIf] [<CommonParameters>]
Update-ScriptFileInfo [-LiteralPath*] <String> [-Author [<String>]] [-CompanyName [<String>]] [-Copyright[<String>]] [-Description [<String>]] [-ExternalModuleDependencies [<String[]>]] [-ExternalScriptDependencies[<String[]>]] [-Force] [-Guid [<Guid>]] [-IconUri [<Uri>]] [-LicenseUri [<Uri>]] [-PassThru] [-ProjectUri [<Uri>]][-ReleaseNotes [<String[]>]] [-RequiredModules [<Object[]>]] [-RequiredScripts [<String[]>]] [-Tags [<String[]>]][-Version [<Version>]] [-Confirm] [-WhatIf] [<CommonParameters>]

The Update-ScriptFileInfo cmdlet updates information for a script.

Parameters
-Author [<String>]

Specifies the script author.

-CompanyName [<String>]

Specifies the company or vendor who created the script.

-Copyright [<String>]

Specifies a copyright statement for the script.

-Description [<String>]

Specifies a description for the script.

-ExternalModuleDependencies [<String[]>]

Specifies an array of external module dependencies.

-ExternalScriptDependencies [<String[]>]

Specifies an array of external script dependencies.

-Force [<SwitchParameter>]

Forces the command to run without asking for user confirmation.

-Guid [<Guid>]

Specifies a unique ID for a script.

-IconUri [<Uri>]

Specifies the URL of an icon for the script. The specified icon is displayed on the gallery web page for the script.

-LicenseUri [<Uri>]

Specifies the URL of licensing terms.

-LiteralPath <String>

Specifies a path to one or more locations. Unlike the Path parameter, the value of the LiteralPath parameter is used exactly as it is entered. No characters are interpreted as wildcards. If the path includes escape characters, enclose them in single quotation marks. Single quotation marks tell Windows PowerShell not to interpret any characters as escape sequences.

-PassThru [<SwitchParameter>]

Returns an object representing the item with which you are working. By default, this cmdlet does not generate any output.

-Path <String>

Specifies a path to one or more locations. Wildcards are permitted. The default location is the current directory (.).

-ProjectUri [<Uri>]

Specifies the URL of a web page about this project.

-ReleaseNotes [<String[]>]

Specifies a string array that contains release notes or comments that you want to be available to users for this version of the script.

-RequiredModules [<Object[]>]

Specifies modules that must be in the global session state. If the required modules are not in the global session state, Windows PowerShell imports them.

-RequiredScripts [<String[]>]

Specifies an array of required scripts.

-Tags [<String[]>]

Specifies an array of tags.

-Version [<Version>]

Specifies the version of the script.

-Confirm [<SwitchParameter>]

  • Default value is false

Prompts you for confirmation before running the cmdlet.Prompts you for confirmation before running the cmdlet.

-WhatIf [<SwitchParameter>]

  • Default value is false

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

<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,ErrorAction, ErrorVariable, WarningAction, WarningVariable,OutBuffer, PipelineVariable, and OutVariable.

Examples
  1. Update the version of a script file:
    PS C:> New-ScriptFileInfo -Path "temptemp-scriptfile.ps1" -Version 1.0 -Author "pattif@contoso.com" -Description "my test script file description goes here"
    PS C:>  Test-ScriptFileInfo -Path "temptemp-scriptfile.ps1"
    
       Version    Name                      Author               Description
       -------    ----                      ------               -----------
       1.0        temp-scriptfile           manikb@microsoft.com my test script file description goes herePS  
    C:> Update-ScriptFileInfo -Path "temptemp-scriptfile.ps1" -Version 2.0 -PassThru
       .VERSION 2.0
       .GUID eb246b19-17da-4392-8c89-7c280f69ad0e
       .AUTHOR manikb@microsoft.com
       .COMPANYNAME
       .COPYRIGHT
       .TAGS
       .LICENSEURI
       .PROJECTURI
       .ICONURI
       .EXTERNALMODULEDEPENDENCIES
       .REQUIREDSCRIPTS
       .EXTERNALSCRIPTDEPENDENCIES
       .RELEASENOTES
       #>
       
       .DESCRIPTION
        my test script file description goes here
       #>
       Param()

    The first command creates a script file and assigns it version 1.0.

    The second command uses the Test-ScriptFileInfo cmdlet to validate temp-scriptfile.ps1 and display the results.

    The third command uses Update-ScriptFileInfo to update the version number to 2.0.

Related Links

New-ScriptFileInfo
Test-ScriptFileInfo