Update the error line

This commit is contained in:
Markus Fleschutz 2021-09-16 20:19:10 +02:00
parent 0b65a7ecf7
commit bf8ddfbe0b
190 changed files with 198 additions and 204 deletions

View File

@ -54,6 +54,6 @@ try {
Start-Process powershell -Verb runAs -ArgumentList "-command & {$command} $arg" Start-Process powershell -Verb runAs -ArgumentList "-command & {$command} $arg"
exit 0 exit 0
} catch { } catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
exit 1 exit 1
} }

View File

@ -29,6 +29,6 @@ try {
"✔️ added to 📄$Path" "✔️ added to 📄$Path"
exit 0 exit 0
} catch { } catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
exit 1 exit 1
} }

View File

@ -22,6 +22,6 @@ try {
exit 0 exit 0
} catch { } catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
exit 1 exit 1
} }

View File

@ -36,6 +36,6 @@ try {
} }
exit 0 exit 0
} catch { } catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
exit 1 exit 1
} }

View File

@ -33,6 +33,6 @@ try {
"✔️ $Average domains/s ($Count domains resolved in $Elapsed sec)" "✔️ $Average domains/s ($Count domains resolved in $Elapsed sec)"
exit 0 exit 0
} catch { } catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
exit 1 exit 1
} }

View File

@ -28,6 +28,6 @@ try {
"✔️ $Free GB left on drive $Drive ($Used of $Total GB used)" "✔️ $Free GB left on drive $Drive ($Used of $Total GB used)"
exit 0 exit 0
} catch { } catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
exit 1 exit 1
} }

View File

@ -24,6 +24,6 @@ try {
"✔️ file system on drive $Drive is clean" "✔️ file system on drive $Drive is clean"
exit 0 exit 0
} catch { } catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
exit 1 exit 1
} }

View File

@ -33,6 +33,6 @@ try {
exit 1 exit 1
} }
} catch { } catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
exit 1 exit 1
} }

View File

@ -47,6 +47,6 @@ try {
exit 1 exit 1
} }
} catch { } catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
exit 1 exit 1
} }

View File

@ -34,6 +34,6 @@ try {
exit 1 exit 1
} }
} catch { } catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
exit 1 exit 1
} }

View File

@ -33,6 +33,6 @@ try {
"✔️ $Avg ms average ping latency ($Min ms min, $Max ms max)" "✔️ $Avg ms average ping latency ($Min ms min, $Max ms max)"
exit 0 exit 0
} catch { } catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
exit 1 exit 1
} }

View File

@ -33,6 +33,6 @@ try {
exit 1 exit 1
} }
} catch { } catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
exit 1 exit 1
} }

View File

@ -39,6 +39,6 @@ try {
"✔️ $Free GB left on swap space ($Used of $Total GB used)" "✔️ $Free GB left on swap space ($Used of $Total GB used)"
exit 0 exit 0
} catch { } catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
exit 1 exit 1
} }

View File

@ -35,6 +35,6 @@ try {
"✔️ $NumBroken out of $NumTotal symlinks are broken in 📂$DirTree" "✔️ $NumBroken out of $NumTotal symlinks are broken in 📂$DirTree"
exit $NumBroken exit $NumBroken
} catch { } catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
exit 1 exit 1
} }

View File

@ -52,6 +52,6 @@ try {
} }
exit 0 exit 0
} catch { } catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
exit 1 exit 1
} }

View File

@ -20,6 +20,6 @@ try {
"✔️ checked Windows system files" "✔️ checked Windows system files"
exit 0 exit 0
} catch { } catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
exit 1 exit 1
} }

View File

@ -37,6 +37,6 @@ try {
"✔️ XML file is valid" "✔️ XML file is valid"
exit 0 exit 0
} catch { } catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
exit 1 exit 1
} }

View File

@ -68,6 +68,6 @@ try {
"✔️ cherry picked $CommitID into $NumBranches branches in $Elapsed sec" "✔️ cherry picked $CommitID into $NumBranches branches in $Elapsed sec"
exit 0 exit 0
} catch { } catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
exit 1 exit 1
} }

