diff --git a/powershell/hyperv/hyperv.go b/powershell/hyperv/hyperv.go index 28213605a..67ad79d82 100644 --- a/powershell/hyperv/hyperv.go +++ b/powershell/hyperv/hyperv.go @@ -782,10 +782,7 @@ param([string]$vmName, [string]$scanCodes) if (!$timeToWait){ $timeToWait = "1" } - - write-host "Special code found, will sleep $timeToWait second(s) at this point." - Start-Sleep -s $timeToWait - + if ($scanCodesToSend){ $scanCodesToSendByteArray = [byte[]]@($scanCodesToSend.Split(' ') | %{"0x$_"}) @@ -794,6 +791,9 @@ param([string]$vmName, [string]$scanCodes) } } + write-host "Special code found, will sleep $timeToWait second(s) at this point." + Start-Sleep -s $timeToWait + $scanCodesToSend = '' } else { if ($scanCodesToSend){