PowerCLI-Example-Scripts
PowerCLI-Example-Scripts copied to clipboard
StartTime not working when recomposing
When running the following code i get an error. The recompose happens but the starttime is not set and task runs immediately
#recompose
$ce_delay = 10
$Start_time = (Get-Date).AddMinutes($ce_delay)
Start-HVPool -Pool $ce_pool_id -Recompose -StartTime $Start_time -LogoffSetting WAIT_FOR_LOGOFF -StopOnFirstError $false -ParentVM $ce_base_vm -SnapshotVM $($ce_snapshot.name)
ErrorRecord : The property 'startTime' cannot be found on this object. Verify that the property exists and can be set.
WasThrownFromThrowStatement : False
Message : The property 'startTime' cannot be found on this object. Verify that the property exists and can be set.
Data : {System.Management.Automation.Interpreter.InterpretedFrameInfo}
InnerException :
TargetSite : Void CheckActionPreference(System.Management.Automation.Language.FunctionContext, System.Exception)
StackTrace : at System.Management.Automation.ExceptionHandlingOps.CheckActionPreference(FunctionContext funcContext, Exception exception)
at System.Management.Automation.Interpreter.ActionCallInstruction`2.Run(InterpretedFrame frame)
at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
at System.Management.Automation.Interpreter.Interpreter.Run(InterpretedFrame frame)
at System.Management.Automation.Interpreter.LightLambda.RunVoid1[T0](T0 arg0)
at System.Management.Automation.PSScriptCmdlet.RunClause(Action`1 clause, Object dollarUnderbar, Object inputToProcess)
at System.Management.Automation.PSScriptCmdlet.DoEndProcessing()
at System.Management.Automation.CommandProcessorBase.Complete()
HelpLink :
Source : System.Management.Automation
HResult : -2146233087
Versions....
Manifest 1.3.1 VMware.Hv.Helper {Add-HVDesktop, Add-HVRDSServer, Clear-HVEventDatabase, Connect-HVEvent...}
Script 7.0.0.15939650 VMware.Vim
Script 12.0.0.15939657 VMware.VimAutomation.Cis.Core {Connect-CisServer, Disconnect-CisServer, Get-CisService}
Script 12.0.0.15939652 VMware.VimAutomation.Common {Get-Task, New-OAuthSecurityContext, Stop-Task, Wait-Task}
Script 12.0.0.15939655 VMware.VimAutomation.Core {Add-PassthroughDevice, Add-VirtualSwitchPhysicalNetworkAdapter, Add-VMHost, Add-VMHostNtpServer...}
Script 7.12.0.15718406 VMware.VimAutomation.HorizonView {Connect-HVServer, Disconnect-HVServer}