View File

@ -34,6 +34,6 @@ try {
"✔️ cleaned Git repository 📂$RepoDirName in $Elapsed sec" "✔️ cleaned Git repository 📂$RepoDirName in $Elapsed sec"
exit 0 exit 0
} catch { } catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
exit 1 exit 1
} }

View File

@ -44,6 +44,6 @@ try {
"✔️ cleaned $FolderCount Git repositories at 📂$ParentDirName in $Elapsed sec" "✔️ cleaned $FolderCount Git repositories at 📂$ParentDirName in $Elapsed sec"
exit 0 exit 0
} catch { } catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
exit 1 exit 1
} }

View File

@ -19,6 +19,6 @@ try {
"✔️ cleared recycle bin" "✔️ cleared recycle bin"
exit 0 exit 0
} catch { } catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
exit 1 exit 1
} }

View File

@ -50,6 +50,6 @@ try {
"✔️ cloned $Count Git repositories at 📂$ParentDir in $Elapsed sec" "✔️ cloned $Count Git repositories at 📂$ParentDir in $Elapsed sec"
exit 0 exit 0
} catch { } catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
exit 1 exit 1
} }

View File

@ -44,6 +44,6 @@ try {
"✔️ closed $FullProgramName, stopped $($Processes.Count) process(es)" "✔️ closed $FullProgramName, stopped $($Processes.Count) process(es)"
exit 0 exit 0
} catch { } catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
exit 1 exit 1
} }

View File

@ -53,6 +53,6 @@ try {
if ($lastExitCode -ne "0") { throw "'git config --list' failed" } if ($lastExitCode -ne "0") { throw "'git config --list' failed" }
exit 0 exit 0
} catch { } catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
exit 1 exit 1
} }

View File

@ -23,6 +23,6 @@ try {
} }
exit 0 exit 0
} catch { } catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
exit 1 exit 1
} }

View File

@ -26,6 +26,6 @@ try {
$result | Export-Csv $csvfilepath -NoTypeInformation $result | Export-Csv $csvfilepath -NoTypeInformation
exit 0 exit 0
} catch { } catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
exit 1 exit 1
} }

View File

@ -40,6 +40,6 @@ try {
} }
exit 0 exit 0
} catch { } catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
exit 1 exit 1
} }

View File

@ -130,6 +130,6 @@ try {
"" ""
"*Generated by convert-ps2md.ps1 using the comment-based help of $ScriptName*" "*Generated by convert-ps2md.ps1 using the comment-based help of $ScriptName*"
} catch { } catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
exit 1 exit 1
} }

View File

@ -27,6 +27,6 @@ try {
$result | Export-Csv $csvfilepath -NoTypeInformation $result | Export-Csv $csvfilepath -NoTypeInformation
exit 0 exit 0
} catch { } catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
exit 1 exit 1
} }

View File

@ -24,6 +24,6 @@ try {
$SpeechSynthesizer.Dispose() $SpeechSynthesizer.Dispose()
exit 0 exit 0
} catch { } catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
exit 1 exit 1
} }

View File

@ -73,6 +73,6 @@ try {
"✔️ copied $Num photos to 📂$TargetDir sorted by year and month in $Elapsed sec" "✔️ copied $Num photos to 📂$TargetDir sorted by year and month in $Elapsed sec"
exit 0 exit 0
} catch { } catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
exit 1 exit 1
} }

View File

@ -166,6 +166,6 @@ try {
"✔️ Done." "✔️ Done."
exit 0 exit 0
} catch { } catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
exit 1 exit 1
} }

View File

@ -24,6 +24,6 @@ try {
} }
exit 0 exit 0
} catch { } catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
exit 1 exit 1
} }

View File

@ -28,6 +28,6 @@ try {
"✔️ downloaded directory from $URL in $Elapsed sec" "✔️ downloaded directory from $URL in $Elapsed sec"
exit 0 exit 0
} catch { } catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
exit 1 exit 1
} }

