Uninstall-Script

Uninstalls a script file.
Uninstall-Script [-Name*] <String[]> [-Force] [-MaximumVersion [<Version>]] [-MinimumVersion [<Version>]][-RequiredVersion [<Version>]] [-Confirm] [-WhatIf] [<CommonParameters>]
Uninstall-Script [-Force] [-Confirm] [-WhatIf] [<CommonParameters>]

The Uninstall-Script cmdlet uninstalls the specified script files from the online gallery.

Parameters
-Force [<SwitchParameter>]

Forces the command to run without asking for user confirmation.

-MaximumVersion [<Version>]

Specifies the maximum, or newest, version of the script to uninstall. The MaximumVersion and RequiredVersion parameters are mutually exclusive; you cannot use both parameters in the same command.

-MinimumVersion [<Version>]

Specifies the minimum version of the script to uninstall. The MinimumVersion and RequiredVersion parameters are mutually exclusive; you cannot use both parameters in the same command.

-Name <String[]>

Specifies an array of names of scripts to uninstall.

-RequiredVersion [<Version>]

Specifies the exact version number of the script to uninstall.

-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. Uninstall a script file:
    PS C:> Uninstall-Script -Name "MyScript" -RequiredVersion 2.5
    

    This command uninstalls version 2.5 of the script file named MyScript.

Related Links

Find-Script
Install-Script
Publish-Script
Save-Script
Update-Script