vagrant commands completion in PowerShell
- Run in PowerShell
##Requires git
$PathArray=@($env:PSModulePath -split ';')
$ModulePath = $PathArray | Where-Object -FilterScript {$_ -like "*$env:USERNAME*"}
if (-not(Test-Path $ModulePath)) {
New-Item -Path $ModulePath -ItemType Directory
}
Push-Location -Path $ModulePath -StackName Original
$GIT_URL = "https://github.com/cert01/posh-vagrant"
$GIT_FILE = "posh-vagrant.psm1"
git clone --no-checkout --depth=1 --no-tags $GIT_URL
Push-Location -Path .\posh-vagrant\
git restore --staged $GIT_FILE
git checkout
git restore $GIT_FILE
git restore --staged *
Pop-Location -StackName Original
if (Add-Content $PROFILE.CurrentUserAllHosts -Value 'Import-Module posh-vagrant') {Import-Module posh-vagrant}