Sunday, November 27, 2011

Powershell Profiles and Snap-Ins


Instead of me blabbering on about Powershell Profiles I’ve found a good Microsoft Technet page that does all that for me!! And…you can find it here….

you may also have to look at the execution policy of the system and you can see how to do all that from this link here….

The execution policy is a security measure so it’s not there just to rain on your parade!!!!

Getting back to Powershell Profiles…..I have found three good utils, or rather snap-ins….the Quest active roles I’ve mentioned before and to compliment that I’ve downloaded the Microsoft Powershell Community Extensions or rather to give it a nickname……PSCX. And from VMWare the PowerCLI a powershell snap-in for VMWare OSs.

Now….here is the thing….the bad rub of the green….the rain on your parade!!! Once you have these installed the Powershell GUI or CLI interface does not…. No dont cry….it’s all to do with your blank profile….edit your own profile (Notepad or wordpad will do!) and to make sure that for each GUI or CLI powershell session picks up the snap-in, permanently, enter the command
add-pssnapin quest.activeroles.admanagement
save the file, and any powershell session will now execute that command when you launch a powershell session.

The Snap-Ins I use I have scripted, any time I launch Powershell I just run the scrip to load the snapins...the script contains these lines

Add-PSSnapin quest.activeroles.admanagement (Quest Active Roles) Add-PSSnapIn VMware.VumAutomation (VMWare) Add-PSSnapin VMware.VimAutomation.Core (VMWare)

For the Microsoft Powershell Community Extensions, run the MSI file and take the option AMMEND TO PROFILE and now you have both snap-ins configured for any Powershell session.

You can configure system wide profiles, I just configured my own profile though.

Opps before I forget links for PSCX ,PowerCLI and QAD stuff are here….
http://pscx.codeplex.com/   you may need to register for MSCX
http://www.quest.com/powershell/activeroles-server.aspx

No comments:

Post a Comment