Thursday, January 3, 2013

Installing Windows Features using Powershell V3


While working on Powershell V3 i have realised that Scripting are going to be easy. Scripters just need to add bunch of cmdlets to the scripts and done. In Powershell V3 Microsoft had make CMDLET for almost everything or for every task.

The main task which SYSADMINS do this installing extra windows features in to the server or to the desktops. These features may be setup a server a DHCP,DNS,FAX or a simple feature like installing or enabling XPS viewer.

I am using a fresh installation of “Windows Server 2012 Standard Edition with GUI” and i do often view and read “XPS formatted  Documents”. BY Default the XPS file viewer is not installed on “Windows server 2012”. 

So i think why not install it using the Powershell V3 cmdlet. 

To get the list of all available/installed windows feature we can use the cmdlet


The features those have [x] in the from of them means that they are installed.  When you query any single feature using  “Get-WindowsFeature” cmdlet then provide the NAME of the feature not the “Display Name”

03-01-2013 12-07-44

Let’s see if the “XPS Viewer” is installed or not.

Get-WindowsFeature -Name “XPS-Viewer”

You can see that XPS-Viewer is available but it is not installed.
03-01-2013 12-08-46

To install Windows features we have to use the cmdlet “Install-WindowsFeature

Let’ install XPS-Viewer, run the below command line.

Install-WindowsFeature -Name “XPS-Viewer”

You can see it start Installing.

03-01-2013 12-10-05

When installation is done it shows the below screen, that installation is “Successful” and Reboot is “Not required” .

03-01-2013 12-11-47
let’s query the “XPS-Viewer” again using Get-WindowsFeature

Get-WindowsFeature -Name “XPS-Viewer”

and now we can see a [x] in the front of Display Name and the Install State in “Installed”

03-01-2013 12-12-12

and we can see XPS Viewer on our Desktop too.

03-01-2013 12-13-25

Nice Smile isn’t.


Aman Dhally


clip_image001 clip_image002 clip_image003 clip_image005 clip_image007

No comments:

Post a Comment