This commit is contained in:
Shital Savekar 2017-01-19 23:52:27 +05:30
Родитель 56fb9d4058
Коммит 6ea7696740
1 изменённых файлов: 5 добавлений и 2 удалений

Просмотреть файл

@ -2221,7 +2221,7 @@ Function RunLinuxCmd([string] $username,[string] $password,[string] $ip,[string]
WrapperCommandsToFile $username $password $ip $command $port
}
$randomFileName = [System.IO.Path]::GetRandomFileName()
$maxRetryCount = 10
$maxRetryCount = 3
$currentDir = $PWD.Path
$RunStartTime = Get-Date
@ -2323,6 +2323,7 @@ Function RunLinuxCmd([string] $username,[string] $password,[string] $ip,[string]
$debugOutput += "$debugString`n"
}
Write-Progress -Activity "Attempt : $attemptswot+$attemptswt : Initiating command in Background Mode : $logCommand on $ip : $port" -Status "Timeout in $($RunMaxAllowedTime - $RunElaplsedTime) seconds.." -Id 87678 -PercentComplete (($RunElaplsedTime/$RunMaxAllowedTime)*100) -CurrentOperation "SSH ACTIVITY : $debugString"
Write-Host "Attempt : $attemptswot+$attemptswt : Initiating command in Background Mode : $logCommand on $ip : $port"
$RunCurrentTime = Get-Date
$RunDiffTime = $RunCurrentTime - $RunStartTime
$RunElaplsedTime = $RunDiffTime.TotalSeconds
@ -2441,6 +2442,7 @@ Function RunLinuxCmd([string] $username,[string] $password,[string] $ip,[string]
$debugOutput += "$debugString`n"
}
Write-Progress -Activity "Attempt : $attemptswot+$attemptswt : Executing $logCommand on $ip : $port" -Status "Timeout in $($RunMaxAllowedTime - $RunElaplsedTime) seconds.." -Id 87678 -PercentComplete (($RunElaplsedTime/$RunMaxAllowedTime)*100) -CurrentOperation "SSH ACTIVITY : $debugString"
Write-Host "Attempt : $attemptswot+$attemptswt : Executing $logCommand on $ip : $port"
$RunCurrentTime = Get-Date
$RunDiffTime = $RunCurrentTime - $RunStartTime
$RunElaplsedTime = $RunDiffTime.TotalSeconds
@ -2481,7 +2483,8 @@ Function RunLinuxCmd([string] $username,[string] $password,[string] $ip,[string]
$debugOutput += "$debugString`n"
}
Write-Progress -Activity "Attempt : $attemptswot+$attemptswt : Executing $logCommand on $ip : $port" -Status $runLinuxCmdJob.State -Id 87678 -SecondsRemaining ($RunMaxAllowedTime - $RunElaplsedTime) -Completed
Remove-Job $runLinuxCmdJob
Write-Host "Attempt : $attemptswot+$attemptswt : Executing $logCommand on $ip : $port"
Remove-Job $runLinuxCmdJob
Remove-Item $LogDir\$randomFileName -Force | Out-Null
if ($LinuxExitCode -imatch "AZURE-LINUX-EXIT-CODE-0")
{