Skip to content

Latest commit

 

History

History
239 lines (168 loc) · 4.92 KB

File metadata and controls

239 lines (168 loc) · 4.92 KB
external help file PSModule-help.xml
Locale en-US
Module Name PowerShellGet
ms.date 07/03/2019
online version https://learn.microsoft.com/powershell/module/powershellget/uninstall-script?view=powershellget-2.x&WT.mc_id=ps-gethelp
schema 2.0.0
title Uninstall-Script

Uninstall-Script

SYNOPSIS

Uninstalls a script.

SYNTAX

NameParameterSet (Default)

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

InputObject

Uninstall-Script [-InputObject] <PSObject[]> [-Force] [-WhatIf] [-Confirm] [<CommonParameters>]

DESCRIPTION

The Uninstall-Script cmdlet uninstalls a specified script from the local computer.

EXAMPLES

Example 1: Uninstall a script

This example uninstalls a script.

Uninstall-Script -Name UpdateManagement-Template

Uninstall-Script uses the Name parameter to specify the script to uninstall from the local computer.

Example 2: Use the pipeline to uninstall a script

In this example, the pipeline is used to uninstall a script.

Get-InstalledScript -Name UpdateManagement-Template | Uninstall-Script

Get-InstalledScript uses the Name parameter to specify the script. The object is sent down the pipeline to Uninstall-Script and the script is uninstalled.

PARAMETERS

-AllowPrerelease

Allows you to uninstall a script marked as a prerelease.

Type: System.Management.Automation.SwitchParameter
Parameter Sets: NameParameterSet
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Force

Forces Uninstall-Script to run without asking for user confirmation.

Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-InputObject

Accepts a PSRepositoryItemInfo object. For example, output Get-InstalledScript to a variable and use that variable as the InputObject argument.

Type: System.Management.Automation.PSObject[]
Parameter Sets: InputObject
Aliases:

Required: True
Position: 0
Default value: None
Accept pipeline input: True (ByPropertyName, ByValue)
Accept wildcard characters: False

-MaximumVersion

Specifies the maximum, or newest, version of the script to uninstall. The MaximumVersion and RequiredVersion parameters can't be used in the same command.

Type: System.String
Parameter Sets: NameParameterSet
Aliases:

Required: False
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 can't be used in the same command.

Type: System.String
Parameter Sets: NameParameterSet
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-Name

Specifies an array of script names to uninstall.

Type: System.String[]
Parameter Sets: NameParameterSet
Aliases:

Required: True
Position: 0
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-RequiredVersion

Specifies the exact version number of the script to uninstall.

Type: System.String
Parameter Sets: NameParameterSet
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-Confirm

Prompts you for confirmation before running Uninstall-Script.

Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases: cf

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

-WhatIf

Shows what would happen if Uninstall-Script runs. The cmdlet isn't run.

Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases: wi

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

System.String[]

System.Management.Automation.PSObject[]

System.String

OUTPUTS

System.Object

NOTES

RELATED LINKS

Find-Script

Install-Script

Publish-Script

Save-Script

Update-Script