Jump to content


Photo

PVS 7.x Powershell unable to add-pvsdiskversion

Started by James Scanlon , 02 February 2017 - 02:00 PM
1 reply to this topic

James Scanlon Members

James Scanlon
  • 9 posts

Posted 02 February 2017 - 02:00 PM

Hi All

Following these guides 

https://docs.citrix.com/content/dam/docs/en-us/provisioning-services/7-12/downloads/PvsSnapInCommands_7_12_v2.pdf

https://docs.citrix.com/content/dam/docs/en-us/provisioning-services/7-7/downloads/PowerShellObjectProgramGuide7-7.pdf

 

I have been trying to automate a vDisk version creation with powershell for PVS.

 

Regardless of where I run the powershell command (locally or on the server) or whether I use PVS Version 7.6 or 7.9 the command doesnt work.

 

Result:

 

PS C:\users\user> get-pvsdisklocator -guid b794b123-9dd0-4cc3-be95-3de4000b3ea5 | add-pvsdiskversion
add-pvsdiskversion : Freddy.xml: vDisk file was not found.
At line:1 char:65
+ get-pvsdisklocator -guid b794b123-9dd0-4cc3-be95-3de4000b3ea5 | add-pvsdiskversi ...
+                                                                 ~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Citrix.PVS.Snap...VersionSet : 0
:PvsDiskLocator) [Add-PvsDiskVersion], PvsException
    + FullyQualifiedErrorId : Citrix.PVS.SnapIn.VDiskFileNotFound,Citrix.PVS.SnapIn.AddPvsDiskVersion
 
So then I exported the XML File for the vDisk and repeat the above command (or run the below command) I keep getting the same result 'Object not found: PVS Exception
 
PS H:\> add-pvsdiskversion -name "Freddy" -sitename "London" -StoreName "Freddy"
add-pvsdiskversion : No object was added, updated, or deleted in the last operation.
At line:1 char:1
+ add-pvsdiskversion -name "Freddy" -sitename "London ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (System.Collecti...ystem.String][]:KeyValuePair`2[]) [Add-PvsDiskVersion], PvsException
    + FullyQualifiedErrorId : Citrix.PVS.SnapIn.ZeroObjectsAffected,Citrix.PVS.SnapIn.AddPvsDiskVersion

 

Any advice?

Any feedback or assistance much appreciated
Cheers!

 



Harish A Citrix Employees

Harish A
  • 19 posts

Posted 03 February 2017 - 05:43 PM

Hello James,
 
To use the snapin, you have to first register it (requires .Net framework). If your Windows is 32bits, use this command:
 
“C:\Windows\Microsoft.NET\Framework\v2.0.50727\installutil.exe” “C:\Program Files\Citrix\Provisioning Services Console\McliPSSnapIn.dll”
 
For 64bits:
 
“C:\Windows\Microsoft.NET\Framework64\v2.0.50727\installutil.exe” “C:\Program Files\Citrix\Provisioning Services Console\McliPSSnapIn.dll”
 
If you encountered error, make sure that you are running the Command Prompt as administrator.
 
Once registered, start a PowerShell console and add the snapin using “add-PSSnapIn mclipssnapin"
 

Then you can use below command to add vDisk version

 

add-pvsdiskversion -name "Freddy" -sitename "London" -StoreName "Freddy"