|
|
|
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent |
|
|
|
$exe="" |
|
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { |
|
|
|
|
|
$exe=".exe" |
|
} |
|
$ret=0 |
|
if (Test-Path "$basedir/node$exe") { |
|
|
|
if ($MyInvocation.ExpectingInput) { |
|
$input | & "$basedir/node$exe" "$basedir/../nugget/bin.js" $args |
|
} else { |
|
& "$basedir/node$exe" "$basedir/../nugget/bin.js" $args |
|
} |
|
$ret=$LASTEXITCODE |
|
} else { |
|
|
|
if ($MyInvocation.ExpectingInput) { |
|
$input | & "node$exe" "$basedir/../nugget/bin.js" $args |
|
} else { |
|
& "node$exe" "$basedir/../nugget/bin.js" $args |
|
} |
|
$ret=$LASTEXITCODE |
|
} |
|
exit $ret |
|
|