As I’m discovering the CLI options I can revert to for scripting automated jobs for the XenServer 5.5 environment, I wanted to check out the new PowerShell Snapin provided by Citrix. After downloading and installing the XS-PS Windows installer I discovered that the PowerShell cmdlets were only installed for the PowerShell (X86) console and were not installed for the 64-bits console.

Fortunately for me a solution is mentioned on the XenServer SDK download page

In order to use the cmdlets in the 64-bits PowerShell Console, all you need to do is run the following command after the msi install in a command box:

C:\Windows\Microsoft.NET\Framework64\v2.0.50727>InstallUtil.exe "c:\Program File
s (x86)\Citrix\XenServerPSSnapIn\XenServerPSSnapIn.dll"

 

Giving the following result:

Microsoft (R) .NET Framework Installation utility Version 2.0.50727.3053
Copyright (c) Microsoft Corporation. All rights reserved.

Running a transacted installation.

Beginning the Install phase of the installation.
See the contents of the log file for the c:\Program Files (x86)\Citrix\XenServer
PSSnapIn\XenServerPSSnapIn.dll assembly's progress.
The file is located at c:\Program Files (x86)\Citrix\XenServerPSSnapIn\XenServer
PSSnapIn.InstallLog.
Installing assembly 'c:\Program Files (x86)\Citrix\XenServerPSSnapIn\XenServerPS
SnapIn.dll'.
Affected parameters are:
assemblypath = c:\Program Files (x86)\Citrix\XenServerPSSnapIn\XenServerPSSna
pIn.dll
logfile = c:\Program Files (x86)\Citrix\XenServerPSSnapIn\XenServerPSSnapIn.I
nstallLog
logtoconsole =

The Install phase completed successfully, and the Commit phase is beginning.
See the contents of the log file for the c:\Program Files (x86)\Citrix\XenServer
PSSnapIn\XenServerPSSnapIn.dll assembly's progress.
The file is located at c:\Program Files (x86)\Citrix\XenServerPSSnapIn\XenServer
PSSnapIn.InstallLog.
Committing assembly 'c:\Program Files (x86)\Citrix\XenServerPSSnapIn\XenServerPS
SnapIn.dll'.
Affected parameters are:
assemblypath = c:\Program Files (x86)\Citrix\XenServerPSSnapIn\XenServerPSSna
pIn.dll
logfile = c:\Program Files (x86)\Citrix\XenServerPSSnapIn\XenServerPSSnapIn.I
nstallLog
logtoconsole =

The Commit phase completed successfully.

The transacted install has completed.

C:\Windows\Microsoft.NET\Framework64\v2.0.50727>

 

After the command is run, the XenServer PowerShell Snapin is available in the PowerShell console, which can be checked with the Get-PSSnapin command:

PS C:\Users\admin> Get-PSSnapin -registered

Name : XenServerPSSnapIn
PSVersion : 2.0
Description : Citrix XenServer PowerShell SnapIn

 

And you’re all set up to discover the many PowerShell cmdlets the snapin has to offer.

 

The following sources have been used to create this post:
Download SDKs – XenServer – Citrix Community