@@ -2293,13 +2293,13 @@ Function Invoke-vCenterRestore {
22932293 If ($sshSession ) {
22942294 $stream = New-SSHShellStream - SSHSession $sshSession
22952295 $stream.writeline (' appliancesh' )
2296- Start-Sleep 2
2296+ Start-Sleep 5
22972297 $stream.writeline ($restoredvCenterRootPassword )
2298- Start-Sleep 2
2298+ Start-Sleep 5
22992299 $response = $stream.Read ()
2300- Start-Sleep 2
2300+ Start-Sleep 5
23012301 $stream.writeline (' api com.vmware.appliance.recovery.restore.job.get' )
2302- Start-Sleep 2
2302+ Start-Sleep 5
23032303 $restoreStatus = $stream.Read ()
23042304 $restoreStatusArray = $restoreStatus -split (" \r\n" )
23052305 $state = $restoreStatusArray [2 ].trim()
@@ -2319,19 +2319,19 @@ Function Invoke-vCenterRestore {
23192319 $stream.writeline ($restoredvCenterRootPassword )
23202320 Start-Sleep 5
23212321 $response = $stream.Read ()
2322- Start-Sleep 2
2322+ Start-Sleep 5
23232323 $stream.writeline (' api com.vmware.appliance.recovery.restore.job.get' )
2324- Start-Sleep 2
2324+ Start-Sleep 5
23252325 $restoreStatus = $stream.Read ()
23262326 If ($restoreStatus ) {
2327- $restoreStatusArray = $restoreStatus -split (" \r\n" )
2327+ $restoreStatusArray = $restoreStatus -split (" \r\n" )
23282328 If ($restoreStatusArray ) {
23292329 If ($restoreStatusArray [1 ]) {
23302330 $state = $restoreStatusArray [1 ].trim()
23312331 }
23322332 If ($restoreStatusArray [6 ]) {
23332333 $progress = $restoreStatusArray [6 ].trim()
2334- If ($progress -like " Progress*" ) {
2334+ If (( $progress -like " Progress*" ) -AND ( $state -eq " State: INPROGRESS " ) ) {
23352335 LogMessage - type INFO - message " [$restoredVcenterFqdn ] Restore $ ( $progress ) %"
23362336 }
23372337 }
0 commit comments