Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
$targetsfile_loc = "C:\Path\To\Script_Dir\vagrant.list"
$vagrant_cmd = "C:\HashiCorp\Vagrant\bin\vagrant.exe"
$putty_cmd = "C:\Path\To\putty.exe"
$current_loc = Get-Location
$targets = Get-Content $targetsfile_loc
ForEach ($target in $targets) {
$vagrant_dir,$putty_prof = $target.split(",")
Set-Location $vagrant_dir -PassThru
& $vagrant_cmd up
Start-Process $putty_cmd -ArgumentList ("-load", $putty_prof) -PassThru
}
Set-Location $current_loc -PassThru
C:\Path\To\vagrant1,putty_session1
C:\Path\To\vagrant2,putty_session2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment