Current version of vagrant is running the snapshot batch scripts as powershell scripts instead
virtuald opened this issue · 3 comments
Is this something you've ran into? What versions of vagrant/virtualbox are you using? Alternatively, maybe it makes sense to just convert those into powershell instead.
This sure looks like a bug in Vagrant. The version I've been using is v2.2.7 which works. However, when I try out the latest (v2.2.9), it falls down like you describe. The shell provisioner is supposed to know whether to use cmd or PowerShell based on the script extension.
There's a clue in the logs. In v2.2.7 I see this:
==> win-msvc15: Running provisioner: shell...
win-msvc15: Running: vagranttools/snapshot.bat as c:\tmp\vagrant-shell.bat
while with v2.2.9 I see this:
==> win-msvc15: Running provisioner: shell...
win-msvc15: Running: vagranttools/snapshot.bat as C:\tmp\vagrant-shell.ps1
It seems like vagrant is deliberately changing the script extension to .ps1
(!), so Windows then tries to execute the script with PowerShell. I don't know why Vagrant is doing this-- that's a particularly big change for a point-release update.
I'm going to dig through Vagrant's issues and see if anyone's reported this. In the meantime, can you try v2.2.7? You can get old versions here.