-2

I am running Windows Server 2016, and added a Windows Feature via the Powershell command:

Add-WindowsFeature NET-WCF-MSMQ-Activation45

If I were to remove/uninstall it, which should I be using?

Remove-WindowsFeature NET-WCF-MSMQ-Activation45

Uninstall-WindowsFeature NET-WCF-MSMQ-Activation45

Also, will a server restart be required after the change?

Thank you.

gymcode
  • 4,431
  • 15
  • 72
  • 128
  • 1
    possible-duplicate: https://serverfault.com/questions/650613/whats-the-difference-between-remove-windowsfeature-and-uninstall-windowsfeature – S.Spieker Dec 03 '18 at 08:53
  • Also see https://learn.microsoft.com/en-us/powershell/module/servermanager/uninstall-windowsfeature – Peter B Dec 03 '18 at 08:56

1 Answers1

3

When in doubt, read the documentation:

Uninstall-WindowsFeature

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.

Ansgar Wiechers
  • 193,178
  • 25
  • 254
  • 328
  • #HOLD UP# It's VERY IMPORTANT we all understand the differences here. Remove-WindowsFeature is the **alias** for ServerManager, that still exists, and Uninstall-WindowsFeature is a cmdlet that **only** removes a role. Remove-WindowsFeature completely take the files out of WinSXS as well, as well as removing features that depend on those files **you did not specify**!!! – Patrick Burwell Sep 01 '22 at 18:03