Search code examples
powershellmsmqwindows-serverwindows-server-2016

Difference Between Remove and Uninstall WindowsFeature


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.


Solution

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