8

What's the difference between Remove-WindowsFeature and Uninstall-WindowsFeature?

I've used Add- and Remove- on Windows 2008 R2 boxes, but there is now an Install- and Uninstall- which according to MSDN is only on Windows 2012 and 8

3
  • 1
    I voted to move this to ServerFault.com. I feel it is more likely that you will run into people that have used both methods there.
    – EBGreen
    Dec 9, 2014 at 18:02
  • And I vote to close as we do not deal here with "hey, I am too lazy to read the documentation" questions.
    – TomTom
    Dec 10, 2014 at 18:04
  • I know the Add Remove is superseded by the Install / Uninstall, but there is nothing I could find about what the actual change is!
    – SteveC
    Dec 12, 2014 at 14:23

2 Answers 2

7

There's a subtle difference in behavior that the 2012 version "optionally removes" the feature, and that IncludeManagementTools must be included as a parameter to remove the management console as part of the uninstallation of the feature, and Remove must be included to remove the feature files from the computer that would allow the feature to be reinstalled.

All other differences are clear by their presence/omission in the documentation.

Remove-WindowsFeature (2008 R2 documentation):

The Remove-WindowsFeature cmdlet has been replaced in Windows Server 2012 and forward by the Uninstall-WindowsFeature cmdlet.

[...]

The Remove-WindowsFeature cmdlet allows you to remove specified roles, role services, and features from a computer that is running Windows Server 2008 R2. The Remove-WindowsFeature cmdlet functions similarly to the Remove Roles Wizard and Remove Features Wizard that you can start from the Server Manager UI. As in those wizards, you can remove more than one role, role service, or feature per session. You can find a list of command IDs for all roles, role services, and features in the topic Overview of Server Manager Commands in the Server Manager Help.

From: http://msdn.microsoft.com/en-us/library/ee662310.aspx

Uninstall-WindowsFeature (2012 Documentation):

By adding the Remove parameter, also deletes feature files, or payload, from a computer.

[...]

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.

From: http://technet.microsoft.com/en-us/library/jj205471.aspx

0
2

Nothing

PS C:\> help remove-windowsfeature

NAME
    Uninstall-WindowsFeature

SYNTAX
    Uninstall-WindowsFeature [-Name] <Feature[]> [-Restart] [-IncludeManagementTools] [-Remove] [-ComputerName
    <string>] [-Credential <pscredential>] [-LogPath <string>] [-WhatIf] [-Confirm]  [<CommonParameters>]

    Uninstall-WindowsFeature [-Name] <Feature[]> [-Vhd <string>] [-IncludeManagementTools] [-Remove] [-ComputerName
    <string>] [-Credential <pscredential>] [-LogPath <string>] [-WhatIf] [-Confirm]  [<CommonParameters>]


ALIASES
    Remove-WindowsFeature


REMARKS
    Get-Help cannot find the Help files for this cmdlet on this computer. It is displaying only partial help.
        -- To download and install Help files for the module that includes this cmdlet, use Update-Help.
2
  • Well, that is what you get on a Windows 2012 server. That supports the fact that only Uninstall is installed on a 2012 machine and was aliased to Remove. The question is about the difference between Uninstall (which exists on 2012) and Remove (which exists on 2008).
    – EBGreen
    Dec 10, 2014 at 19:31
  • Interesting. I had no idea. Dec 10, 2014 at 21:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.