Asnp Citrix.*
This loads the Citrix-specific PowerShell modules. (Asnp means Add-PSSnapin).
New-HypVMSnapshot -AdminAddress $XDServername -LiteralPath 'XDHyp:\VMPATH\VMNAME.vm' -SnapshotName "$filename" -SnapshotDescription "$description"
Step 3: Now to update the Catalog with the latest snapshot that was taken in the Step 2. To get the last snapshot name use the command
Get-ChildItem using the following syntax:
(Get-ChildItem -Recurse -path 'XDHyp:\HostingUnits\Path of the MasterImage.vm').PSPath
provscheme -AdminAddress ‘$XDServerName’
Publish-ProvMasterVmImage -AdminAddress ‘XDServername’ -ProvisioningSchemeUid 'Value’ -MasterImageVM ‘$VMname’
#To take the snapshot of the master image
#Load The Citrix Snapins
Asnp Citrix.*
#Declare the variables
$XDserver = "Server Name"
$filename = "MasterImage_Snapshot_$(get-date -f MMM-d-yyyy-hh-mm)"
$description = "MasterImage_Sanpshot_$(get-date -f MMM-d-yyyy-hh-mm)"
# To take Snapshot of the Master VDI
New-HypVMSnapshot -AdminAddress '$XDserver' -LiteralPath 'XDHyp:\connections\Path of the VM\VMNAME.vm' -SnapshotName "$filename" -SnapshotDescription "$description"
#To update the Pooled Catalog
#Add the Citrix snap-ins
Asnp Citrix.*
#Variables declaration
$XDserver = "Server Name"
$ProvisioningSchemeUid = “ProvisioningSchemeUid”
#To get the Snapshot details - with the hosting unit
(Get-ChildItem -Recurse -path 'XDHyp:\Path\VMName.vm').PSPath > 'C:\temp\Snapshotdetails.txt'
$Snapshot = @(gc "C:\temp\Snapshotdetails.txt" | Select-Object -last 1)
$Snapshot = $Snapshot.trimstart("Citrix.Host.Admin.V1\Citrix.Hypervisor::")
# Update the Master Image details and update the catalog
Publish-ProvMasterVmImage -AdminAddress "$XDserver" -ProvisioningSchemeUid ‘$ProvisioningSchemeUid' -MasterImageVM $Snapshot
Have a question about something in this article? You can receive help directly from the article author. Sign up for a free trial to get started.
Comments (0)