Windows Powershell commands need to specify shell

The WinRM communicator defaults to the regular Windows cmd shell so we need to tell Packer to use Powershell when running these guest commands.
This commit is contained in:
Shawn Neal 2015-08-20 13:25:27 -07:00
parent 67f6d6cdb5
commit affebcda86
1 changed files with 2 additions and 2 deletions

View File

@ -23,8 +23,8 @@ var guestOSTypeCommands = map[string]guestOSTypeCommand{
},
WindowsOSType: guestOSTypeCommand{
chmod: "echo 'skipping chmod %s %s'", // no-op
mkdir: "New-Item -ItemType directory -Force -ErrorAction SilentlyContinue -Path %s",
removeDir: "rm %s -recurse -force",
mkdir: "powershell.exe -Command \"New-Item -ItemType directory -Force -ErrorAction SilentlyContinue -Path %s\"",
removeDir: "powershell.exe -Command \"rm %s -recurse -force\"",
},
}