From 199bee688565323a65ccc9e1b495a018d81e7ecb Mon Sep 17 00:00:00 2001 From: Taliesin Sisson Date: Sat, 7 Nov 2015 23:33:47 +0000 Subject: [PATCH] Need to sleep after sending previous characters, not before --- powershell/hyperv/hyperv.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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){