mirror of
https://github.com/fleschutz/PowerShell.git
synced 2024-11-08 17:14:28 +01:00
Fix stop watch
This commit is contained in:
parent
26bdaf68f5
commit
f156c432e0
@ -78,7 +78,8 @@ try {
|
||||
exit 0
|
||||
}
|
||||
|
||||
"✔️ built Git repository 📂$RepoDir in $($StopWatch.Elapsed.Seconds) sec."
|
||||
[int]$Elapsed = $StopWatch.TotalSeconds
|
||||
"✔️ built Git repository 📂$RepoDir in $Elapsed sec."
|
||||
exit 0
|
||||
} catch {
|
||||
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
|
@ -20,7 +20,8 @@ try {
|
||||
$Count++
|
||||
}
|
||||
|
||||
write-host -foregroundColor green "✔️ $Count Git repositories built at $ParentDir in $($StopWatch.Elapsed.Seconds) second(s)"
|
||||
[int]$Elapsed = $StopWatch.TotalSeconds
|
||||
write-host -foregroundColor green "✔️ built $Count Git repositories at $ParentDir in $Elapsed sec."
|
||||
exit 0
|
||||
} catch {
|
||||
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
|
@ -7,8 +7,8 @@
|
||||
#>
|
||||
|
||||
try {
|
||||
write-progress "Reading Data/domain-names.csv..."
|
||||
$StopWatch = [system.diagnostics.stopwatch]::startNew()
|
||||
write-progress "Reading Data/domain-names.csv..."
|
||||
|
||||
$PathToRepo = "$PSScriptRoot/.."
|
||||
$Table = import-csv "$PathToRepo/Data/domain-names.csv"
|
||||
@ -23,9 +23,9 @@ try {
|
||||
}
|
||||
$Count = $Table.Length
|
||||
|
||||
$Elapsed = $StopWatch.Elapsed
|
||||
$Average = [math]::round($Count / $Elapsed.Seconds, 1)
|
||||
"✔️ $Average domains/s ($Count domains resolved in $($Elapsed.Seconds) seconds)"
|
||||
[int]$Elapsed = $StopWatch.TotalSeconds
|
||||
$Average = [math]::round($Count / $Elapsed, 1)
|
||||
"✔️ $Average domains/s ($Count domains resolved in $Elapsed sec.)"
|
||||
exit 0
|
||||
} catch {
|
||||
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
|
@ -31,7 +31,8 @@ try {
|
||||
if ($lastExitCode -ne "0") { throw "'git clone $URL' failed" }
|
||||
$Count++
|
||||
}
|
||||
"✔️ cloned $Count Git repositories at 📂$ParentDir in $($StopWatch.Elapsed.Seconds) sec."
|
||||
[int]$Elapsed = $StopWatch.TotalSeconds
|
||||
"✔️ cloned $Count Git repositories at 📂$ParentDir in $Elapsed sec."
|
||||
exit 0
|
||||
} catch {
|
||||
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
|
@ -28,7 +28,8 @@ try {
|
||||
$Count++
|
||||
}
|
||||
|
||||
"✔️ updated $Count Git repositories at 📂$ParentDir in $($StopWatch.Elapsed.Seconds) sec."
|
||||
[int]$Elapsed = $StopWatch.TotalSeconds
|
||||
"✔️ updated $Count Git repositories at 📂$ParentDir in $Elapsed sec."
|
||||
exit 0
|
||||
} catch {
|
||||
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
|
@ -30,7 +30,8 @@ try {
|
||||
$Count++
|
||||
}
|
||||
|
||||
"✔️ updated $Count Git repositories at 📂$ParentDir in $($StopWatch.Elapsed.Seconds) sec."
|
||||
[int]$Elapsed = $StopWatch.TotalSeconds
|
||||
"✔️ updated $Count Git repositories at 📂$ParentDir in $Elapsed sec."
|
||||
exit 0
|
||||
} catch {
|
||||
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
|
@ -46,7 +46,8 @@ try {
|
||||
$ftpStream.Dispose()
|
||||
$fileStream.Dispose()
|
||||
|
||||
write-host -foregroundColor green "✔️ uploaded $File to $URL in $($StopWatch.Elapsed.Seconds) second(s)"
|
||||
[int]$Elapsed = $StopWatch.TotalSeconds
|
||||
"✔️ uploaded $File to $URL in $Elapsed sec."
|
||||
exit 0
|
||||
} catch {
|
||||
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
|
Loading…
Reference in New Issue
Block a user