View File

@ -28,6 +28,6 @@ try {
"✔️ downloaded file from $URL in $Elapsed sec" "✔️ downloaded file from $URL in $Elapsed sec"
exit 0 exit 0
} catch { } catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
exit 1 exit 1
} }

View File

@ -24,6 +24,6 @@ try {
exit 0 exit 0
} catch { } catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
exit 1 exit 1
} }

View File

@ -22,6 +22,6 @@ try {
"✔️ enabled god mode - see the new desktop icon" "✔️ enabled god mode - see the new desktop icon"
exit 0 exit 0
} catch { } catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
exit 1 exit 1
} }

View File

@ -154,6 +154,6 @@ try {
"✔️ Done." "✔️ Done."
exit 0 exit 0
} catch { } catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
exit 1 exit 1
} }

View File

@ -28,6 +28,6 @@ try {
"✔️ fetched updates for 📂$RepoDirName" "✔️ fetched updates for 📂$RepoDirName"
exit 0 exit 0
} catch { } catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
exit 1 exit 1
} }

View File

@ -41,6 +41,6 @@ try {
"✔️ fetched $FolderCount Git repositories at 📂$ParentDirName in $Elapsed sec" "✔️ fetched $FolderCount Git repositories at 📂$ParentDirName in $Elapsed sec"
exit 0 exit 0
} catch { } catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
exit 1 exit 1
} }

View File

@ -21,6 +21,6 @@ try {
"✔️ MD5 hash is" $Result.Hash "✔️ MD5 hash is" $Result.Hash
exit 0 exit 0
} catch { } catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
exit 1 exit 1
} }

View File

@ -21,6 +21,6 @@ try {
"✔️ SHA1 hash is" $Result.Hash "✔️ SHA1 hash is" $Result.Hash
exit 0 exit 0
} catch { } catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
exit 1 exit 1
} }

View File

@ -21,6 +21,6 @@ try {
"✔️ SHA256 hash is:" $Result.Hash "✔️ SHA256 hash is:" $Result.Hash
exit 0 exit 0
} catch { } catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
exit 1 exit 1
} }

View File

@ -20,6 +20,6 @@ try {
"✔️ Done." "✔️ Done."
exit 0 exit 0
} catch { } catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
exit 1 exit 1
} }

View File

@ -19,6 +19,6 @@ try {
get-childitem $PathToExe | % {$_.VersionInfo} | Select * get-childitem $PathToExe | % {$_.VersionInfo} | Select *
exit 0 exit 0
} catch { } catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
exit 1 exit 1
} }

View File

@ -27,6 +27,6 @@ try {
"✔️ installed GitHub CLI in $Elapsed sec" "✔️ installed GitHub CLI in $Elapsed sec"
exit 0 exit 0
} catch { } catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
exit 1 exit 1
} }

View File

@ -24,6 +24,6 @@ try {
"✔️ installed Google Chrome in $Elapsed sec" "✔️ installed Google Chrome in $Elapsed sec"
exit 0 exit 0
} catch { } catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
exit 1 exit 1
} }

View File

@ -32,6 +32,6 @@ try {
"✔️ installed Knot Resolver in $Elapsed sec" "✔️ installed Knot Resolver in $Elapsed sec"
exit 0 exit 0
} catch { } catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
exit 1 exit 1
} }

View File

@ -39,6 +39,6 @@ try {
"✔️ installed signal-cli $Version to /opt and /usr/local/bin in $Elapsed sec" "✔️ installed signal-cli $Version to /opt and /usr/local/bin in $Elapsed sec"
exit 0 exit 0
} catch { } catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
exit 1 exit 1
} }

View File

@ -26,6 +26,6 @@ try {
"✔️ installed SSH client in $Elapsed sec" "✔️ installed SSH client in $Elapsed sec"
exit 0 exit 0
} catch { } catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
exit 1 exit 1
} }

