diff --git a/provisioner/guest_commands_test.go b/provisioner/guest_commands_test.go index d07c4bd44..dcf2212ea 100644 --- a/provisioner/guest_commands_test.go +++ b/provisioner/guest_commands_test.go @@ -38,13 +38,13 @@ func TestCreateDir(t *testing.T) { t.Fatalf("Failed to create new GuestCommands for OS: %s", WindowsOSType) } cmd = guestCmd.CreateDir("C:\\Windows\\Temp\\tempdir") - if cmd != "New-Item -ItemType directory -Force -ErrorAction SilentlyContinue -Path C:\\Windows\\Temp\\tempdir" { + if cmd != "powershell.exe -Command \"New-Item -ItemType directory -Force -ErrorAction SilentlyContinue -Path C:\\Windows\\Temp\\tempdir\"" { t.Fatalf("Unexpected Windows create dir cmd: %s", cmd) } // Windows OS w/ space in path cmd = guestCmd.CreateDir("C:\\Windows\\Temp\\temp dir") - if cmd != "New-Item -ItemType directory -Force -ErrorAction SilentlyContinue -Path C:\\Windows\\Temp\\temp` dir" { + if cmd != "powershell.exe -Command \"New-Item -ItemType directory -Force -ErrorAction SilentlyContinue -Path C:\\Windows\\Temp\\temp` dir\"" { t.Fatalf("Unexpected Windows create dir cmd: %s", cmd) } } @@ -108,13 +108,13 @@ func TestRemoveDir(t *testing.T) { t.Fatalf("Failed to create new GuestCommands for OS: %s", WindowsOSType) } cmd = guestCmd.RemoveDir("C:\\Temp\\SomeDir") - if cmd != "rm C:\\Temp\\SomeDir -recurse -force" { + if cmd != "powershell.exe -Command \"rm C:\\Temp\\SomeDir -recurse -force\"" { t.Fatalf("Unexpected Windows remove dir cmd: %s", cmd) } // Windows OS w/ space in path cmd = guestCmd.RemoveDir("C:\\Temp\\Some Dir") - if cmd != "rm C:\\Temp\\Some` Dir -recurse -force" { + if cmd != "powershell.exe -Command \"rm C:\\Temp\\Some` Dir -recurse -force\"" { t.Fatalf("Unexpected Windows remove dir cmd: %s", cmd) } } \ No newline at end of file