For some reason I'm getting the following error:
==> test: del : Cannot remove item C:\Windows\Temp\WinRM_Elevated_Shell.log: The process cannot access the file
==> test: 'C:\Windows\Temp\WinRM_Elevated_Shell.log' because it is being used by another process.
==> test: At C:\tmp\vagrant-elevated-shell.ps1:19 char:3
==> test: + del $out_file
==> test: + ~~~~~~~~~~~~~
==> test: + CategoryInfo : WriteError: (C:\Windows\Temp\WinRM_Elevated_Shell.log:FileInfo) [Remove-Item], IOExcepti
==> test: on
==> test: + FullyQualifiedErrorId : RemoveFileSystemItemIOError,Microsoft.PowerShell.Commands.RemoveItemCommand
My Vagrantfile has something like:
config.vm.provision "shell", inline: "c:/tmp/provision/install-a.ps1", name: "Install a"
config.vm.provision "shell", inline: "c:/tmp/provision/install-b.ps1", name: "Install b"
The error happens when its trying to run the second provision script.
TIA!
PS Host and Guest is Windows 10 64-bit. Vagrant is 1.8.4. VirtualBox is 5.0.24r108355.