Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
39 lines (34 sloc) 1.006 kb
# General Utility Functions
function Invoke-NullCoalescing {
$result = $null
foreach($arg in $args) {
if ($arg -is [ScriptBlock]) {
$result = & $arg
} else {
$result = $arg
}
if ($result) { break }
}
$result
}
Set-Alias ?? Invoke-NullCoalescing -Force
function Get-LocalOrParentPath($path) {
$checkIn = Get-Item -Force .
if ($checkIn.PSProvider.Name -ne 'FileSystem') {
return $null
}
while ($checkIn -ne $NULL) {
$pathToTest = [System.IO.Path]::Combine($checkIn.fullname, $path)
if (Test-Path -LiteralPath $pathToTest) {
return $pathToTest
} else {
$checkIn = $checkIn.parent
}
}
return $null
}
function dbg ($Message, [Diagnostics.Stopwatch]$Stopwatch) {
if($Stopwatch) {
Write-Verbose ('{0:00000}:{1}' -f $Stopwatch.ElapsedMilliseconds,$Message) -Verbose # -ForegroundColor Yellow
}
}
Jump to Line
Something went wrong with that request. Please try again.