Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
30 lines (26 sloc) 639 Bytes
# General Utility Functions
function Coalesce-Args {
$result = $null
foreach($arg in $args) {
if ($arg -is [ScriptBlock]) {
$result = & $arg
} else {
$result = $arg
}
if ($result) { break }
}
$result
}
Set-Alias ?? Coalesce-Args -Force
function Test-LocalOrParentPath($path) {
$checkIn = Get-Item .
while ($checkIn -ne $NULL) {
$pathToTest = [System.IO.Path]::Combine($checkIn.fullname, $path)
if (Test-Path $pathToTest) {
return $true
} else {
$checkIn = $checkIn.parent
}
}
return $false
}