View File

@ -40,6 +40,6 @@ try {
"✔️ installed and started SSH server in $Elapsed sec" "✔️ installed and started SSH server in $Elapsed sec"
exit 0 exit 0
} catch { } catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
exit 1 exit 1
} }

View File

@ -33,6 +33,6 @@ try {
" NOTE: reboot now, then visit the Microsoft Store and install a Linux distribution (e.g. Ubuntu, openSUSE, SUSE Linux, Kali Linux, Debian, Fedora, Pengwin, or Alpine)" " NOTE: reboot now, then visit the Microsoft Store and install a Linux distribution (e.g. Ubuntu, openSUSE, SUSE Linux, Kali Linux, Debian, Fedora, Pengwin, or Alpine)"
exit 0 exit 0
} catch { } catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
exit 1 exit 1
} }

View File

@ -30,6 +30,6 @@ try {
exit 0 exit 0
} catch { } catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
exit 1 exit 1
} }

View File

@ -15,6 +15,6 @@ try {
get-alias get-alias
exit 0 exit 0
} catch { } catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
exit 1 exit 1
} }

View File

@ -60,6 +60,6 @@ try {
GetPermutations -String $Word | Format-Wide -Column $Columns GetPermutations -String $Word | Format-Wide -Column $Columns
exit 0 exit 0
} catch { } catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
exit 1 exit 1
} }

View File

@ -71,6 +71,6 @@ try {
ListAutomaticVariables | format-table -property Variable,Content ListAutomaticVariables | format-table -property Variable,Content
exit 0 exit 0
} catch { } catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
exit 1 exit 1
} }

View File

@ -37,6 +37,6 @@ try {
"" ""
exit 0 exit 0
} catch { } catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
exit 1 exit 1
} }

View File

@ -20,6 +20,6 @@ try {
} }
exit 0 exit 0
} catch { } catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
exit 1 exit 1
} }

View File

@ -164,6 +164,6 @@ try {
ListTools | format-table -property @{e='Name';width=12},@{e='Version';width=15},@{e='Location';width=45},@{e='FileSize';width=10} ListTools | format-table -property @{e='Name';width=12},@{e='Version';width=15},@{e='Location';width=45},@{e='FileSize';width=10}
exit 0 exit 0
} catch { } catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
exit 1 exit 1
} }

View File

@ -15,6 +15,6 @@ try {
"📋 $(get-clipboard)" "📋 $(get-clipboard)"
exit 0 exit 0
} catch { } catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
exit 1 exit 1
} }

View File

@ -15,6 +15,6 @@ try {
Get-Command -Command-Type cmdlet Get-Command -Command-Type cmdlet
exit 0 exit 0
} catch { } catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
exit 1 exit 1
} }

View File

@ -45,6 +45,6 @@ try {
} }
exit 0 exit 0
} catch { } catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
exit 1 exit 1
} }

View File

@ -24,6 +24,6 @@ try {
} }
exit 0 exit 0
} catch { } catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
exit 1 exit 1
} }

View File

@ -28,6 +28,6 @@ try {
ListCountries | format-table -property Country,Capital,Population,TLD,Phone ListCountries | format-table -property Country,Capital,Population,TLD,Phone
exit 0 exit 0
} catch { } catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
exit 1 exit 1
} }

View File

@ -42,6 +42,6 @@ try {
& "$PSScriptRoot/write-big.ps1" " Thanx 4 watching" & "$PSScriptRoot/write-big.ps1" " Thanx 4 watching"
exit 0 exit 0
} catch { } catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
exit 1 exit 1
} }

View File

@ -47,6 +47,6 @@ try {
ListCryptoRates | format-table -property @{e='Cryptocurrency';width=28},USD,EUR,RUB,CNY ListCryptoRates | format-table -property @{e='Cryptocurrency';width=28},USD,EUR,RUB,CNY
exit 0 exit 0
} catch { } catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
exit 1 exit 1
} }

View File

