Hello All
I do not have much knowledge of Powershell but I'm trying to create a snapshot in vcloud.link-connect.com with below script but I'm getting an error as term "Connect-CIServer is not recognized.
I would really appreciate if you could help me fix this issue. please find my script below.
if ( !(Get-Module -Name VMware.VimAutomation.Core -ErrorAction SilentlyContinue) ) {
"C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI\Scripts\Initialize-PowerCLIEnvironment.ps1"
}
$srv= connect-CIServer -Server vcloud.link-connect.com -user xx -Password xxx -Org xxx
$vm10 = Get-CIvm "xxxx"-
$vm10.ExtensionData.RemoveAllSnapshots()
$vm10.ExtensionData.CreateSnapshot($null,$null,"$null","$null")
Many Thanks
Dan
What version of PowerCLI are you using? Latest versions, you'd have to:
import-module VMware.VimAutomation.Cloud
or
import-module vmware.powercli
Hi
I'm using 5.5 Release 1.
Thank you for taking time to reply my question.
Would really appreciate if you continue help to fix this issue.
Hi
Could someone please give a professional touch to this script so that I could Revert snapshot with results and then take a snapshot again
I would really appreciate your response.
Thanks
if ( !(Get-Module -Name VMware.VimAutomation.Core -ErrorAction SilentlyContinue) ) {
"C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI\Scripts\Initialize-PowerCLIEnvironment.ps1"
}
$srv= connect-CIServer -Server vcloud.link-connect.com -user xx -Password xxx -Org xxx
$vm = Get-CIvm "xxxx"-
$vm.ExtensionData.RemoveAllSnapshots() ???? Need Revert Script please !!
$vm.ExtensionData.CreateSnapshot($null,$null,"$null","$null")
You can use $vm.ExtensionData.RevertToCurrentSnapshot() to revert to the current snapshot.