Uninstall-Script

Uninstalls a script file.

Syntax

Uninstall-Script
         [-Name] <String[]>
         [-MinimumVersion <Version>]
         [-RequiredVersion <Version>]
         [-MaximumVersion <Version>]
         [-Force]
         [-WhatIf]
         [-Confirm]
         [<CommonParameters>]
Uninstall-Script
         -InputObject <PSObject[]>
         [-Force]
         [-WhatIf]
         [-Confirm]
         [<CommonParameters>]

Description

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

Examples

Example 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.

Required Parameters

-InputObject

{{Fill InputObject Description}}

Type: PSObject[]
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName, ByValue)
Accept wildcard characters: False
-Name

Specifies an array of names of scripts to uninstall.

Type: String[]
Position: 1
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

Optional Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Type: SwitchParameter
Aliases: cf
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
-Force

Forces the command to run without asking for user confirmation.

Type: SwitchParameter
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-MaximumVersion

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.

Type: Version
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
-MinimumVersion

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.

Type: Version
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
-RequiredVersion

Specifies the exact version number of the script to uninstall.

Type: Version
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
-WhatIf

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

Type: SwitchParameter
Aliases: wi
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False