mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-08-19 08:52:05 +02:00
Improved check for $lastExitCode
This commit is contained in:
@@ -21,10 +21,10 @@ try {
|
||||
$StopWatch = [system.diagnostics.stopwatch]::startNew()
|
||||
|
||||
& wget --version
|
||||
if ($lastExitCode -ne "0") { throw "Can't execute 'wget' - make sure wget is installed and available" }
|
||||
if ($lastExitCode -ne 0) { throw "Can't execute 'wget' - make sure wget is installed and available" }
|
||||
|
||||
& wget --mirror --convert-links --adjust-extension --page-requisites --no-parent $URL --directory-prefix . --no-verbose
|
||||
if ($lastExitCode -ne "0") { throw "Can't execute 'wget --mirror $URL'" }
|
||||
if ($lastExitCode -ne 0) { throw "Can't execute 'wget --mirror $URL'" }
|
||||
|
||||
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
|
||||
"✅ downloaded directory from $URL in $Elapsed sec"
|
||||
|
Reference in New Issue
Block a user