The un-installation of windows features using powershell quite easy as installing them.
Lets check if we still have “XPS-Viewer” installed as feature on our windows 8 server machine.,
Get-WindowsFeature -Name "XPS-Viewer"
So XPS-Viewer is still installed.
Now lets uninstall it using the cmdlet “Uninstall-WindowsFeature”
run Uninstall-WindowsFeature” with -Name parameter and provide the name of the windows feature which you want to uninstall.
Uninstall-WindowsFeature -Name "XPS-Viewer"
Now it start removing “XPC-Viewer”
one all done this will show the success windows. you can see in the command line output the value of Success is True.
to cross check the un-installation lets run Get-WindowsFeature -Name "XPS-Viewer" again.
and the you can see there is no [x] boxed in the front of the “XPS Viewer” and the install state is available.