If you work on multiple systems and need to use powershell to manage them but they all have their own separate installation it can drive you mad having so many different console shortcuts to launch.
I have 3 at the moment, VMware vSphere PowerCLI, Citrix XenServer PowerShell SnapIn and NetApp’s Data ONTAP PowerShell Toolkit.
Each one installs slightly differently and then runs separately which is a pain.
VMware vSphere PowerCLI installs a PSSnapin and creates this shortcut:
C:\WINDOWS\system32\WindowsPowerShell\v1.0\powershell.exe -psc “C:\Program Files\VMware\Infrastructure\vSphere PowerCLI\vim.psc1” -noe -c “. \”C:\Program Files\VMware\Infrastructure\vSphere PowerCLI\Scripts\Initialize-VIToolkitEnvironment.ps1\””
Citrix XenServer PowerShell SnapIn installs a PSSnapin and creates this shortcut:
"C:\Program Files\Citrix\XenServerPSSnapIn\XenServerPSSnapIn.bat"
which runs
@C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
-PSConsoleFile XenServerPSSnapIn.psc1 -Noexit -Nologo
NetApp’s Data ONTAP PowerShell Toolkit requires you to copy files to the Module Path and then use Import-Module to load the snap-in.
So, Profiles to the rescue……powershell runs a startup script called your profile which is just a text file really.
What I really would like is to have a single profile that launches my session on some computers and starts all 3 snap-ins if they are installed.
That’s not a big ask, is it?
Well, lets start with setting up the profile on this particular computer to launch all 3 snap-ins but be clever and allow it to also be run from anywhere.
Read more…
Recent Comments