PowerShell Logo Small

Uninstall-WindowsFeature



This is the built-in help made by Microsoft for the command 'Uninstall-WindowsFeature', in PowerShell version 5 - as retrieved from Windows version 'Microsoft Windows Server 2012 R2 Standard' PowerShell help files on 2016-06-23.

For PowerShell version 3 and up, where you have Update-Help, this command was run just before creating the web pages from the help files.

SYNOPSIS

Uninstalls specified Windows Server roles, role services, and features from a computer that is running Windows Server 2012 R2. By adding the Remove parameter, also deletes feature files, or payload, from a computer. This cmdlet replaces Remove-WindowsFeature, the cmdlet that was used to uninstall roles, role services, and features in Windows Server 2008 R2.

SYNTAX


Uninstall-WindowsFeature [-Name] <Feature[]> [-ComputerName <String>] [-Credential <PSCredential>] [-IncludeManagementTools] [-LogPath <String>] [-Remove] [-Restart]
[-Confirm] [-WhatIf] [<CommonParameters>]
Uninstall-WindowsFeature [-Name] <Feature[]> [-ComputerName <String>] [-Credential <PSCredential>] [-IncludeManagementTools] [-LogPath <String>] [-Remove] [-Vhd <String>]
[-Confirm] [-WhatIf] [<CommonParameters>]



Search powershellhelp.space

DESCRIPTION


The Uninstall-WindowsFeature cmdlet uninstalls and optionally removes specified roles, role services, and features from a computer that is running Windows Server 2012 R2, or
from an offline virtual hard disk (VHD) on which Windows Server 2012 R2 is installed. This cmdlet works similarly to the Remove Roles and Features Wizard in Server Manager,
with an important exception: by default, management tools are not uninstalled when you run the Uninstall-WindowsFeature cmdlet; you must add the IncludeManagementTools
parameter to uninstall associated management tools.


This cmdlet requires elevation; you must be running a Windows PowerShell session as an administrator to use this cmdlet.



<

RELATED LINKS

Online Version: http://go.microsoft.com/fwlink/p/?linkid=287572
Get-WindowsFeature
Install-WindowsFeature
Enable-ServerManagerStandardUserRemoting
Disable-ServerManagerStandardUserRemoting

REMARKS

<

Examples


EXAMPLE 1

PS C:\> Get-WindowsFeature | Where-Object -FilterScript { $_.Installed -Eq $TRUE } | Uninstall-WindowsFeature



This example uninstalls any roles or features that are currently installed on the target server.




EXAMPLE 2

PS C:\> Uninstall-WindowsFeature -Name Web-Server -ComputerName Server1 -Credential contoso\user1



This example removes Web Server (IIS) from Server1, including all role services. The user account specified to perform the operation is contoso\user1.




EXAMPLE 3

PS C:\> Get-WindowsFeature | Where-Object -FilterScript { $_.Installed -Eq $FALSE } | Uninstall-WindowsFeature –Remove



This example deletes the feature files for any roles or features that currently are not installed on the local server.