Tuesday, January 1, 2013

Managing Control Panel Items using Powershell v3.

Hi,

First of all “Happy New Year” everyone. New year is started and this is a good time to start learning  new things. I think the best things to learn for me is a “Powershell Version 3”.

Yesterday i installed a “Windows Server 2012 Standard Edition with GUI” in a virtual machine. As i am planning to cover new cmdlets on “Powershell Version"3” and then we can end up by writing scripts.

01-01-2013 11-21-04 “I like  it”

The interface of “Windows Server 2012 Standard Edition”  is pretty neat and clean. I like GUI interface of the server 2012 to be it feel very sober and attractive”

My current “Windows 2012 Server” machine is a standalone and not added to Active Directory yet.

To check the version of Powershell on “Windows 2012 server” Click on Powershell icon to open powershell console and type the cmdlet “$PSVersionTable

$PSVersionTable

You can see in below image that the Powershell version 3.0 is installed.


01-01-2013 11-24-01


In few of my old scripts when i want to open any control panel item i used to call the .CPL extensions. for example if i want to open “Network Connection” then i used to call “NCPA.cpl” in my script.


But in Powershell V3 they actually created a 2 new cmdlets to open control panel items and believe me they are going to be very handy.


The first cmdlet is “Get-ControlPanelItem

Get-ControlPanelItem


when you run “Get-ControlPanelItem” in Powershell console this gives  list of Names of  all items those are in control panel.


01-01-2013 11-25-50


Now we know how many and which items we have in control panel. To open those items we need second cmdlet which “Show-ControlPanelItem

Show-ControlPanelItem

lets open few control panel items.

Show-ControlPanelItem -Name "Folder Options"

01-01-2013 11-29-31


and lets open Display Properties.

Show-ControlPanelItem -Name "Display"

01-01-2013 11-27-53


Cool isn't?


Thanks


Aman Dhally


join aman on facebook Join aman on Linkedin follow aman on Twitter blogger-icon

No comments:

Post a Comment