mirror of
https://github.com/fleschutz/PowerShell.git
synced 2024-12-25 16:18:55 +01:00
Add comment to exit 0
This commit is contained in:
parent
a5ae44db68
commit
4c2cc6033d
@ -1,4 +1,4 @@
|
||||
<#
|
||||
<#
|
||||
.SYNOPSIS
|
||||
add-firewall-rules.ps1 [<path-to-executables>]
|
||||
.DESCRIPTION
|
||||
@ -52,7 +52,7 @@ try {
|
||||
|
||||
$arg = "PathToExecutables $Apps"
|
||||
Start-Process powershell -Verb runAs -ArgumentList "-command & {$command} $arg"
|
||||
exit 0
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
|
||||
exit 1
|
||||
|
@ -1,4 +1,4 @@
|
||||
<#
|
||||
<#
|
||||
.SYNOPSIS
|
||||
add-memo.ps1 [<text>]
|
||||
.DESCRIPTION
|
||||
@ -27,7 +27,7 @@ try {
|
||||
write-output $Line >> "$Path"
|
||||
|
||||
"✔️ added to 📄$Path"
|
||||
exit 0
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
|
||||
exit 1
|
||||
|
@ -1,4 +1,4 @@
|
||||
<#
|
||||
<#
|
||||
.SYNOPSIS
|
||||
alert.ps1 [<message>]
|
||||
.DESCRIPTION
|
||||
@ -20,7 +20,7 @@ try {
|
||||
|
||||
curl --header "Access-Token: o.PZl5XCp6SBl4F5PpaNXGDfFpUJZKAlEb" --header "Content-Type: application/json" --data-binary '{"type": "note", "title": "ALERT", "body": "$Message"}' --request POST https://api.pushbullet.com/v2/pushes
|
||||
|
||||
exit 0
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
|
||||
exit 1
|
||||
|
@ -1,4 +1,4 @@
|
||||
<#
|
||||
<#
|
||||
.SYNOPSIS
|
||||
cd-desktop.ps1
|
||||
.DESCRIPTION
|
||||
@ -18,4 +18,4 @@ if (-not(test-path "$TargetDir" -pathType container)) {
|
||||
}
|
||||
set-location "$TargetDir"
|
||||
"📂$TargetDir"
|
||||
exit 0
|
||||
exit 0 # success
|
||||
|
@ -1,4 +1,4 @@
|
||||
<#
|
||||
<#
|
||||
.SYNOPSIS
|
||||
cd-docs.ps1
|
||||
.DESCRIPTION
|
||||
@ -18,4 +18,4 @@ if (-not(test-path "$TargetDir" -pathType container)) {
|
||||
}
|
||||
set-location "$TargetDir"
|
||||
"📂$TargetDir"
|
||||
exit 0
|
||||
exit 0 # success
|
||||
|
@ -1,4 +1,4 @@
|
||||
<#
|
||||
<#
|
||||
.SYNOPSIS
|
||||
cd-downloads.ps1
|
||||
.DESCRIPTION
|
||||
@ -18,4 +18,4 @@ if (-not(test-path "$TargetDir" -pathType container)) {
|
||||
}
|
||||
set-location "$TargetDir"
|
||||
"📂$TargetDir"
|
||||
exit 0
|
||||
exit 0 # success
|
||||
|
@ -1,4 +1,4 @@
|
||||
<#
|
||||
<#
|
||||
.SYNOPSIS
|
||||
cd-dropbox.ps1
|
||||
.DESCRIPTION
|
||||
@ -18,4 +18,4 @@ if (-not(test-path "$TargetDir" -pathType container)) {
|
||||
}
|
||||
set-location "$TargetDir"
|
||||
"📂$TargetDir"
|
||||
exit 0
|
||||
exit 0 # success
|
||||
|
@ -1,4 +1,4 @@
|
||||
<#
|
||||
<#
|
||||
.SYNOPSIS
|
||||
cd-home.ps1
|
||||
.DESCRIPTION
|
||||
@ -18,4 +18,4 @@ if (-not(test-path "$TargetDir" -pathType container)) {
|
||||
}
|
||||
set-location "$TargetDir"
|
||||
"📂$TargetDir"
|
||||
exit 0
|
||||
exit 0 # success
|
||||
|
@ -1,4 +1,4 @@
|
||||
<#
|
||||
<#
|
||||
.SYNOPSIS
|
||||
cd-music.ps1
|
||||
.DESCRIPTION
|
||||
@ -18,4 +18,4 @@ if (-not(test-path "$TargetDir" -pathType container)) {
|
||||
}
|
||||
set-location "$TargetDir"
|
||||
"📂$TargetDir"
|
||||
exit 0
|
||||
exit 0 # success
|
||||
|
@ -1,4 +1,4 @@
|
||||
<#
|
||||
<#
|
||||
.SYNOPSIS
|
||||
cd-onedrive.ps1
|
||||
.DESCRIPTION
|
||||
@ -18,4 +18,4 @@ if (-not(test-path "$TargetDir" -pathType container)) {
|
||||
}
|
||||
set-location "$TargetDir"
|
||||
"📂$TargetDir"
|
||||
exit 0
|
||||
exit 0 # success
|
||||
|
@ -1,4 +1,4 @@
|
||||
<#
|
||||
<#
|
||||
.SYNOPSIS
|
||||
cd-pics.ps1
|
||||
.DESCRIPTION
|
||||
@ -18,4 +18,4 @@ if (-not(test-path "$TargetDir" -pathType container)) {
|
||||
}
|
||||
set-location "$TargetDir"
|
||||
"📂$TargetDir"
|
||||
exit 0
|
||||
exit 0 # success
|
||||
|
@ -1,4 +1,4 @@
|
||||
<#
|
||||
<#
|
||||
.SYNOPSIS
|
||||
cd-recycle-bin.ps1
|
||||
.DESCRIPTION
|
||||
@ -24,4 +24,4 @@ if (-not(test-path "$TargetDir" -pathType container)) {
|
||||
}
|
||||
set-location "$TargetDir"
|
||||
"📂$TargetDir"
|
||||
exit 0
|
||||
exit 0 # success
|
||||
|
@ -1,4 +1,4 @@
|
||||
<#
|
||||
<#
|
||||
.SYNOPSIS
|
||||
cd-repos.ps1
|
||||
.DESCRIPTION
|
||||
@ -18,4 +18,4 @@ if (-not(test-path "$TargetDir" -pathType container)) {
|
||||
}
|
||||
set-location "$TargetDir"
|
||||
"📂$TargetDir"
|
||||
exit 0
|
||||
exit 0 # success
|
||||
|
@ -1,4 +1,4 @@
|
||||
<#
|
||||
<#
|
||||
.SYNOPSIS
|
||||
cd-root.ps1
|
||||
.DESCRIPTION
|
||||
@ -22,4 +22,4 @@ if (-not(test-path "$TargetDir" -pathType container)) {
|
||||
}
|
||||
set-location "$TargetDir"
|
||||
"📂$TargetDir"
|
||||
exit 0
|
||||
exit 0 # success
|
||||
|
@ -1,4 +1,4 @@
|
||||
<#
|
||||
<#
|
||||
.SYNOPSIS
|
||||
cd-scripts.ps1
|
||||
.DESCRIPTION
|
||||
@ -18,4 +18,4 @@ if (-not(test-path "$TargetDir" -pathType container)) {
|
||||
}
|
||||
set-location "$TargetDir"
|
||||
"📂$TargetDir"
|
||||
exit 0
|
||||
exit 0 # success
|
||||
|
@ -1,4 +1,4 @@
|
||||
<#
|
||||
<#
|
||||
.SYNOPSIS
|
||||
cd-ssh.ps1
|
||||
.DESCRIPTION
|
||||
@ -18,4 +18,4 @@ if (-not(test-path "$TargetDir" -pathType container)) {
|
||||
}
|
||||
set-location "$TargetDir"
|
||||
"📂$TargetDir"
|
||||
exit 0
|
||||
exit 0 # success
|
||||
|
@ -1,4 +1,4 @@
|
||||
<#
|
||||
<#
|
||||
.SYNOPSIS
|
||||
cd-up.ps1
|
||||
.DESCRIPTION
|
||||
@ -18,4 +18,4 @@ if (-not(test-path "$TargetDir" -pathType container)) {
|
||||
}
|
||||
set-location "$TargetDir"
|
||||
"📂$TargetDir"
|
||||
exit 0
|
||||
exit 0 # success
|
||||
|
@ -1,4 +1,4 @@
|
||||
<#
|
||||
<#
|
||||
.SYNOPSIS
|
||||
cd-up2.ps1
|
||||
.DESCRIPTION
|
||||
@ -18,4 +18,4 @@ if (-not(test-path "$TargetDir" -pathType container)) {
|
||||
}
|
||||
set-location "$TargetDir"
|
||||
"📂$TargetDir"
|
||||
exit 0
|
||||
exit 0 # success
|
||||
|
@ -1,4 +1,4 @@
|
||||
<#
|
||||
<#
|
||||
.SYNOPSIS
|
||||
cd-up3.ps1
|
||||
.DESCRIPTION
|
||||
@ -18,4 +18,4 @@ if (-not(test-path "$TargetDir" -pathType container)) {
|
||||
}
|
||||
set-location "$TargetDir"
|
||||
"📂$TargetDir"
|
||||
exit 0
|
||||
exit 0 # success
|
||||
|
@ -1,4 +1,4 @@
|
||||
<#
|
||||
<#
|
||||
.SYNOPSIS
|
||||
cd-up4.ps1
|
||||
.DESCRIPTION
|
||||
@ -18,4 +18,4 @@ if (-not(test-path "$TargetDir" -pathType container)) {
|
||||
}
|
||||
set-location "$TargetDir"
|
||||
"📂$TargetDir"
|
||||
exit 0
|
||||
exit 0 # success
|
||||
|
@ -1,4 +1,4 @@
|
||||
<#
|
||||
<#
|
||||
.SYNOPSIS
|
||||
cd-videos.ps1
|
||||
.DESCRIPTION
|
||||
@ -18,4 +18,4 @@ if (-not(test-path "$TargetDir" -pathType container)) {
|
||||
}
|
||||
set-location "$TargetDir"
|
||||
"📂$TargetDir"
|
||||
exit 0
|
||||
exit 0 # success
|
||||
|
@ -1,4 +1,4 @@
|
||||
<#
|
||||
<#
|
||||
.SYNOPSIS
|
||||
check-cpu-temp.ps1
|
||||
.DESCRIPTION
|
||||
@ -34,7 +34,7 @@ try {
|
||||
} else {
|
||||
"✔️ $Temp °C CPU temperature - good"
|
||||
}
|
||||
exit 0
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
|
||||
exit 1
|
||||
|
@ -1,4 +1,4 @@
|
||||
<#
|
||||
<#
|
||||
.SYNOPSIS
|
||||
check-dns-resolution.ps1
|
||||
.DESCRIPTION
|
||||
@ -31,7 +31,7 @@ try {
|
||||
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
|
||||
$Average = [math]::round($Count / $Elapsed, 1)
|
||||
"✔️ $Average domains/s ($Count domains resolved in $Elapsed sec)"
|
||||
exit 0
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
|
||||
exit 1
|
||||
|
@ -1,4 +1,4 @@
|
||||
<#
|
||||
<#
|
||||
.SYNOPSIS
|
||||
check-drive-space.ps1 [<drive>] [<min-level>]
|
||||
.DESCRIPTION
|
||||
@ -26,7 +26,7 @@ try {
|
||||
exit 1
|
||||
}
|
||||
"✔️ $Free GB left on drive $Drive ($Used of $Total GB used)"
|
||||
exit 0
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
|
||||
exit 1
|
||||
|
@ -1,4 +1,4 @@
|
||||
<#
|
||||
<#
|
||||
.SYNOPSIS
|
||||
check-file-system.ps1 [<drive>]
|
||||
.DESCRIPTION
|
||||
@ -22,7 +22,7 @@ try {
|
||||
if ($Result -ne "NoErrorsFound") { throw "'repair-volume' failed" }
|
||||
|
||||
"✔️ file system on drive $Drive is clean"
|
||||
exit 0
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
|
||||
exit 1
|
||||
|
@ -1,4 +1,4 @@
|
||||
<#
|
||||
<#
|
||||
.SYNOPSIS
|
||||
check-health.ps1
|
||||
.DESCRIPTION
|
||||
@ -38,7 +38,7 @@ if ($lastExitCode -ne "0") { $Healthy = 0 }
|
||||
|
||||
if ($Healthy) {
|
||||
"✔️ $Hostname is healthy"
|
||||
exit 0
|
||||
exit 0 # success
|
||||
} else {
|
||||
write-warning "$Hostname is NOT healthy"
|
||||
exit 1
|
||||
|
@ -1,4 +1,4 @@
|
||||
<#
|
||||
<#
|
||||
.SYNOPSIS
|
||||
check-ipv4-address.ps1 [<address>]
|
||||
.DESCRIPTION
|
||||
@ -27,7 +27,7 @@ try {
|
||||
|
||||
if (IsIPv4AddressValid $Address) {
|
||||
"✔️ IPv4 address $Address is valid"
|
||||
exit 0
|
||||
exit 0 # success
|
||||
} else {
|
||||
write-warning "Invalid IPv4 address: $Address"
|
||||
exit 1
|
||||
|
@ -1,4 +1,4 @@
|
||||
<#
|
||||
<#
|
||||
.SYNOPSIS
|
||||
check-ipv6-address.ps1 [<address>]
|
||||
.DESCRIPTION
|
||||
@ -41,7 +41,7 @@ try {
|
||||
}
|
||||
if (IsIPv6AddressValid $Address) {
|
||||
"✔️ IPv6 address $Address is valid"
|
||||
exit 0
|
||||
exit 0 # success
|
||||
} else {
|
||||
write-warning "Invalid IPv6 address: $Address"
|
||||
exit 1
|
||||
|
@ -1,4 +1,4 @@
|
||||
<#
|
||||
<#
|
||||
.SYNOPSIS
|
||||
check-mac-address.ps1 [<MAC>]
|
||||
.DESCRIPTION
|
||||
@ -28,7 +28,7 @@ try {
|
||||
}
|
||||
if (IsMACAddressValid $MAC) {
|
||||
"✔️ MAC address $MAC is valid"
|
||||
exit 0
|
||||
exit 0 # success
|
||||
} else {
|
||||
write-warning "Invalid MAC address: $MAC"
|
||||
exit 1
|
||||
|
@ -1,4 +1,4 @@
|
||||
<#
|
||||
<#
|
||||
.SYNOPSIS
|
||||
check-ping.ps1 [<hosts>]
|
||||
.DESCRIPTION
|
||||
@ -35,7 +35,7 @@ try {
|
||||
$Avg = $Avg / $Pings.count
|
||||
|
||||
"✔️ $Avg ms net latency average ($Min ms min, $Max ms max, $($Pings.count) hosts)"
|
||||
exit 0
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
|
||||
exit 1
|
||||
|
@ -1,4 +1,4 @@
|
||||
<#
|
||||
<#
|
||||
.SYNOPSIS
|
||||
check-subnet-mask.ps1 [<address>]
|
||||
.DESCRIPTION
|
||||
@ -27,7 +27,7 @@ try {
|
||||
|
||||
if (IsSubNetMaskValid $address) {
|
||||
"✔️ subnet mask $Address is valid"
|
||||
exit 0
|
||||
exit 0 # success
|
||||
} else {
|
||||
write-warning "Invalid subnet mask: $address"
|
||||
exit 1
|
||||
|
@ -1,4 +1,4 @@
|
||||
<#
|
||||
<#
|
||||
.SYNOPSIS
|
||||
check-swap-space.ps1 [<min-level>]
|
||||
.DESCRIPTION
|
||||
@ -37,7 +37,7 @@ try {
|
||||
exit 1
|
||||
}
|
||||
"✔️ $Free GB left on swap space ($Used of $Total GB used)"
|
||||
exit 0
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
|
||||
exit 1
|
||||
|
@ -1,4 +1,4 @@
|
||||
<#
|
||||
<#
|
||||
.SYNOPSIS
|
||||
check-symlinks.ps1 [<DirTree>]
|
||||
.DESCRIPTION
|
||||
|
@ -1,4 +1,4 @@
|
||||
<#
|
||||
<#
|
||||
.SYNOPSIS
|
||||
check-weather.ps1 [<location>]
|
||||
.DESCRIPTION
|
||||
@ -50,7 +50,7 @@ try {
|
||||
} else {
|
||||
"WEATHER ALERT: $Result"
|
||||
}
|
||||
exit 0
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
|
||||
exit 1
|
||||
|
@ -1,4 +1,4 @@
|
||||
<#
|
||||
<#
|
||||
.SYNOPSIS
|
||||
check-windows-system-files.ps1
|
||||
.DESCRIPTION
|
||||
@ -18,7 +18,7 @@ try {
|
||||
if ($lastExitCode -ne "0") { throw "'sfc /verifyOnly' failed" }
|
||||
|
||||
"✔️ checked Windows system files"
|
||||
exit 0
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
|
||||
exit 1
|
||||
|
@ -1,4 +1,4 @@
|
||||
<#
|
||||
<#
|
||||
.SYNOPSIS
|
||||
check-xml-file [<file>]
|
||||
.DESCRIPTION
|
||||
@ -35,7 +35,7 @@ try {
|
||||
}
|
||||
|
||||
"✔️ XML file is valid"
|
||||
exit 0
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
|
||||
exit 1
|
||||
|
@ -1,4 +1,4 @@
|
||||
<#
|
||||
<#
|
||||
.SYNOPSIS
|
||||
cherry-picker.ps1 [<CommitID>] [<CommitMessage>] [<Branches>] [<RepoDir>]
|
||||
.DESCRIPTION
|
||||
@ -66,7 +66,7 @@ try {
|
||||
}
|
||||
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
|
||||
"✔️ cherry picked $CommitID into $NumBranches branches in $Elapsed sec"
|
||||
exit 0
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
|
||||
exit 1
|
||||
|
@ -1,4 +1,4 @@
|
||||
<#
|
||||
<#
|
||||
.SYNOPSIS
|
||||
clean-repo.ps1 [<RepoDir>]
|
||||
.DESCRIPTION
|
||||
@ -32,7 +32,7 @@ try {
|
||||
|
||||
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
|
||||
"✔️ cleaned Git repository 📂$RepoDirName in $Elapsed sec"
|
||||
exit 0
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
|
||||
exit 1
|
||||
|
@ -1,4 +1,4 @@
|
||||
<#
|
||||
<#
|
||||
.SYNOPSIS
|
||||
clean-repos.ps1 [<ParentDir>]
|
||||
.DESCRIPTION
|
||||
@ -42,7 +42,7 @@ try {
|
||||
|
||||
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
|
||||
"✔️ cleaned $FolderCount Git repositories at 📂$ParentDirName in $Elapsed sec"
|
||||
exit 0
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
|
||||
exit 1
|
||||
|
@ -1,4 +1,4 @@
|
||||
<#
|
||||
<#
|
||||
.SYNOPSIS
|
||||
clear-recycle-bin.ps1
|
||||
.DESCRIPTION
|
||||
@ -17,7 +17,7 @@ try {
|
||||
if ($lastExitCode -ne "0") { throw "'Clear-RecycleBin' failed" }
|
||||
|
||||
"✔️ cleared recycle bin"
|
||||
exit 0
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
|
||||
exit 1
|
||||
|
@ -1,4 +1,4 @@
|
||||
<#
|
||||
<#
|
||||
.SYNOPSIS
|
||||
clone-repos.ps1 [<ParentDir>]
|
||||
.DESCRIPTION
|
||||
@ -48,7 +48,7 @@ try {
|
||||
}
|
||||
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
|
||||
"✔️ cloned $Count Git repositories at 📂$ParentDir in $Elapsed sec"
|
||||
exit 0
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
|
||||
exit 1
|
||||
|
@ -1,4 +1,4 @@
|
||||
<#
|
||||
<#
|
||||
.SYNOPSIS
|
||||
close-calculator.ps1
|
||||
.DESCRIPTION
|
||||
@ -12,4 +12,4 @@
|
||||
#>
|
||||
|
||||
& "$PSScriptRoot/close-program.ps1" "Calculator" "Calculator" "calc"
|
||||
exit 0
|
||||
exit 0 # success
|
||||
|
@ -1,4 +1,4 @@
|
||||
<#
|
||||
<#
|
||||
.SYNOPSIS
|
||||
close-chrome.ps1
|
||||
.DESCRIPTION
|
||||
@ -12,4 +12,4 @@
|
||||
#>
|
||||
|
||||
& "$PSScriptRoot/close-program.ps1" "Google Chrome" "chrome" "chrome"
|
||||
exit 0
|
||||
exit 0 # success
|
||||
|
@ -1,4 +1,4 @@
|
||||
<#
|
||||
<#
|
||||
.SYNOPSIS
|
||||
close-cortana.ps1
|
||||
.DESCRIPTION
|
||||
@ -12,4 +12,4 @@
|
||||
#>
|
||||
|
||||
& "$PSScriptRoot/close-program.ps1" "Cortana" "Cortana" "Cortana"
|
||||
exit 0
|
||||
exit 0 # success
|
||||
|
@ -1,4 +1,4 @@
|
||||
<#
|
||||
<#
|
||||
.SYNOPSIS
|
||||
close-edge.ps1
|
||||
.DESCRIPTION
|
||||
@ -12,4 +12,4 @@
|
||||
#>
|
||||
|
||||
& "$PSScriptRoot/close-program.ps1" "Microsoft Edge" "msedge" "msedge"
|
||||
exit 0
|
||||
exit 0 # success
|
||||
|
@ -1,4 +1,4 @@
|
||||
<#
|
||||
<#
|
||||
.SYNOPSIS
|
||||
close-file-explorer.ps1
|
||||
.DESCRIPTION
|
||||
@ -12,4 +12,4 @@
|
||||
#>
|
||||
|
||||
& "$PSScriptRoot/close-program.ps1" "File Explorer" "explorer" "explorer"
|
||||
exit 0
|
||||
exit 0 # success
|
||||
|
@ -1,4 +1,4 @@
|
||||
<#
|
||||
<#
|
||||
.SYNOPSIS
|
||||
close-firefox.ps1
|
||||
.DESCRIPTION
|
||||
@ -12,4 +12,4 @@
|
||||
#>
|
||||
|
||||
& "$PSScriptRoot/close-program.ps1" "Mozilla Firefox" "firefox" "firefox"
|
||||
exit 0
|
||||
exit 0 # success
|
||||
|
@ -1,4 +1,4 @@
|
||||
<#
|
||||
<#
|
||||
.SYNOPSIS
|
||||
close-netflix.ps1
|
||||
.DESCRIPTION
|
||||
@ -12,4 +12,4 @@
|
||||
#>
|
||||
|
||||
& "$PSScriptRoot/close-program.ps1" "Netflix" "ApplicationFrameHost" "RuntimeBroker"
|
||||
exit 0
|
||||
exit 0 # success
|
||||
|
@ -1,4 +1,4 @@
|
||||
<#
|
||||
<#
|
||||
.SYNOPSIS
|
||||
close-onedrive.ps1
|
||||
.DESCRIPTION
|
||||
@ -12,4 +12,4 @@
|
||||
#>
|
||||
|
||||
& "$PSScriptRoot/close-program.ps1" "Microsoft OneDrive" "onedrive" "onedrive.exe"
|
||||
exit 0
|
||||
exit 0 # success
|
||||
|
@ -1,4 +1,4 @@
|
||||
<#
|
||||
<#
|
||||
.SYNOPSIS
|
||||
close-program.ps1 [<FullProgramName>] [<ProgramName>] [<ProgramAliasName>]
|
||||
.DESCRIPTION
|
||||
@ -42,7 +42,7 @@ try {
|
||||
stop-process -name $ProgramName -force -errorAction 'silentlycontinue'
|
||||
}
|
||||
"✔️ closed $FullProgramName, stopped $($Processes.Count) process(es)"
|
||||
exit 0
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
|
||||
exit 1
|
||||
|
@ -1,4 +1,4 @@
|
||||
<#
|
||||
<#
|
||||
.SYNOPSIS
|
||||
close-system-settings.ps1
|
||||
.DESCRIPTION
|
||||
@ -12,4 +12,4 @@
|
||||
#>
|
||||
|
||||
& "$PSScriptRoot/close-program.ps1" "System Settings" "SystemSettings" "SystemSettings"
|
||||
exit 0
|
||||
exit 0 # success
|
||||
|
@ -1,4 +1,4 @@
|
||||
<#
|
||||
<#
|
||||
.SYNOPSIS
|
||||
close-thunderbird.ps1
|
||||
.DESCRIPTION
|
||||
@ -12,4 +12,4 @@
|
||||
#>
|
||||
|
||||
& "$PSScriptRoot/close-program.ps1" "Mozilla Thunderbird" "thunderbird" "thunderbird"
|
||||
exit 0
|
||||
exit 0 # success
|
||||
|
@ -1,4 +1,4 @@
|
||||
<#
|
||||
<#
|
||||
.SYNOPSIS
|
||||
close-vlc.ps1
|
||||
.DESCRIPTION
|
||||
@ -12,4 +12,4 @@
|
||||
#>
|
||||
|
||||
& "$PSScriptRoot/close-program.ps1" "VLC media player" "vlc" "vlc"
|
||||
exit 0
|
||||
exit 0 # success
|
||||
|
@ -1,4 +1,4 @@
|
||||
<#
|
||||
<#
|
||||
.SYNOPSIS
|
||||
close-windows-terminal.ps1
|
||||
.DESCRIPTION
|
||||
@ -12,4 +12,4 @@
|
||||
#>
|
||||
|
||||
& "$PSScriptRoot/close-program.ps1" "Windows Terminal" "WindowsTerminal" "WindowsTerminal"
|
||||
exit 0
|
||||
exit 0 # success
|
||||
|
@ -1,4 +1,4 @@
|
||||
<#
|
||||
<#
|
||||
.SYNOPSIS
|
||||
configure-git.ps1 [<full-name>] [<email-address>] [<favorite-editor>]
|
||||
.DESCRIPTION
|
||||
@ -51,7 +51,7 @@ try {
|
||||
"✔️ saved your Git configuration, it's now:"
|
||||
& git config --list
|
||||
if ($lastExitCode -ne "0") { throw "'git config --list' failed" }
|
||||
exit 0
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
|
||||
exit 1
|
||||
|
@ -1,4 +1,4 @@
|
||||
<#
|
||||
<#
|
||||
.SYNOPSIS
|
||||
convert-csv2txt.ps1 [<csv-file>]
|
||||
.DESCRIPTION
|
||||
@ -21,7 +21,7 @@ try {
|
||||
foreach($Row in $Table) {
|
||||
write-output "* $($Row.A) $($Row.B) $($Row.C) $($Row.D) $($Row.E) $($Row.F) $($Row.G) $($Row.H)"
|
||||
}
|
||||
exit 0
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
|
||||
exit 1
|
||||
|
@ -1,4 +1,4 @@
|
||||
<#
|
||||
<#
|
||||
.SYNOPSIS
|
||||
convert-mysql2csv.ps1 [<server>] [<database>] [<username>] [<password>] [<query>]
|
||||
.DESCRIPTION
|
||||
@ -24,7 +24,7 @@ try {
|
||||
$csvfilepath = "$PSScriptRoot\mysql_table.csv"
|
||||
$result = Invoke-MySqlQuery -ConnectionString "server=$server; database=$database; user=$username; password=$password; pooling = false; convert zero datetime=True" -Sql $query -CommandTimeout 10000
|
||||
$result | Export-Csv $csvfilepath -NoTypeInformation
|
||||
exit 0
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
|
||||
exit 1
|
||||
|
@ -1,4 +1,4 @@
|
||||
<#
|
||||
<#
|
||||
.SYNOPSIS
|
||||
convert-ps2bat.ps1 [<pattern>]
|
||||
.DESCRIPTION
|
||||
@ -38,7 +38,7 @@ try {
|
||||
foreach ($File in $Files) {
|
||||
Convert-PowerShellToBatch "$File"
|
||||
}
|
||||
exit 0
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
|
||||
exit 1
|
||||
|
@ -1,4 +1,4 @@
|
||||
<#
|
||||
<#
|
||||
.SYNOPSIS
|
||||
convert-sql2csv.ps1 [<server>] [<database>] [<username>] [<password>] [<query>]
|
||||
.DESCRIPTION
|
||||
@ -25,7 +25,7 @@ try {
|
||||
$csvfilepath = "$PSScriptRoot\sqlserver_table.csv"
|
||||
$result = Invoke-SqlServerQuery -Credential $creds -ConnectionTimeout 10000 -Database $database -Server $server -Sql $query -CommandTimeout 10000
|
||||
$result | Export-Csv $csvfilepath -NoTypeInformation
|
||||
exit 0
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
|
||||
exit 1
|
||||
|
@ -1,4 +1,4 @@
|
||||
<#
|
||||
<#
|
||||
.SYNOPSIS
|
||||
convert-txt2wav.ps1 [<text>] [<wav-file>]
|
||||
.DESCRIPTION
|
||||
@ -22,7 +22,7 @@ try {
|
||||
$SpeechSynthesizer.SetOutputToWaveFile($tWavFile)
|
||||
$SpeechSynthesizer.Speak($Text)
|
||||
$SpeechSynthesizer.Dispose()
|
||||
exit 0
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
|
||||
exit 1
|
||||
|
@ -1,4 +1,4 @@
|
||||
<#
|
||||
<#
|
||||
.SYNOPSIS
|
||||
copy-photos-sorted.ps1 [<SourceDir>] [<TargetDir>]
|
||||
.DESCRIPTION
|
||||
@ -71,7 +71,7 @@ try {
|
||||
|
||||
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
|
||||
"✔️ copied $Num photos to 📂$TargetDir sorted by year and month in $Elapsed sec"
|
||||
exit 0
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
|
||||
exit 1
|
||||
|
@ -1,4 +1,4 @@
|
||||
<#
|
||||
<#
|
||||
.SYNOPSIS
|
||||
decrypt-file.ps1 [<path>] [<password>]
|
||||
.DESCRIPTION
|
||||
@ -164,7 +164,7 @@ try {
|
||||
DecryptFile "$Path" -algorithm AES -keyAsPlainText $PasswordBase64 -removeSource
|
||||
|
||||
"✔️ Done."
|
||||
exit 0
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
|
||||
exit 1
|
||||
|
@ -1,4 +1,4 @@
|
||||
<#
|
||||
<#
|
||||
.SYNOPSIS
|
||||
display-time.ps1 [<seconds>]
|
||||
.DESCRIPTION
|
||||
@ -22,7 +22,7 @@ try {
|
||||
write-output ""
|
||||
start-sleep -s 1
|
||||
}
|
||||
exit 0
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
|
||||
exit 1
|
||||
|
@ -1,4 +1,4 @@
|
||||
<#
|
||||
<#
|
||||
.SYNOPSIS
|
||||
download-dir.ps1 [<URL>]
|
||||
.DESCRIPTION
|
||||
@ -26,7 +26,7 @@ try {
|
||||
|
||||
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
|
||||
"✔️ downloaded directory from $URL in $Elapsed sec"
|
||||
exit 0
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
|
||||
exit 1
|
||||
|
@ -1,4 +1,4 @@
|
||||
<#
|
||||
<#
|
||||
.SYNOPSIS
|
||||
download-file.ps1 [<URL>]
|
||||
.DESCRIPTION
|
||||
@ -26,7 +26,7 @@ try {
|
||||
|
||||
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
|
||||
"✔️ downloaded file from $URL in $Elapsed sec"
|
||||
exit 0
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
|
||||
exit 1
|
||||
|
@ -1,4 +1,4 @@
|
||||
<#
|
||||
<#
|
||||
.SYNOPSIS
|
||||
edit.ps1 <filename>
|
||||
.DESCRIPTION
|
||||
@ -22,7 +22,7 @@ try {
|
||||
if ($lastExitCode -ne "0") { throw "Can't execute 'notepad.exe' - make sure notepad.exe is installed and available" }
|
||||
}
|
||||
|
||||
exit 0
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
|
||||
exit 1
|
||||
|
@ -1,4 +1,4 @@
|
||||
<#
|
||||
<#
|
||||
.SYNOPSIS
|
||||
enable-crash-dumps.ps1
|
||||
.DESCRIPTION
|
||||
@ -294,4 +294,4 @@ Else
|
||||
write-host "You did not enter a valid option. Please re-run Get-Dump.ps1"
|
||||
start-sleep -s 5
|
||||
}
|
||||
exit 0
|
||||
exit 0 # success
|
||||
|
@ -1,4 +1,4 @@
|
||||
<#
|
||||
<#
|
||||
.SYNOPSIS
|
||||
enable-god-mode.ps1
|
||||
.DESCRIPTION
|
||||
@ -20,7 +20,7 @@ try {
|
||||
$null = new-item @GodModeSplat
|
||||
|
||||
"✔️ enabled god mode - see the new desktop icon"
|
||||
exit 0
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
|
||||
exit 1
|
||||
|
@ -1,4 +1,4 @@
|
||||
<#
|
||||
<#
|
||||
.SYNOPSIS
|
||||
encrypt-file.ps1 [<path>] [<password>]
|
||||
.DESCRIPTION
|
||||
@ -152,7 +152,7 @@ try {
|
||||
EnryptFile "$Path" -Algorithm AES -KeyAsPlainText $PasswordBase64 -RemoveSource
|
||||
|
||||
"✔️ Done."
|
||||
exit 0
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
|
||||
exit 1
|
||||
|
@ -1,4 +1,4 @@
|
||||
<#
|
||||
<#
|
||||
.SYNOPSIS
|
||||
enter-chat.ps1
|
||||
.DESCRIPTION
|
||||
|
@ -1,4 +1,4 @@
|
||||
<#
|
||||
<#
|
||||
.SYNOPSIS
|
||||
fetch-repo.ps1 [<repo-dir>]
|
||||
.DESCRIPTION
|
||||
@ -26,7 +26,7 @@ try {
|
||||
if ($lastExitCode -ne "0") { throw "'git fetch' failed" }
|
||||
|
||||
"✔️ fetched updates for 📂$RepoDirName"
|
||||
exit 0
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
|
||||
exit 1
|
||||
|
@ -1,4 +1,4 @@
|
||||
<#
|
||||
<#
|
||||
.SYNOPSIS
|
||||
fetch-repos.ps1 [<ParentDir>]
|
||||
.DESCRIPTION
|
||||
@ -39,7 +39,7 @@ try {
|
||||
|
||||
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
|
||||
"✔️ fetched $FolderCount Git repositories at 📂$ParentDirName in $Elapsed sec"
|
||||
exit 0
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
|
||||
exit 1
|
||||
|
@ -1,4 +1,4 @@
|
||||
<#
|
||||
<#
|
||||
.SYNOPSIS
|
||||
get-md5.ps1 [<file>]
|
||||
.DESCRIPTION
|
||||
@ -19,7 +19,7 @@ try {
|
||||
$Result = get-filehash $file -algorithm MD5
|
||||
|
||||
"✔️ MD5 hash is" $Result.Hash
|
||||
exit 0
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
|
||||
exit 1
|
||||
|
@ -1,4 +1,4 @@
|
||||
<#
|
||||
<#
|
||||
.SYNOPSIS
|
||||
get-sha1.ps1 [<file>]
|
||||
.DESCRIPTION
|
||||
@ -19,7 +19,7 @@ try {
|
||||
$Result = get-filehash $file -algorithm SHA1
|
||||
|
||||
"✔️ SHA1 hash is" $Result.Hash
|
||||
exit 0
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
|
||||
exit 1
|
||||
|
@ -1,4 +1,4 @@
|
||||
<#
|
||||
<#
|
||||
.SYNOPSIS
|
||||
get-sha256.ps1 [<file>]
|
||||
.DESCRIPTION
|
||||
@ -19,7 +19,7 @@ try {
|
||||
$Result = get-filehash $file -algorithm SHA256
|
||||
|
||||
"✔️ SHA256 hash is:" $Result.Hash
|
||||
exit 0
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
|
||||
exit 1
|
||||
|
@ -1,4 +1,4 @@
|
||||
<#
|
||||
<#
|
||||
.SYNOPSIS
|
||||
hibernate.ps1
|
||||
.DESCRIPTION
|
||||
@ -18,7 +18,7 @@ try {
|
||||
[System.Windows.Forms.Application]::SetSuspendState("Hibernate", $false, $false);
|
||||
|
||||
"✔️ Done."
|
||||
exit 0
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
|
||||
exit 1
|
||||
|
@ -1,4 +1,4 @@
|
||||
<#
|
||||
<#
|
||||
.SYNOPSIS
|
||||
inspect-exe.ps1 [<path-to-exe-file>]
|
||||
.DESCRIPTION
|
||||
@ -17,7 +17,7 @@ try {
|
||||
if ($PathToExe -eq "" ) { $PathToExe = read-host "Enter path to executable file" }
|
||||
|
||||
get-childitem $PathToExe | % {$_.VersionInfo} | Select *
|
||||
exit 0
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
|
||||
exit 1
|
||||
|
@ -1,4 +1,4 @@
|
||||
<#
|
||||
<#
|
||||
.SYNOPSIS
|
||||
install-github-cli.ps1
|
||||
.DESCRIPTION
|
||||
@ -25,7 +25,7 @@ try {
|
||||
|
||||
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
|
||||
"✔️ installed GitHub CLI in $Elapsed sec"
|
||||
exit 0
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
|
||||
exit 1
|
||||
|
@ -1,4 +1,4 @@
|
||||
<#
|
||||
<#
|
||||
.SYNOPSIS
|
||||
install-google-chrome.ps1
|
||||
.DESCRIPTION
|
||||
@ -22,7 +22,7 @@ try {
|
||||
|
||||
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
|
||||
"✔️ installed Google Chrome in $Elapsed sec"
|
||||
exit 0
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
|
||||
exit 1
|
||||
|
@ -1,4 +1,4 @@
|
||||
<#
|
||||
<#
|
||||
.SYNOPSIS
|
||||
install-knot-resolver.ps1
|
||||
.DESCRIPTION
|
||||
@ -30,7 +30,7 @@ try {
|
||||
|
||||
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
|
||||
"✔️ installed Knot Resolver in $Elapsed sec"
|
||||
exit 0
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
|
||||
exit 1
|
||||
|
@ -1,4 +1,4 @@
|
||||
<#
|
||||
<#
|
||||
.SYNOPSIS
|
||||
install-signal-cli.ps1 [<version>]
|
||||
.DESCRIPTION
|
||||
@ -37,7 +37,7 @@ try {
|
||||
|
||||
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
|
||||
"✔️ installed signal-cli $Version to /opt and /usr/local/bin in $Elapsed sec"
|
||||
exit 0
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
|
||||
exit 1
|
||||
|
@ -1,4 +1,4 @@
|
||||
<#
|
||||
<#
|
||||
.SYNOPSIS
|
||||
install-ssh-client.ps1
|
||||
.DESCRIPTION
|
||||
@ -24,7 +24,7 @@ try {
|
||||
|
||||
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
|
||||
"✔️ installed SSH client in $Elapsed sec"
|
||||
exit 0
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
|
||||
exit 1
|
||||
|
@ -1,4 +1,4 @@
|
||||
<#
|
||||
<#
|
||||
.SYNOPSIS
|
||||
install-ssh-server.ps1
|
||||
.DESCRIPTION
|
||||
@ -38,7 +38,7 @@ try {
|
||||
|
||||
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
|
||||
"✔️ installed and started SSH server in $Elapsed sec"
|
||||
exit 0
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
|
||||
exit 1
|
||||
|
@ -1,4 +1,4 @@
|
||||
<#
|
||||
<#
|
||||
.SYNOPSIS
|
||||
install-updates.ps1
|
||||
.DESCRIPTION
|
||||
@ -34,7 +34,7 @@ try {
|
||||
|
||||
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
|
||||
"✔️ installed updates in $Elapsed sec"
|
||||
exit 0
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
|
||||
exit 1
|
||||
|
@ -1,4 +1,4 @@
|
||||
<#
|
||||
<#
|
||||
.SYNOPSIS
|
||||
install-wsl.ps1
|
||||
.DESCRIPTION
|
||||
@ -34,7 +34,7 @@ try {
|
||||
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
|
||||
"✔️ installed Windows Subsystem for Linux (WSL) in $Elapsed sec"
|
||||
" 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 # success
|
||||
} catch {
|
||||
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
|
||||
exit 1
|
||||
|
@ -1,4 +1,4 @@
|
||||
<#
|
||||
<#
|
||||
.SYNOPSIS
|
||||
introduce-powershell.ps1
|
||||
.DESCRIPTION
|
||||
@ -28,7 +28,7 @@ try {
|
||||
& "$PSScriptRoot/write-typewriter.ps1" "P.S. PowerShell is looking forward to execute your next command"
|
||||
""
|
||||
|
||||
exit 0
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
|
||||
exit 1
|
||||
|
@ -1,4 +1,4 @@
|
||||
<#
|
||||
<#
|
||||
.SYNOPSIS
|
||||
list-aliases.ps1
|
||||
.DESCRIPTION
|
||||
@ -13,7 +13,7 @@
|
||||
|
||||
try {
|
||||
get-alias
|
||||
exit 0
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
|
||||
exit 1
|
||||
|
@ -1,4 +1,4 @@
|
||||
<#
|
||||
<#
|
||||
.SYNOPSIS
|
||||
list-anagrams.ps1 [<word>] [<columns>]
|
||||
.DESCRIPTION
|
||||
@ -58,7 +58,7 @@ try {
|
||||
$Columns = read-host "Enter number of columns"
|
||||
}
|
||||
GetPermutations -String $Word | Format-Wide -Column $Columns
|
||||
exit 0
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
|
||||
exit 1
|
||||
|
@ -1,4 +1,4 @@
|
||||
<#
|
||||
<#
|
||||
.SYNOPSIS
|
||||
list-automatic-variables.ps1
|
||||
.DESCRIPTION
|
||||
@ -69,7 +69,7 @@ function ListAutomaticVariables {
|
||||
|
||||
try {
|
||||
ListAutomaticVariables | format-table -property Variable,Content
|
||||
exit 0
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
|
||||
exit 1
|
||||
|
@ -1,4 +1,4 @@
|
||||
<#
|
||||
<#
|
||||
.SYNOPSIS
|
||||
list-branches.ps1 [<repo-dir>] [<pattern>]
|
||||
.DESCRIPTION
|
||||
@ -35,7 +35,7 @@ try {
|
||||
"$BranchName"
|
||||
}
|
||||
""
|
||||
exit 0
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
|
||||
exit 1
|
||||
|
@ -1,4 +1,4 @@
|
||||
<#
|
||||
<#
|
||||
.SYNOPSIS
|
||||
list-cheat-sheet.ps1
|
||||
.DESCRIPTION
|
||||
@ -39,4 +39,4 @@
|
||||
" `$a,`$b = `$b,`$a : Flip variables"
|
||||
" `$var=[int]5 : Strongly typed variable"
|
||||
""
|
||||
exit 0
|
||||
exit 0 # success
|
||||
|
@ -1,4 +1,4 @@
|
||||
<#
|
||||
<#
|
||||
.SYNOPSIS
|
||||
list-city-weather.ps1
|
||||
.DESCRIPTION
|
||||
@ -18,7 +18,7 @@ try {
|
||||
$Line = (Invoke-WebRequest http://wttr.in/${City}?format="%c %l+%t+%p+%h+%P+%w +%S →+%s" -UserAgent "curl").Content
|
||||
"$Line"
|
||||
}
|
||||
exit 0
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
|
||||
exit 1
|
||||
|
@ -1,4 +1,4 @@
|
||||
<#
|
||||
<#
|
||||
.SYNOPSIS
|
||||
list-cli-tools.ps1
|
||||
.DESCRIPTION
|
||||
@ -162,7 +162,7 @@ function ListTools {
|
||||
|
||||
try {
|
||||
ListTools | format-table -property @{e='Name';width=12},@{e='Version';width=15},@{e='Location';width=45},@{e='FileSize';width=10}
|
||||
exit 0
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
|
||||
exit 1
|
||||
|
@ -1,4 +1,4 @@
|
||||
<#
|
||||
<#
|
||||
.SYNOPSIS
|
||||
list-clipboard.ps1
|
||||
.DESCRIPTION
|
||||
@ -13,7 +13,7 @@
|
||||
|
||||
try {
|
||||
"📋 $(get-clipboard)"
|
||||
exit 0
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
|
||||
exit 1
|
||||
|
@ -1,4 +1,4 @@
|
||||
<#
|
||||
<#
|
||||
.SYNOPSIS
|
||||
list-cmdlets.ps1
|
||||
.DESCRIPTION
|
||||
@ -13,7 +13,7 @@
|
||||
|
||||
try {
|
||||
Get-Command -Command-Type cmdlet
|
||||
exit 0
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
|
||||
exit 1
|
||||
|
@ -1,4 +1,4 @@
|
||||
<#
|
||||
<#
|
||||
.SYNOPSIS
|
||||
list-commits.ps1 [<RepoDir>] [<Format>]
|
||||
.DESCRIPTION
|
||||
@ -43,7 +43,7 @@ try {
|
||||
& git -C "$RepoDir" log
|
||||
if ($lastExitCode -ne "0") { throw "'git log' failed" }
|
||||
}
|
||||
exit 0
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
|
||||
exit 1
|
||||
|
@ -1,4 +1,4 @@
|
||||
<#
|
||||
<#
|
||||
.SYNOPSIS
|
||||
list-console-colors.ps1
|
||||
.DESCRIPTION
|
||||
@ -22,7 +22,7 @@ try {
|
||||
write-host -noNewline -backgroundcolor $Color "$Color"
|
||||
write-host ""
|
||||
}
|
||||
exit 0
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
|
||||
exit 1
|
||||
|
@ -1,4 +1,4 @@
|
||||
<#
|
||||
<#
|
||||
.SYNOPSIS
|
||||
list-countries.ps1
|
||||
.DESCRIPTION
|
||||
@ -26,7 +26,7 @@ function ListCountries {
|
||||
|
||||
try {
|
||||
ListCountries | format-table -property Country,Capital,Population,TLD,Phone
|
||||
exit 0
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
|
||||
exit 1
|
||||
|
@ -1,4 +1,4 @@
|
||||
<#
|
||||
<#
|
||||
.SYNOPSIS
|
||||
list-credits.ps1
|
||||
.DESCRIPTION
|
||||
@ -40,7 +40,7 @@ try {
|
||||
& "$PSScriptRoot/write-animated.ps1" "No Animals Were Harmed in the Making of This Film"
|
||||
|
||||
& "$PSScriptRoot/write-big.ps1" " Thanx 4 watching"
|
||||
exit 0
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
|
||||
exit 1
|
||||
|
@ -1,4 +1,4 @@
|
||||
<#
|
||||
<#
|
||||
.SYNOPSIS
|
||||
list-crypto-rates.ps1
|
||||
.DESCRIPTION
|
||||
@ -45,7 +45,7 @@ try {
|
||||
"============================="
|
||||
|
||||
ListCryptoRates | format-table -property @{e='Cryptocurrency';width=28},USD,EUR,RUB,CNY
|
||||
exit 0
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
|
||||
exit 1
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user