Correct case of $LASTEXITCODE special variable

This commit is contained in:
xtqqczze 2020-01-13 19:15:45 +00:00
parent 89e33f5772
commit 04b292ab3b
2 changed files with 2 additions and 2 deletions

View file

@ -56,7 +56,7 @@ function Invoke-CronTab ([String] $user, [String[]] $arguments, [Switch] $noThro
Write-Verbose "Running: $crontabcmd $arguments"
$output = & $crontabcmd @arguments 2>&1
if ($LastExitCode -ne 0 -and -not $noThrow) {
if ($LASTEXITCODE -ne 0 -and -not $noThrow) {
$e = New-Object System.InvalidOperationException -ArgumentList $output.Exception.Message
throw $e
} else {

View file

@ -225,7 +225,7 @@ Describe 'Positive Parse Properties Tests' -Tags "CI" {
[void] m()
{
$LASTEXITCODE
$lastexitcode
$LASTEXITCODE
'111' -Match '1'
$Matches
$Matches