Files
LuaCsForBarotraumaEP/luacs-docs/scripts/location.psm1
2022-08-14 18:03:56 -04:00

15 lines
329 B
PowerShell

[System.Collections.ArrayList]$Locations = @()
function Change-Location($path) {
$loc = Get-Location
$Locations.Add($loc) | Out-Null
Set-Location $path | Out-Null
}
function Restore-Location {
$idx = $Locations.Count - 1
$loc = $Locations[$idx]
$Locations.RemoveAt($idx) | Out-Null
Set-Location $loc | Out-Null
}