Skip to content

Instantly share code, notes, and snippets.

@richard24se
Last active July 17, 2019 02:07
Show Gist options
  • Save richard24se/f5bf70ad45be6f2959852faf426d7360 to your computer and use it in GitHub Desktop.
Save richard24se/f5bf70ad45be6f2959852faf426d7360 to your computer and use it in GitHub Desktop.
function dogrant{
$actualPath = Get-Location | select Path -ExpandProperty Path
#EDIT THIS PATH
$remotePath = "apps/"
#USE TYPE DIRECTORY LIKE THIS :---> c:\apps\backend\users or c:\apps\frotend\sync
$parent = (get-item $(Get-Location)).parent | select Name -ExpandProperty Name
$current = Split-Path -leaf -path (Get-Location)
$targetPath = $remotePath+""+$parent+"/"+$current
#EDIT DIRECTORY OF VAGRANT
cd C:\vagrant
$command = "cd "+$targetPath+"; /bin/bash"
vagrant ssh -c $command
Write-Host "saliste! Regresas a tu anterior Path..."
cd $actualPath
}
function vacker([string]$option){
$actualPath = Get-Location | select Path -ExpandProperty Path
cd C:\vagrant
vagrant $option
Write-Host "saliste! Regresas a tu anterior Path..."
cd $actualPath
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment