Search The Web

Tuesday, April 8, 2014

Use Powershell to Uninstall or Install Windows Roles and Features

Use Powershell to Uninstall or Install Windows Roles and Features 

You can use Powershell or uninstall or install Windows Roles and Features instead of using the GUI. This is especially useful in two scenarios : Server Core installations and also for scripting (new server installs, remote installs etc).
Firstly, you will need to identify the name of the Windows Feature that you wish to add / remove. Open an Administrative powershell prompt and type:  get-windowsfeature
Get-Windowsfeature
Get-Windowsfeature
Once you have identified the roles and feature that you wish to remove (in this case we are going to remove the gui shell) tye the command uninstall-windowsfeature If you want to force a reboot at the end of the process then use the -reboot switch.
Uninstall-windowsfeature
Uninstall-windowsfeature
If you wanted to re install this feature, or install any other feature then again open an administrative powershell prompt and type install-windowsfeature
Install-WindowsFeature
Install-WindowsFeature
Again, if you wanted to force the reboot (especially useful when scripting this then add the -reboot switch.







No comments:

Post a Comment