@ -44,6 +44,6 @@ try {
write-host "($($global:Dirs) directories, $($global:Files) files, $($global:Bytes) bytes total)" write-host "($($global:Dirs) directories, $($global:Files) files, $($global:Bytes) bytes total)"
exit 0 exit 0
} catch { } catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
exit 1 exit 1
} }

View File

@ -31,6 +31,6 @@ try {
ListDir $Pattern | format-wide -autoSize ListDir $Pattern | format-wide -autoSize
exit 0 exit 0
} catch { } catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
exit 1 exit 1
} }

View File

@ -15,6 +15,6 @@ try {
Get-PSDrive -PSProvider FileSystem | format-table -property Name,Root,@{n="Used (GB)";e={[math]::Round($_.Used/1GB,2)}},@{n="Free (GB)";e={[math]::Round($_.Free/1GB,2)}} Get-PSDrive -PSProvider FileSystem | format-table -property Name,Root,@{n="Used (GB)";e={[math]::Round($_.Used/1GB,2)}},@{n="Free (GB)";e={[math]::Round($_.Free/1GB,2)}}
exit 0 exit 0
} catch { } catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
exit 1 exit 1
} }

View File

@ -27,6 +27,6 @@ try {
ListEarthquakes | format-table -property @{e='Mag';width=5},@{e='Location';width=42},@{e='Depth';width=6},Time ListEarthquakes | format-table -property @{e='Mag';width=5},@{e='Location';width=42},@{e='Depth';width=6},Time
exit 0 exit 0
} catch { } catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
exit 1 exit 1
} }

View File

@ -24,6 +24,6 @@ try {
"✔️ directory tree $DirTree has $Count empty directories" "✔️ directory tree $DirTree has $Count empty directories"
exit 0 exit 0
} catch { } catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
exit 1 exit 1
} }

View File

@ -26,6 +26,6 @@ try {
"✔️ found $Count empty file(s)" "✔️ found $Count empty file(s)"
exit 0 exit 0
} catch { } catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
exit 1 exit 1
} }

View File

@ -15,6 +15,6 @@ try {
Get-ChildItem env: Get-ChildItem env:
exit 0 exit 0
} catch { } catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
exit 1 exit 1
} }

View File

@ -28,6 +28,6 @@ try {
ListExchangeRates $currency | format-table -property Rate,Currency,Inverse,Date ListExchangeRates $currency | format-table -property Rate,Currency,Inverse,Date
exit 0 exit 0
} catch { } catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
exit 1 exit 1
} }

View File

@ -19,6 +19,6 @@ try {
Get-ChildItem -path $DirTree -recurse | select FullName Get-ChildItem -path $DirTree -recurse | select FullName
exit 0 exit 0
} catch { } catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
exit 1 exit 1
} }

View File

@ -25,6 +25,6 @@ try {
"✔️ directory tree $DirTree has $Count hidden file(s)" "✔️ directory tree $DirTree has $Count hidden file(s)"
exit 0 exit 0
} catch { } catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
exit 1 exit 1
} }

View File

@ -15,6 +15,6 @@ try {
get-appxPackage | select-object Name,Version | format-table -autoSize get-appxPackage | select-object Name,Version | format-table -autoSize
exit 0 exit 0
} catch { } catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
exit 1 exit 1
} }

View File

@ -16,6 +16,6 @@ try {
exit 0 exit 0
} catch { } catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
exit 1 exit 1
} }

View File

@ -30,6 +30,6 @@ try {
exit 0 exit 0
} catch { } catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
exit 1 exit 1
} }

View File

@ -36,6 +36,6 @@ try {
} }
exit 0 exit 0
} catch { } catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
exit 1 exit 1
} }

View File

@ -34,6 +34,6 @@ try {
} }
exit 0 exit 0
} catch { } catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
exit 1 exit 1
} }

View File

@ -15,6 +15,6 @@ try {
get-module | format-table get-module | format-table
exit 0 exit 0
} catch { } catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
exit 1 exit 1
} }

