Correct case of $LASTEXITCODE special variable

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

No files matched your search

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