View File

@ -15,6 +15,6 @@ try {
get-wmiobject win32_share | where {$_.name -NotLike "*$"} get-wmiobject win32_share | where {$_.name -NotLike "*$"}
exit 0 exit 0
} catch { } catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
exit 1 exit 1
} }

View File

@ -25,6 +25,6 @@ try {
} }
exit 0 exit 0
} catch { } catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
exit 1 exit 1
} }

View File

@ -28,6 +28,6 @@ try {
} }
exit 0 exit 0
} catch { } catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
exit 1 exit 1
} }

View File

@ -26,6 +26,6 @@ try {
} }
exit 0 exit 0
} catch { } catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
exit 1 exit 1
} }

View File

@ -32,6 +32,6 @@ try {
write-output "" write-output ""
exit 0 exit 0
} catch { } catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
exit 1 exit 1
} }

View File

@ -29,6 +29,6 @@ try {
write-output "" write-output ""
exit 0 exit 0
} catch { } catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
exit 1 exit 1
} }

View File

@ -30,6 +30,6 @@ try {
} }
exit 0 exit 0
} catch { } catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
exit 1 exit 1
} }

View File

@ -16,6 +16,6 @@ try {
get-WMIObject -Class Win32_Printer -ComputerName $ComputerName | format-table get-WMIObject -Class Win32_Printer -ComputerName $ComputerName | format-table
exit 0 exit 0
} catch { } catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
exit 1 exit 1
} }

View File

@ -15,6 +15,6 @@ try {
Get-Process | Format-Table -Property Id, @{Label="CPU(s)";Expression={$_.CPU.ToString("N")+"%"};Alignment="Right"}, ProcessName -AutoSize Get-Process | Format-Table -Property Id, @{Label="CPU(s)";Expression={$_.CPU.ToString("N")+"%"};Alignment="Right"}, ProcessName -AutoSize
exit 0 exit 0
} catch { } catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
exit 1 exit 1
} }

View File

@ -33,6 +33,6 @@ try {
ListProfiles | format-table -property Level,Profile,Location,Existent ListProfiles | format-table -property Level,Profile,Location,Existent
exit 0 exit 0
} catch { } catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
exit 1 exit 1
} }

View File

@ -15,6 +15,6 @@ try {
(New-Object -ComObject Shell.Application).NameSpace(0x0a).Items() | Select-Object Name,Size,Path (New-Object -ComObject Shell.Application).NameSpace(0x0a).Items() | Select-Object Name,Size,Path
exit 0 exit 0
} catch { } catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
exit 1 exit 1
} }

View File

@ -31,6 +31,6 @@ try {
"✔️ $($global:NumScripts) PowerShell scripts total" "✔️ $($global:NumScripts) PowerShell scripts total"
exit 0 exit 0
} catch { } catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
exit 1 exit 1
} }

View File

@ -15,6 +15,6 @@ try {
Get-Service Get-Service
exit 0 exit 0
} catch { } catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
exit 1 exit 1
} }

View File

@ -28,6 +28,6 @@ try {
exit 0 exit 0
} catch { } catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
exit 1 exit 1
} }

View File

@ -31,6 +31,6 @@ try {
exit 0 exit 0
} catch { } catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
exit 1 exit 1
} }

View File

@ -15,6 +15,6 @@ try {
Get-ScheduledTask Get-ScheduledTask
exit 0 exit 0
} catch { } catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
exit 1 exit 1
} }

View File

@ -15,6 +15,6 @@ try {
get-timezone get-timezone
exit 0 exit 0
} catch { } catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
exit 1 exit 1
} }

View File

@ -15,6 +15,6 @@ try {
get-timezone -listavailable | format-table -property Id,DisplayName,SupportsDaylightSavingTime get-timezone -listavailable | format-table -property Id,DisplayName,SupportsDaylightSavingTime
exit 0 exit 0
} catch { } catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
exit 1 exit 1
} }

Some files were not shown because too many files have changed in this diff Show More