diff --git a/docs/add-firewall-rules.md b/docs/add-firewall-rules.md index df9c6ddb..e6542459 100644 --- a/docs/add-firewall-rules.md +++ b/docs/add-firewall-rules.md @@ -6,7 +6,7 @@ This PowerShell script adds firewall rules for the given executable. Administrat Parameters ---------- ```powershell -PS> ./add-firewall-rules.ps1 [[-PathToExecutables] ] [[-Direction] ] [[-FirewallProfile] ] [] +/home/markus/Repos/PowerShell/scripts/add-firewall-rules.ps1 [[-PathToExecutables] ] [[-Direction] ] [[-FirewallProfile] ] [] -PathToExecutables Specifies the path to the executables. @@ -113,4 +113,4 @@ try { ``` -*(generated by convert-ps2md.ps1 using the comment-based help of add-firewall-rules.ps1 as of 08/15/2024 09:50:44)* +*(generated by convert-ps2md.ps1 using the comment-based help of add-firewall-rules.ps1 as of 11/08/2024 12:34:45)* diff --git a/docs/alert.md b/docs/alert.md index 2978bbf1..7dac26b6 100644 --- a/docs/alert.md +++ b/docs/alert.md @@ -6,7 +6,7 @@ This PowerShell script handles and escalates the given alert message. Parameters ---------- ```powershell -PS> ./alert.ps1 [[-Message] ] [] +/home/markus/Repos/PowerShell/scripts/alert.ps1 [[-Message] ] [] -Message Specifies the alert message @@ -71,4 +71,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of alert.ps1 as of 08/15/2024 09:50:44)* +*(generated by convert-ps2md.ps1 using the comment-based help of alert.ps1 as of 11/08/2024 12:34:45)* diff --git a/docs/build-repo.md b/docs/build-repo.md index 734f1572..b92f567d 100644 --- a/docs/build-repo.md +++ b/docs/build-repo.md @@ -6,7 +6,7 @@ This PowerShell script builds a Git repository by supporting build systems such Parameters ---------- ```powershell -PS> ./build-repo.ps1 [[-path] ] [] +/home/markus/Repos/PowerShell/scripts/build-repo.ps1 [[-path] ] [] -path Specifies the path to the Git repository (default is current working directory) @@ -28,7 +28,7 @@ Example PS> ./build-repo.ps1 C:\Repos\ninja ⏳ Building πŸ“‚ninja using CMakeLists.txt into πŸ“‚ninja/_Build_Results... ... -βœ”οΈ Built πŸ“‚ninja repository in 47 sec. +βœ… Built πŸ“‚ninja repository in 47 sec. ``` @@ -54,7 +54,7 @@ Script Content PS> ./build-repo.ps1 C:\Repos\ninja ⏳ Building πŸ“‚ninja using CMakeLists.txt into πŸ“‚ninja/_Build_Results... ... - βœ”οΈ Built πŸ“‚ninja repository in 47 sec. + βœ… Built πŸ“‚ninja repository in 47 sec. .LINK https://github.com/fleschutz/PowerShell .NOTES @@ -188,7 +188,7 @@ try { $repoDirName = (Get-Item "$path").Name [int]$elapsed = $stopWatch.Elapsed.TotalSeconds - "βœ”οΈ Built πŸ“‚$repoDirName repository in $elapsed sec." + "βœ… Built πŸ“‚$repoDirName repository in $elapsed sec." exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -196,4 +196,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of build-repo.ps1 as of 08/15/2024 09:50:44)* +*(generated by convert-ps2md.ps1 using the comment-based help of build-repo.ps1 as of 11/08/2024 12:34:45)* diff --git a/docs/build-repos.md b/docs/build-repos.md index 06f47ae5..235a37b5 100644 --- a/docs/build-repos.md +++ b/docs/build-repos.md @@ -6,7 +6,7 @@ This PowerShell script builds all Git repositories in a folder. Parameters ---------- ```powershell -PS> ./build-repos.ps1 [[-ParentDir] ] [] +/home/markus/Repos/PowerShell/scripts/build-repos.ps1 [[-ParentDir] ] [] -ParentDir Specifies the path to the parent folder @@ -74,7 +74,7 @@ try { } [int]$Elapsed = $StopWatch.Elapsed.TotalSeconds - "βœ”οΈ built $FolderCount Git repositories at πŸ“‚$ParentDirName in $Elapsed sec" + "βœ… Built $FolderCount Git repositories at πŸ“‚$ParentDirName in $Elapsed sec" exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -82,4 +82,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of build-repos.ps1 as of 08/15/2024 09:50:44)* +*(generated by convert-ps2md.ps1 using the comment-based help of build-repos.ps1 as of 11/08/2024 12:34:45)* diff --git a/docs/cd-autostart.md b/docs/cd-autostart.md index 0db2c1e1..c205fa8f 100644 --- a/docs/cd-autostart.md +++ b/docs/cd-autostart.md @@ -6,7 +6,7 @@ This PowerShell script changes the working directory to the user's autostart fol Parameters ---------- ```powershell -PS> ./cd-autostart.ps1 [] +/home/markus/Repos/PowerShell/scripts/cd-autostart.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -47,12 +47,12 @@ Script Content #> try { - $Path = Resolve-Path "$HOME/AppData/Roaming/Microsoft/Windows/Start Menu/Programs/Startup" - if (-not(Test-Path "$Path" -pathType container)) { - throw "Autostart folder at πŸ“‚$Path doesn't exist (yet)" + $path = Resolve-Path "~/AppData/Roaming/Microsoft/Windows/Start Menu/Programs/Startup" + if (-not(Test-Path "$path" -pathType container)) { + throw "Autostart folder at πŸ“‚$path doesn't exist (yet)" } - Set-Location "$Path" - "πŸ“‚$Path" + Set-Location "$path" + "πŸ“‚$path" exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -60,4 +60,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of cd-autostart.ps1 as of 08/15/2024 09:50:44)* +*(generated by convert-ps2md.ps1 using the comment-based help of cd-autostart.ps1 as of 11/08/2024 12:34:45)* diff --git a/docs/cd-crashdumps.md b/docs/cd-crashdumps.md index d3c087f1..e07dd95b 100644 --- a/docs/cd-crashdumps.md +++ b/docs/cd-crashdumps.md @@ -6,7 +6,7 @@ This PowerShell script changes the working directory to the crash dumps director Parameters ---------- ```powershell -PS> ./cd-crashdumps.ps1 [] +/home/markus/Repos/PowerShell/scripts/cd-crashdumps.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -63,4 +63,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of cd-crashdumps.ps1 as of 08/15/2024 09:50:44)* +*(generated by convert-ps2md.ps1 using the comment-based help of cd-crashdumps.ps1 as of 11/08/2024 12:34:45)* diff --git a/docs/cd-desktop.md b/docs/cd-desktop.md index e7b6887d..f0d12965 100644 --- a/docs/cd-desktop.md +++ b/docs/cd-desktop.md @@ -6,7 +6,7 @@ This PowerShell script changes the working directory to the user's desktop folde Parameters ---------- ```powershell -PS> ./cd-desktop.ps1 [] +/home/markus/Repos/PowerShell/scripts/cd-desktop.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -48,20 +48,20 @@ Script Content try { if ($IsLinux) { - $Path = Resolve-Path "~/Desktop" + $path = Resolve-Path "~/Desktop" } else { - $Path = [Environment]::GetFolderPath('DesktopDirectory') + $path = [Environment]::GetFolderPath('DesktopDirectory') } - if (Test-Path "$Path" -pathType container) { - Set-Location "$Path" - "πŸ“‚$Path" + if (Test-Path "$path" -pathType container) { + Set-Location "$path" + "πŸ“‚$path" exit 0 # success } - throw "User's desktop folder at πŸ“‚$Path doesn't exist (yet)" + throw "User's desktop folder at πŸ“‚$path doesn't exist (yet)" } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" exit 1 } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of cd-desktop.ps1 as of 08/15/2024 09:50:44)* +*(generated by convert-ps2md.ps1 using the comment-based help of cd-desktop.ps1 as of 11/08/2024 12:34:45)* diff --git a/docs/cd-docs.md b/docs/cd-docs.md index 40fbd700..77a65377 100644 --- a/docs/cd-docs.md +++ b/docs/cd-docs.md @@ -6,7 +6,7 @@ This PowerShell script changes the working directory to the documents folder. Parameters ---------- ```powershell -PS> ./cd-docs.ps1 [] +/home/markus/Repos/PowerShell/scripts/cd-docs.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -48,15 +48,15 @@ Script Content try { if ($IsLinux) { - $Path = Resolve-Path "$HOME/Documents" + $path = Resolve-Path "~/Documents" } else { - $Path = [Environment]::GetFolderPath('MyDocuments') + $path = [Environment]::GetFolderPath('MyDocuments') } - if (-not(Test-Path "$Path" -pathType container)) { - throw "Documents folder at πŸ“‚$Path doesn't exist (yet)" + if (-not(Test-Path "$path" -pathType container)) { + throw "Documents folder at πŸ“‚$path doesn't exist (yet)" } - Set-Location "$Path" - "πŸ“‚$Path" + Set-Location "$path" + "πŸ“‚$path" exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -64,4 +64,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of cd-docs.ps1 as of 08/15/2024 09:50:44)* +*(generated by convert-ps2md.ps1 using the comment-based help of cd-docs.ps1 as of 11/08/2024 12:34:45)* diff --git a/docs/cd-downloads.md b/docs/cd-downloads.md index 1f0d76aa..4b3ccbcd 100644 --- a/docs/cd-downloads.md +++ b/docs/cd-downloads.md @@ -6,7 +6,7 @@ This PowerShell script changes the working directory to the user's downloads fol Parameters ---------- ```powershell -PS> ./cd-downloads.ps1 [] +/home/markus/Repos/PowerShell/scripts/cd-downloads.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -48,20 +48,20 @@ Script Content try { if ($IsLinux) { - $Path = Resolve-Path "~/Downloads" + $path = Resolve-Path "~/Downloads" } else { - $Path = (New-Object -ComObject Shell.Application).NameSpace('shell:Downloads').Self.Path + $path = (New-Object -ComObject Shell.Application).NameSpace('shell:Downloads').Self.Path } - if (Test-Path "$Path" -pathType container) { - Set-Location "$Path" - "πŸ“‚$Path" + if (Test-Path "$path" -pathType container) { + Set-Location "$path" + "πŸ“‚$path" exit 0 # success } - throw "User's downloads folder at πŸ“‚$Path doesn't exist (yet)" + throw "User's downloads folder at πŸ“‚$path doesn't exist (yet)" } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" exit 1 } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of cd-downloads.ps1 as of 08/15/2024 09:50:44)* +*(generated by convert-ps2md.ps1 using the comment-based help of cd-downloads.ps1 as of 11/08/2024 12:34:45)* diff --git a/docs/cd-dropbox.md b/docs/cd-dropbox.md index edd26b70..4183498c 100644 --- a/docs/cd-dropbox.md +++ b/docs/cd-dropbox.md @@ -6,7 +6,7 @@ This PowerShell script changes the working directory to the user's Dropbox folde Parameters ---------- ```powershell -PS> ./cd-dropbox.ps1 [] +/home/markus/Repos/PowerShell/scripts/cd-dropbox.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -47,17 +47,15 @@ Script Content #> try { - $Path = Resolve-Path "$HOME/Dropbox" - if (-not(Test-Path "$Path" -pathType container)) { - throw "Dropbox folder at πŸ“‚$Path doesn't exist (yet)" - } - Set-Location "$Path" - "πŸ“‚$Path" + $path = Resolve-Path "~/Dropbox" + if (-not(Test-Path "$path" -pathType container)) { throw "No Dropbox folder at πŸ“‚$path - is Dropbox installed?" } + Set-Location "$path" + "πŸ“‚$path" exit 0 # success } catch { - "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" + "⚠️ Error: $($Error[0])" exit 1 } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of cd-dropbox.ps1 as of 08/15/2024 09:50:44)* +*(generated by convert-ps2md.ps1 using the comment-based help of cd-dropbox.ps1 as of 11/08/2024 12:34:45)* diff --git a/docs/cd-etc.md b/docs/cd-etc.md index e96a1d72..660c0588 100644 --- a/docs/cd-etc.md +++ b/docs/cd-etc.md @@ -6,7 +6,7 @@ This PowerShell script changes the working directory to the /etc directory. Parameters ---------- ```powershell -PS> ./cd-etc.ps1 [] +/home/markus/Repos/PowerShell/scripts/cd-etc.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -48,15 +48,15 @@ Script Content try { if ($IsLinx) { - $Path = "/etc" + $path = "/etc" } else { - $Path = Resolve-Path "$env:WINDIR\System32\drivers\etc" + $path = Resolve-Path "$env:WINDIR\System32\drivers\etc" } - if (-not(Test-Path "$Path" -pathType container)) { - throw "/etc directory at πŸ“‚$Path doesn't exist (yet)" + if (-not(Test-Path "$path" -pathType container)) { + throw "/etc directory at πŸ“‚$path doesn't exist (yet)" } - Set-Location "$Path" - "πŸ“‚$Path" + Set-Location "$path" + "πŸ“‚$path" exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -64,4 +64,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of cd-etc.ps1 as of 08/15/2024 09:50:44)* +*(generated by convert-ps2md.ps1 using the comment-based help of cd-etc.ps1 as of 11/08/2024 12:34:45)* diff --git a/docs/cd-fonts.md b/docs/cd-fonts.md index 50686236..6bd45a56 100644 --- a/docs/cd-fonts.md +++ b/docs/cd-fonts.md @@ -6,7 +6,7 @@ This PowerShell script changes the working directory to the fonts folder. Parameters ---------- ```powershell -PS> ./cd-fonts.ps1 [] +/home/markus/Repos/PowerShell/scripts/cd-fonts.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -47,12 +47,12 @@ Script Content #> try { - $Path = [Environment]::GetFolderPath('Fonts') - if (-not(Test-Path "$Path" -pathType container)) { - throw "Fonts folder at πŸ“‚$Path doesn't exist (yet)" + $path = [Environment]::GetFolderPath('Fonts') + if (-not(Test-Path "$path" -pathType container)) { + throw "Fonts folder at πŸ“‚$path doesn't exist (yet)" } - Set-Location "$Path" - "πŸ“‚$Path" + Set-Location "$path" + "πŸ“‚$path" exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -60,4 +60,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of cd-fonts.ps1 as of 08/15/2024 09:50:44)* +*(generated by convert-ps2md.ps1 using the comment-based help of cd-fonts.ps1 as of 11/08/2024 12:34:45)* diff --git a/docs/cd-home.md b/docs/cd-home.md index 426e7177..e9a3abad 100644 --- a/docs/cd-home.md +++ b/docs/cd-home.md @@ -6,7 +6,7 @@ This PowerShell script changes the working directory to the user's home director Parameters ---------- ```powershell -PS> ./cd-home.ps1 [] +/home/markus/Repos/PowerShell/scripts/cd-home.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -16,7 +16,7 @@ PS> ./cd-home.ps1 [] Example ------- ```powershell -PS> ./cd-home +PS> ./cd-home.ps1 πŸ“‚C:\Users\Markus ``` @@ -38,7 +38,7 @@ Script Content .DESCRIPTION This PowerShell script changes the working directory to the user's home directory. .EXAMPLE - PS> ./cd-home + PS> ./cd-home.ps1 πŸ“‚C:\Users\Markus .LINK https://github.com/fleschutz/PowerShell @@ -47,17 +47,15 @@ Script Content #> try { - $Path = Resolve-Path -Path "~" - if (Test-Path "$Path" -pathType container) { - Set-Location "$Path" - "πŸ“‚$Path" - exit 0 # success - } - throw "User's home folder at πŸ“‚$Path doesn't exist (yet)" + $path = Resolve-Path "~" + if (-not(Test-Path "$path" -pathType container)) { throw "Home folder at $path doesn't exist (yet)" } + Set-Location "$path" + "πŸ“‚$path" + exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" exit 1 } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of cd-home.ps1 as of 08/15/2024 09:50:44)* +*(generated by convert-ps2md.ps1 using the comment-based help of cd-home.ps1 as of 11/08/2024 12:34:45)* diff --git a/docs/cd-jenkins.md b/docs/cd-jenkins.md new file mode 100644 index 00000000..9d53170f --- /dev/null +++ b/docs/cd-jenkins.md @@ -0,0 +1,66 @@ +Script: *cd-jenkins.ps1* +======================== + +This PowerShell script changes the working directory to the Jenkins home directory. + +Parameters +---------- +```powershell +/home/markus/Repos/PowerShell/scripts/cd-jenkins.ps1 [] + +[] + This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, + WarningVariable, OutBuffer, PipelineVariable, and OutVariable. +``` + +Example +------- +```powershell +PS> ./cd-jenkins +πŸ“‚C:\Users\Markus\.jenkins + +``` + +Notes +----- +Author: Markus Fleschutz | License: CC0 + +Related Links +------------- +https://github.com/fleschutz/PowerShell + +Script Content +-------------- +```powershell +<# +.SYNOPSIS + Changes to the Jenkins home directory +.DESCRIPTION + This PowerShell script changes the working directory to the Jenkins home directory. +.EXAMPLE + PS> ./cd-jenkins + πŸ“‚C:\Users\Markus\.jenkins +.LINK + https://github.com/fleschutz/PowerShell +.NOTES + Author: Markus Fleschutz | License: CC0 +#> + +try { + if (Test-Path "~/.jenkins" -pathType container) { + $path = "~/.jenkins" + } elseif (Test-Path "/var/snap/jenkins" -pathType container) { + $path = "/var/snap/jenkins" + } else { + throw "No Jenkins home directory found - is Jenkins installed?" + } + Set-Location "$path" + "πŸ“‚$path" + exit 0 # success +} catch { + "⚠️ Error: $($Error[0])" + exit 1 +} +``` + +*(generated by convert-ps2md.ps1 using the comment-based help of cd-jenkins.ps1 as of 11/08/2024 12:34:45)* diff --git a/docs/cd-logs.md b/docs/cd-logs.md index e8ee8971..f11a4d82 100644 --- a/docs/cd-logs.md +++ b/docs/cd-logs.md @@ -38,9 +38,9 @@ function GetLogsDir { } try { - $Path = GetLogsDir - Set-Location "$Path" - "πŸ“‚$Path" + $path = GetLogsDir + Set-Location "$path" + "πŸ“‚$path" exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -48,4 +48,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of cd-logs.ps1 as of 08/15/2024 09:50:44)* +*(generated by convert-ps2md.ps1 using the comment-based help of cd-logs.ps1 as of 11/08/2024 12:34:45)* diff --git a/docs/cd-music.md b/docs/cd-music.md index 38ff2881..60f626d5 100644 --- a/docs/cd-music.md +++ b/docs/cd-music.md @@ -6,7 +6,7 @@ This PowerShell script changes the working directory to the user's music folder. Parameters ---------- ```powershell -PS> ./cd-music.ps1 [] +/home/markus/Repos/PowerShell/scripts/cd-music.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -48,20 +48,20 @@ Script Content try { if ($IsLinux) { - $Path = Resolve-Path "~/Music" + $path = Resolve-Path "~/Music" } else { - $Path = [Environment]::GetFolderPath('MyMusic') + $path = [Environment]::GetFolderPath('MyMusic') } - if (Test-Path "$Path" -pathType container) { - Set-Location "$Path" - "πŸ“‚$Path" + if (Test-Path "$path" -pathType container) { + Set-Location "$path" + "πŸ“‚$path" exit 0 # success } - throw "User's music folder at πŸ“‚$Path doesn't exist (yet)" + throw "User's music folder at πŸ“‚$path doesn't exist (yet)" } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" exit 1 } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of cd-music.ps1 as of 08/15/2024 09:50:44)* +*(generated by convert-ps2md.ps1 using the comment-based help of cd-music.ps1 as of 11/08/2024 12:34:45)* diff --git a/docs/cd-nextcloud.md b/docs/cd-nextcloud.md new file mode 100644 index 00000000..6d81e83d --- /dev/null +++ b/docs/cd-nextcloud.md @@ -0,0 +1,61 @@ +Script: *cd-nextcloud.ps1* +======================== + +This PowerShell script changes the working directory to the user's NextCloud folder. + +Parameters +---------- +```powershell +/home/markus/Repos/PowerShell/scripts/cd-nextcloud.ps1 [] + +[] + This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, + WarningVariable, OutBuffer, PipelineVariable, and OutVariable. +``` + +Example +------- +```powershell +PS> ./cd-nextcloud +πŸ“‚C:\Users\Markus\NextCloud + +``` + +Notes +----- +Author: Markus Fleschutz | License: CC0 + +Related Links +------------- +https://github.com/fleschutz/PowerShell + +Script Content +-------------- +```powershell +<# +.SYNOPSIS + Sets the working directory to the user's NextCloud folder +.DESCRIPTION + This PowerShell script changes the working directory to the user's NextCloud folder. +.EXAMPLE + PS> ./cd-nextcloud + πŸ“‚C:\Users\Markus\NextCloud +.LINK + https://github.com/fleschutz/PowerShell +.NOTES + Author: Markus Fleschutz | License: CC0 +#> + +try { + $path = Resolve-Path "~/NextCloud" + if (-not(Test-Path "$path" -pathType container)) { throw "No NextCloud folder at πŸ“‚$path - is NextCloud installed?" } + Set-Location "$path" + "πŸ“‚$path" + exit 0 # success +} catch { + "⚠️ Error: $($Error[0])" + exit 1 +} +``` + +*(generated by convert-ps2md.ps1 using the comment-based help of cd-nextcloud.ps1 as of 11/08/2024 12:34:45)* diff --git a/docs/cd-onedrive.md b/docs/cd-onedrive.md index 6a2958ca..67439f99 100644 --- a/docs/cd-onedrive.md +++ b/docs/cd-onedrive.md @@ -6,7 +6,7 @@ This PowerShell script changes the working directory to the user's OneDrive fold Parameters ---------- ```powershell -PS> ./cd-onedrive.ps1 [] +/home/markus/Repos/PowerShell/scripts/cd-onedrive.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -47,17 +47,15 @@ Script Content #> try { - $Path = Resolve-Path "$HOME/OneDrive" - if (-not(Test-Path "$Path" -pathType container)) { - throw "OneDrive folder at πŸ“‚$Path doesn't exist (yet)" - } - Set-Location "$Path" - "πŸ“‚$Path" + $path = Resolve-Path "~/OneDrive" + if (-not(Test-Path "$path" -pathType container)) { throw "No OneDrive folder at πŸ“‚$path - is OneDrive installed?" } + Set-Location "$path" + "πŸ“‚$path" exit 0 # success } catch { - "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" + "⚠️ Error: $($Error[0])" exit 1 } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of cd-onedrive.ps1 as of 08/15/2024 09:50:44)* +*(generated by convert-ps2md.ps1 using the comment-based help of cd-onedrive.ps1 as of 11/08/2024 12:34:45)* diff --git a/docs/cd-pics.md b/docs/cd-pics.md index df81b170..52ddd83b 100644 --- a/docs/cd-pics.md +++ b/docs/cd-pics.md @@ -6,7 +6,7 @@ This PowerShell script changes the working directory to the user's pictures fold Parameters ---------- ```powershell -PS> ./cd-pics.ps1 [] +/home/markus/Repos/PowerShell/scripts/cd-pics.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -48,13 +48,13 @@ Script Content try { if ($IsLinux) { - $Path = Resolve-Path "$HOME/Pictures" + $path = Resolve-Path "~/Pictures" } else { - $Path = [Environment]::GetFolderPath('MyPictures') + $path = [Environment]::GetFolderPath('MyPictures') } - if (-not(Test-Path "$Path" -pathType container)) { throw "Pictures folder at πŸ“‚$Path doesn't exist (yet)" } - Set-Location "$Path" - "πŸ“‚$Path" + if (-not(Test-Path "$path" -pathType container)) { throw "Pictures folder at πŸ“‚$path doesn't exist (yet)" } + Set-Location "$path" + "πŸ“‚$path" exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -62,4 +62,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of cd-pics.ps1 as of 08/15/2024 09:50:44)* +*(generated by convert-ps2md.ps1 using the comment-based help of cd-pics.ps1 as of 11/08/2024 12:34:45)* diff --git a/docs/cd-public.md b/docs/cd-public.md index d56e1bd0..375a96d2 100644 --- a/docs/cd-public.md +++ b/docs/cd-public.md @@ -6,7 +6,7 @@ This PowerShell script changes the working directory to the Public folder. Parameters ---------- ```powershell -PS> ./cd-public.ps1 [] +/home/markus/Repos/PowerShell/scripts/cd-public.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -48,13 +48,13 @@ Script Content try { if ($IsLinux) { - $Path = Resolve-Path "~/Public" + $path = Resolve-Path "~/Public" } else { - $Path = Resolve-Path "~/../Public" + $path = Resolve-Path "~/../Public" } - if (-not(Test-Path "$Path" -pathType container)) { throw "Public folder at πŸ“‚$Path doesn't exist (yet)" } - Set-Location "$Path" - "πŸ“‚$Path" + if (-not(Test-Path "$path" -pathType container)) { throw "Public folder at πŸ“‚$path doesn't exist (yet)" } + Set-Location "$path" + "πŸ“‚$path" exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -62,4 +62,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of cd-public.ps1 as of 08/15/2024 09:50:44)* +*(generated by convert-ps2md.ps1 using the comment-based help of cd-public.ps1 as of 11/08/2024 12:34:45)* diff --git a/docs/cd-recent.md b/docs/cd-recent.md index 794a7e00..12fe07cb 100644 --- a/docs/cd-recent.md +++ b/docs/cd-recent.md @@ -6,7 +6,7 @@ This PowerShell script changes the working directory to the 'recent' folder. Parameters ---------- ```powershell -PS> ./cd-recent.ps1 [] +/home/markus/Repos/PowerShell/scripts/cd-recent.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -60,4 +60,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of cd-recent.ps1 as of 08/15/2024 09:50:44)* +*(generated by convert-ps2md.ps1 using the comment-based help of cd-recent.ps1 as of 11/08/2024 12:34:45)* diff --git a/docs/cd-recycle-bin.md b/docs/cd-recycle-bin.md index 1f2a8cd7..7e348313 100644 --- a/docs/cd-recycle-bin.md +++ b/docs/cd-recycle-bin.md @@ -39,7 +39,7 @@ function GetCurrentUserSID { [CmdletBinding()] param() try { if ($IsLinux) { - $path = "$HOME/.local/share/Trash/" + $path = "~/.local/share/Trash/" } else { $path = "C:\`$Recycle.Bin\$(GetCurrentUserSID)" } @@ -53,4 +53,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of cd-recycle-bin.ps1 as of 08/15/2024 09:50:45)* +*(generated by convert-ps2md.ps1 using the comment-based help of cd-recycle-bin.ps1 as of 11/08/2024 12:34:45)* diff --git a/docs/cd-repo.md b/docs/cd-repo.md index 39ba9f0a..3bd9fd93 100644 --- a/docs/cd-repo.md +++ b/docs/cd-repo.md @@ -1,15 +1,15 @@ Script: *cd-repo.ps1* ======================== -This PowerShell script changes the working directory to a local Git repository. +This PowerShell script changes the working directory to the given local Git repository. Parameters ---------- ```powershell -PS> ./cd-repo.ps1 [[-folderName] ] [] +/home/markus/Repos/PowerShell/scripts/cd-repo.ps1 [[-folderName] ] [] -folderName - Specifies the Git repository's folder name + Specifies the folder name of the Git repository Required? false Position? 1 @@ -26,7 +26,7 @@ Example ------- ```powershell PS> ./cd-repo.ps1 rust -πŸ“‚C:\Repos\rust - current branch is: ## main ... origin/main +πŸ“‚C:\Repos\rust Β· on branch: ## main ... origin/main ``` @@ -43,14 +43,14 @@ Script Content ```powershell <# .SYNOPSIS - Sets the working directory to a repository + Sets the working directory to a repo .DESCRIPTION - This PowerShell script changes the working directory to a local Git repository. + This PowerShell script changes the working directory to the given local Git repository. .PARAMETER folderName - Specifies the Git repository's folder name + Specifies the folder name of the Git repository .EXAMPLE PS> ./cd-repo.ps1 rust - πŸ“‚C:\Repos\rust - current branch is: ## main ... origin/main + πŸ“‚C:\Repos\rust Β· on branch: ## main ... origin/main .LINK https://github.com/fleschutz/PowerShell .NOTES @@ -62,25 +62,26 @@ param([string]$folderName = "") try { if ("$folderName" -eq "") { $folderName = Read-Host "Enter the Git repository's folder name" } - if (Test-Path "$HOME/Repos/" -pathType Container) { # try short name - $path = "$HOME/Repos/" - } elseif (Test-Path "$HOME/repos/" -pathType Container) { - $path = "$HOME/repos/" - } elseif (Test-Path "$HOME/Repositories/" -pathType Container) { # try long name - $path = "$HOME/Repositories/" - } elseif (Test-Path "$HOME/source/repos/" -pathType Container) { # try Visual Studio default - $path = "$HOME/source/repos/" - } elseif (Test-Path "/Repos/" -pathType Container) { + if (Test-Path "~/Repos/" -pathType container) { # try short name + $path = "~/Repos/" + } elseif (Test-Path "~/repos/" -pathType container) { + $path = "~/repos/" + } elseif (Test-Path "~/Repositories/" -pathType container) { # try long name + $path = "~/Repositories/" + } elseif (Test-Path "~/source/repos/" -pathType container) { # try Visual Studio default + $path = "~/source/repos/" + } elseif (Test-Path "/Repos/" -pathType container) { $path = "/Repos/" } else { throw "The folder for Git repositories doesn't exist (yet)" } - $path += $folderName - if (-not(Test-Path "$path" -pathType Container)) { throw "The path to πŸ“‚$path doesn't exist (yet)" } + $path += $folderName + if (-not(Test-Path "$path" -pathType container)) { throw "The path to πŸ“‚$path doesn't exist (yet)" } + $path = Resolve-Path "$path" Set-Location "$path" - Write-Host "πŸ“‚$path - current branch is: " -noNewline + Write-Host "πŸ“‚$path Β· on branch: " -noNewline & git status --short --branch --show-stash exit 0 # success } catch { @@ -89,4 +90,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of cd-repo.ps1 as of 08/15/2024 09:50:45)* +*(generated by convert-ps2md.ps1 using the comment-based help of cd-repo.ps1 as of 11/08/2024 12:34:45)* diff --git a/docs/cd-repos.md b/docs/cd-repos.md index 4d584967..39c43004 100644 --- a/docs/cd-repos.md +++ b/docs/cd-repos.md @@ -6,7 +6,7 @@ This PowerShell script changes the working directory to the user's Git repositor Parameters ---------- ```powershell -PS> ./cd-repos.ps1 [] +/home/markus/Repos/PowerShell/scripts/cd-repos.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -49,14 +49,14 @@ Script Content #> try { - if (Test-Path "$HOME/Repos/" -pathType Container) { # try short name - $path = "$HOME/Repos/" - } elseif (Test-Path "$HOME/repos/" -pathType Container) { - $path = "$HOME/repos/" - } elseif (Test-Path "$HOME/Repositories/" -pathType Container) { # try long name - $path = "$HOME/Repositories/" - } elseif (Test-Path "$HOME/source/repos/" -pathType Container) { # try Visual Studio default - $path = "$HOME/source/repos/" + if (Test-Path "~/Repos/" -pathType Container) { # try short name + $path = "~/Repos/" + } elseif (Test-Path "~/repos/" -pathType Container) { + $path = "~/repos/" + } elseif (Test-Path "~/Repositories/" -pathType Container) { # try long name + $path = "~/Repositories/" + } elseif (Test-Path "~/source/repos/" -pathType Container) { # try Visual Studio default + $path = "~/source/repos/" } elseif (Test-Path "/Repos/" -pathType Container) { $path = "/Repos/" } else { @@ -73,4 +73,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of cd-repos.ps1 as of 08/15/2024 09:50:45)* +*(generated by convert-ps2md.ps1 using the comment-based help of cd-repos.ps1 as of 11/08/2024 12:34:45)* diff --git a/docs/cd-root.md b/docs/cd-root.md index 392a2f5d..1036db87 100644 --- a/docs/cd-root.md +++ b/docs/cd-root.md @@ -6,7 +6,7 @@ This PowerShell script changes the current working directory to the root directo Parameters ---------- ```powershell -PS> ./cd-root.ps1 [] +/home/markus/Repos/PowerShell/scripts/cd-root.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -47,9 +47,9 @@ Script Content #> try { - if ($IsLinux) { $Path = "/" } else { $Path = "C:\" } - Set-Location "$Path" - "πŸ“‚$Path" + if ($IsLinux) { $path = "/" } else { $path = "C:\" } + Set-Location "$path" + "πŸ“‚$path" exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -57,4 +57,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of cd-root.ps1 as of 08/15/2024 09:50:45)* +*(generated by convert-ps2md.ps1 using the comment-based help of cd-root.ps1 as of 11/08/2024 12:34:45)* diff --git a/docs/cd-screenshots.md b/docs/cd-screenshots.md index cdf4c656..acba7e74 100644 --- a/docs/cd-screenshots.md +++ b/docs/cd-screenshots.md @@ -33,21 +33,21 @@ Script Content function GetScreenshotsFolder { if ($IsLinux) { - $Path = "$HOME/Pictures" - if (-not(Test-Path "$Path" -pathType container)) { throw "Pictures folder at $Path doesn't exist (yet)" } - if (Test-Path "$Path/Screenshots" -pathType container) { $Path = "$Path/Screenshots" } + $path = "~/Pictures" + if (-not(Test-Path "$path" -pathType container)) { throw "Pictures folder at $path doesn't exist (yet)" } + if (Test-Path "$path/Screenshots" -pathType container) { $path = "$path/Screenshots" } } else { - $Path = [Environment]::GetFolderPath('MyPictures') - if (-not(Test-Path "$Path" -pathType container)) { throw "Pictures folder at $Path doesn't exist (yet)" } - if (Test-Path "$Path\Screenshots" -pathType container) { $Path = "$Path\Screenshots" } + $path = [Environment]::GetFolderPath('MyPictures') + if (-not(Test-Path "$path" -pathType container)) { throw "Pictures folder at $path doesn't exist (yet)" } + if (Test-Path "$path\Screenshots" -pathType container) { $path = "$path\Screenshots" } } - return $Path + return $path } try { - $Path = GetScreenshotsFolder - Set-Location "$Path" - "πŸ“‚$Path" + $path = GetScreenshotsFolder + Set-Location "$path" + "πŸ“‚$path" exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -55,4 +55,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of cd-screenshots.ps1 as of 08/15/2024 09:50:45)* +*(generated by convert-ps2md.ps1 using the comment-based help of cd-screenshots.ps1 as of 11/08/2024 12:34:46)* diff --git a/docs/cd-scripts.md b/docs/cd-scripts.md index 9ec3cc67..01032d4e 100644 --- a/docs/cd-scripts.md +++ b/docs/cd-scripts.md @@ -6,7 +6,7 @@ This PowerShell script changes the working directory to the PowerShell scripts f Parameters ---------- ```powershell -PS> ./cd-scripts.ps1 [] +/home/markus/Repos/PowerShell/scripts/cd-scripts.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -58,4 +58,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of cd-scripts.ps1 as of 08/15/2024 09:50:45)* +*(generated by convert-ps2md.ps1 using the comment-based help of cd-scripts.ps1 as of 11/08/2024 12:34:46)* diff --git a/docs/cd-ssh.md b/docs/cd-ssh.md index 5ff52bdb..98d6d861 100644 --- a/docs/cd-ssh.md +++ b/docs/cd-ssh.md @@ -1,12 +1,12 @@ Script: *cd-ssh.ps1* ======================== -This PowerShell script changes the working directory to the user's SSH folder. +This PowerShell script changes the working directory to the user's secure shell (SSH) folder. Parameters ---------- ```powershell -PS> ./cd-ssh.ps1 [] +/home/markus/Repos/PowerShell/scripts/cd-ssh.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -16,7 +16,7 @@ PS> ./cd-ssh.ps1 [] Example ------- ```powershell -PS> ./cd-ssh +PS> ./cd-ssh.ps1 πŸ“‚C:\Users\Markus\.ssh ``` @@ -34,11 +34,11 @@ Script Content ```powershell <# .SYNOPSIS - Sets the working directory to the user's SSH folder + Sets the working directory to the SSH folder .DESCRIPTION - This PowerShell script changes the working directory to the user's SSH folder. + This PowerShell script changes the working directory to the user's secure shell (SSH) folder. .EXAMPLE - PS> ./cd-ssh + PS> ./cd-ssh.ps1 πŸ“‚C:\Users\Markus\.ssh .LINK https://github.com/fleschutz/PowerShell @@ -47,15 +47,16 @@ Script Content #> try { - $Path = Resolve-Path "~/.ssh" - if (-not(Test-Path "$Path" -pathType container)) { throw "User's SSH folder at πŸ“‚$Path doesn't exist (yet)" } - Set-Location "$Path" + $path = "~/.ssh" + if (-not(Test-Path "$path" -pathType container)) { throw "Your secure shell (SSH) folder at πŸ“‚$path doesn't exist (yet)" } + $path = Resolve-Path "$path" + Set-Location "$path" "πŸ“‚$Path" exit 0 # success } catch { - "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" + "⚠️ Error: $($Error[0])" exit 1 } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of cd-ssh.ps1 as of 08/15/2024 09:50:45)* +*(generated by convert-ps2md.ps1 using the comment-based help of cd-ssh.ps1 as of 11/08/2024 12:34:46)* diff --git a/docs/cd-temp.md b/docs/cd-temp.md index 530192ef..96ed4c95 100644 --- a/docs/cd-temp.md +++ b/docs/cd-temp.md @@ -39,10 +39,10 @@ function GetTempDir { } try { - $Path = GetTempDir - if (-not(Test-Path "$Path" -pathType container)) { throw "Temporary folder at πŸ“‚$Path doesn't exist (yet)" } - Set-Location "$Path" - "πŸ“‚$Path" + $path = GetTempDir + if (-not(Test-Path "$path" -pathType container)) { throw "Temporary folder at πŸ“‚$path doesn't exist (yet)" } + Set-Location "$path" + "πŸ“‚$path" exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -50,4 +50,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of cd-temp.ps1 as of 08/15/2024 09:50:45)* +*(generated by convert-ps2md.ps1 using the comment-based help of cd-temp.ps1 as of 11/08/2024 12:34:46)* diff --git a/docs/cd-templates.md b/docs/cd-templates.md index b13f45c2..cf2c2673 100644 --- a/docs/cd-templates.md +++ b/docs/cd-templates.md @@ -6,7 +6,7 @@ This PowerShell script changes the working directory to the templates folder. Parameters ---------- ```powershell -PS> ./cd-templates.ps1 [] +/home/markus/Repos/PowerShell/scripts/cd-templates.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -48,13 +48,13 @@ Script Content try { if ($IsLinux) { - $Path = Resolve-Path "~/Templates" + $path = Resolve-Path "~/Templates" } else { - $Path = [Environment]::GetFolderPath('Templates') + $path = [Environment]::GetFolderPath('Templates') } - if (-not(Test-Path "$Path" -pathType container)) { throw "Templates folder at πŸ“‚$Path doesn't exist (yet)" } - Set-Location "$Path" - "πŸ“‚$Path" + if (-not(Test-Path "$path" -pathType container)) { throw "Templates folder at πŸ“‚$path doesn't exist (yet)" } + Set-Location "$path" + "πŸ“‚$path" exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -62,4 +62,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of cd-templates.ps1 as of 08/15/2024 09:50:45)* +*(generated by convert-ps2md.ps1 using the comment-based help of cd-templates.ps1 as of 11/08/2024 12:34:46)* diff --git a/docs/cd-trash.md b/docs/cd-trash.md index d3b1657e..5eb1dafc 100644 --- a/docs/cd-trash.md +++ b/docs/cd-trash.md @@ -39,7 +39,7 @@ function GetCurrentUserSID { [CmdletBinding()] param() try { if ($IsLinux) { - $path = "$HOME/.local/share/Trash/" + $path = "~/.local/share/Trash/" } else { $path = "C:\`$Recycle.Bin\$(GetCurrentUserSID)" } @@ -53,4 +53,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of cd-trash.ps1 as of 08/15/2024 09:50:45)* +*(generated by convert-ps2md.ps1 using the comment-based help of cd-trash.ps1 as of 11/08/2024 12:34:46)* diff --git a/docs/cd-up.md b/docs/cd-up.md index 3d980bbe..5d16455e 100644 --- a/docs/cd-up.md +++ b/docs/cd-up.md @@ -6,7 +6,7 @@ This PowerShell script changes the working directory to one directory level up. Parameters ---------- ```powershell -PS> ./cd-up.ps1 [] +/home/markus/Repos/PowerShell/scripts/cd-up.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -47,10 +47,10 @@ Script Content #> try { - $Path = Resolve-Path ".." - if (-not(Test-Path "$Path" -pathType container)) { throw "Folder at πŸ“‚$Path doesn't exist (yet)" } - Set-Location "$Path" - "πŸ“‚$Path" + $path = Resolve-Path ".." + if (-not(Test-Path "$path" -pathType container)) { throw "Folder at πŸ“‚$path doesn't exist (yet)" } + Set-Location "$path" + "πŸ“‚$path" exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -58,4 +58,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of cd-up.ps1 as of 08/15/2024 09:50:45)* +*(generated by convert-ps2md.ps1 using the comment-based help of cd-up.ps1 as of 11/08/2024 12:34:46)* diff --git a/docs/cd-up2.md b/docs/cd-up2.md index 792e90ef..70045c9b 100644 --- a/docs/cd-up2.md +++ b/docs/cd-up2.md @@ -6,7 +6,7 @@ This PowerShell script changes the working directory to two directory level up. Parameters ---------- ```powershell -PS> ./cd-up2.ps1 [] +/home/markus/Repos/PowerShell/scripts/cd-up2.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -47,10 +47,10 @@ Script Content #> try { - $Path = Resolve-Path "../.." - if (-not(Test-Path "$Path" -pathType container)) { throw "Folder at πŸ“‚$Path doesn't exist (yet)" } - Set-Location "$Path" - "πŸ“‚$Path" + $path = Resolve-Path "../.." + if (-not(Test-Path "$path" -pathType container)) { throw "Folder at πŸ“‚$path doesn't exist (yet)" } + Set-Location "$path" + "πŸ“‚$path" exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -58,4 +58,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of cd-up2.ps1 as of 08/15/2024 09:50:45)* +*(generated by convert-ps2md.ps1 using the comment-based help of cd-up2.ps1 as of 11/08/2024 12:34:46)* diff --git a/docs/cd-up3.md b/docs/cd-up3.md index 7a36791f..318ebdb5 100644 --- a/docs/cd-up3.md +++ b/docs/cd-up3.md @@ -6,7 +6,7 @@ This PowerShell script changes the working directory to three directory levels u Parameters ---------- ```powershell -PS> ./cd-up3.ps1 [] +/home/markus/Repos/PowerShell/scripts/cd-up3.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -47,10 +47,10 @@ Script Content #> try { - $Path = Resolve-Path "../../.." - if (-not(Test-Path "$Path" -pathType container)) { throw "Folder at πŸ“‚$Path doesn't exist (yet)" } - Set-Location "$Path" - "πŸ“‚$Path" + $path = Resolve-Path "../../.." + if (-not(Test-Path "$path" -pathType container)) { throw "Folder at πŸ“‚$path doesn't exist (yet)" } + Set-Location "$path" + "πŸ“‚$path" exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -58,4 +58,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of cd-up3.ps1 as of 08/15/2024 09:50:45)* +*(generated by convert-ps2md.ps1 using the comment-based help of cd-up3.ps1 as of 11/08/2024 12:34:46)* diff --git a/docs/cd-up4.md b/docs/cd-up4.md index eda5a3b2..7772d9ab 100644 --- a/docs/cd-up4.md +++ b/docs/cd-up4.md @@ -6,7 +6,7 @@ This PowerShell script changes the working directory to four directory levels up Parameters ---------- ```powershell -PS> ./cd-up4.ps1 [] +/home/markus/Repos/PowerShell/scripts/cd-up4.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -47,10 +47,10 @@ Script Content #> try { - $Path = Resolve-Path "../../../.." - if (-not(Test-Path "$Path" -pathType container)) { throw "Folder at πŸ“‚$Path doesn't exist (yet)" } - Set-Location "$Path" - "πŸ“‚$Path" + $path = Resolve-Path "../../../.." + if (-not(Test-Path "$path" -pathType container)) { throw "Folder at πŸ“‚$path doesn't exist (yet)" } + Set-Location "$path" + "πŸ“‚$path" exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -58,4 +58,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of cd-up4.ps1 as of 08/15/2024 09:50:45)* +*(generated by convert-ps2md.ps1 using the comment-based help of cd-up4.ps1 as of 11/08/2024 12:34:46)* diff --git a/docs/cd-users.md b/docs/cd-users.md index 664f2a59..4d00347b 100644 --- a/docs/cd-users.md +++ b/docs/cd-users.md @@ -6,7 +6,7 @@ This PowerShell script changes the working directory to the users directory. Parameters ---------- ```powershell -PS> ./cd-users.ps1 [] +/home/markus/Repos/PowerShell/scripts/cd-users.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -47,10 +47,10 @@ Script Content #> try { - $Path = Resolve-Path "$HOME/.." - if (-not(Test-Path "$Path" -pathType container)) { throw "Users directory at πŸ“‚$Path doesn't exist (yet)" } - Set-Location "$Path" - "πŸ“‚$Path" + $path = Resolve-Path "~/.." + if (-not(Test-Path "$path" -pathType container)) { throw "Users directory at πŸ“‚$path doesn't exist (yet)" } + Set-Location "$path" + "πŸ“‚$path" exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -58,4 +58,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of cd-users.ps1 as of 08/15/2024 09:50:45)* +*(generated by convert-ps2md.ps1 using the comment-based help of cd-users.ps1 as of 11/08/2024 12:34:46)* diff --git a/docs/cd-videos.md b/docs/cd-videos.md index c24c4269..16fe17e7 100644 --- a/docs/cd-videos.md +++ b/docs/cd-videos.md @@ -6,7 +6,7 @@ This PowerShell script changes the working directory to the user's videos folder Parameters ---------- ```powershell -PS> ./cd-videos.ps1 [] +/home/markus/Repos/PowerShell/scripts/cd-videos.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -48,13 +48,13 @@ Script Content try { if ($IsLinux) { - $Path = Resolve-Path "$HOME/Videos" + $path = Resolve-Path "~/Videos" } else { - $Path = [Environment]::GetFolderPath('MyVideos') + $path = [Environment]::GetFolderPath('MyVideos') } - if (-not(Test-Path "$Path" -pathType container)) { throw "Videos folder at πŸ“‚$Path doesn't exist (yet)" } - Set-Location "$Path" - "πŸ“‚$Path" + if (-not(Test-Path "$path" -pathType container)) { throw "Videos folder at πŸ“‚$path doesn't exist (yet)" } + Set-Location "$path" + "πŸ“‚$path" exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -62,4 +62,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of cd-videos.ps1 as of 08/15/2024 09:50:45)* +*(generated by convert-ps2md.ps1 using the comment-based help of cd-videos.ps1 as of 11/08/2024 12:34:46)* diff --git a/docs/cd-windows.md b/docs/cd-windows.md index 48ec307c..93a372a8 100644 --- a/docs/cd-windows.md +++ b/docs/cd-windows.md @@ -6,7 +6,7 @@ This PowerShell script changes the working directory to the Windows directory. Parameters ---------- ```powershell -PS> ./cd-windows.ps1 [] +/home/markus/Repos/PowerShell/scripts/cd-windows.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -47,10 +47,10 @@ Script Content #> try { - $Path = Resolve-Path "$env:WINDIR" - if (-not(Test-Path "$Path" -pathType container)) { throw "Windows directory at πŸ“‚$Path doesn't exist" } - Set-Location "$Path" - "πŸ“‚$Path" + $path = Resolve-Path "$env:WINDIR" + if (-not(Test-Path "$path" -pathType container)) { throw "Windows directory at πŸ“‚$path doesn't exist" } + Set-Location "$path" + "πŸ“‚$path" exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -58,4 +58,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of cd-windows.ps1 as of 08/15/2024 09:50:45)* +*(generated by convert-ps2md.ps1 using the comment-based help of cd-windows.ps1 as of 11/08/2024 12:34:46)* diff --git a/docs/change-wallpaper.md b/docs/change-wallpaper.md index 64c558aa..ba5ed93d 100644 --- a/docs/change-wallpaper.md +++ b/docs/change-wallpaper.md @@ -6,7 +6,7 @@ This PowerShell script downloads a random photo from Unsplash and sets it as des Parameters ---------- ```powershell -PS> ./change-wallpaper.ps1 [[-Category] ] [] +/home/markus/Repos/PowerShell/scripts/change-wallpaper.ps1 [[-Category] ] [] -Category Specifies the photo category (beach, city, ...) @@ -79,4 +79,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of change-wallpaper.ps1 as of 08/15/2024 09:50:45)* +*(generated by convert-ps2md.ps1 using the comment-based help of change-wallpaper.ps1 as of 11/08/2024 12:34:46)* diff --git a/docs/check-admin.md b/docs/check-admin.md index 8d5cf476..f308c7d7 100644 --- a/docs/check-admin.md +++ b/docs/check-admin.md @@ -6,7 +6,7 @@ This PowerShell script checks if the user has administrator rights. Parameters ---------- ```powershell -PS> ./check-admin.ps1 [] +/home/markus/Repos/PowerShell/scripts/check-admin.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -67,4 +67,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of check-admin.ps1 as of 08/15/2024 09:50:45)* +*(generated by convert-ps2md.ps1 using the comment-based help of check-admin.ps1 as of 11/08/2024 12:34:46)* diff --git a/docs/check-apps.md b/docs/check-apps.md index 735a3b3d..bd9dfdf6 100644 --- a/docs/check-apps.md +++ b/docs/check-apps.md @@ -24,50 +24,47 @@ Script Content This PowerShell script queries the installed applications and prints it. .EXAMPLE PS> ./check-apps.ps1 - βœ… 119 Windows apps installed, 11 upgrades available + ⚠️ 150 Win apps installed, 72 upgrades available, 5 crash dump(s) found .LINK https://github.com/fleschutz/PowerShell .NOTES Author: Markus Fleschutz | License: CC0 #> -function GetCrashDumps { +function CountCrashDumps { [string]$path = Resolve-Path -Path "~\AppData\Local\CrashDumps" - $count = 0 $files = (Get-ChildItem -path "$path\*.dmp" -attributes !Directory) - foreach($file in $files) { $count++ } - return $count + return $files.Count } try { - $statusIcon = "βœ…" - $statusMsg = "" + $status = "βœ…" if ($IsLinux) { Write-Progress "Querying installed applications..." $numPkgs = (apt list --installed 2>/dev/null).Count $numSnaps = (snap list).Count - 1 Write-Progress -completed "Done." - $statusMsg += "$numPkgs Debian packages, $numSnaps snaps installed" + $reply = "$numPkgs Debian packages, $numSnaps snaps installed" } else { Write-Progress "Querying installed apps..." - $Apps = Get-AppxPackage + $apps = Get-AppxPackage Write-Progress -completed "Done." - $statusMsg = "$($Apps.Count) Win apps installed" + $reply = "$($apps.Count) Win apps installed" [int]$numNonOk = 0 - foreach($App in $Apps) { if ($App.Status -ne "Ok") { $numNonOk++ } } - if ($numNonOk -gt 0) { $statusIcon = "⚠️"; $statusMsg += ", $numNonOk non-ok" } + foreach($app in $apps) { if ($app.Status -ne "Ok") { $numNonOk++ } } + if ($numNonOk -gt 0) { $status = "⚠️"; $reply += ", $numNonOk non-ok" } [int]$numErrors = (Get-AppxLastError) - if ($numErrors -gt 0) { $statusIcon = "⚠️"; $statusMsg += ", $numErrors errors" } + if ($numErrors -gt 0) { $status = "⚠️"; $reply += ", $numErrors errors" } $numUpdates = (winget upgrade --include-unknown).Count - 5 - $statusMsg += ", $numUpdates upgrades available" + $reply += ", $numUpdates upgrades available" - $crashDumps = GetCrashDumps - if ($crashDumps -ne 0) { $statusIcon = "⚠️"; $statusMsg += " - found $crashDumps crash dump(s)" } + $numCrashDumps = CountCrashDumps + if ($numCrashDumps -ne 0) { $status = "⚠️"; $reply += ", $numCrashDumps crash dump(s) found" } } - Write-Host "$statusIcon $statusMsg" + Write-Host "$status $reply" exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -75,4 +72,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of check-apps.ps1 as of 08/15/2024 09:50:45)* +*(generated by convert-ps2md.ps1 using the comment-based help of check-apps.ps1 as of 11/08/2024 12:34:46)* diff --git a/docs/check-bios.md b/docs/check-bios.md index 1fe0a3c0..568bb1f0 100644 --- a/docs/check-bios.md +++ b/docs/check-bios.md @@ -6,7 +6,7 @@ This PowerShell script queries the BIOS status and prints it. Parameters ---------- ```powershell -PS> ./check-bios.ps1 [] +/home/markus/Repos/PowerShell/scripts/check-bios.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -17,7 +17,7 @@ Example ------- ```powershell PS> ./check-bios.ps1 -βœ… BIOS model P62 v02.67 by HP (version HPQOEM - 5, S/N CZC1080B01) +βœ… BIOS model P62 v02.67, version HPQOEM - 5, S/N CZC1080B01 by HP ``` @@ -39,7 +39,7 @@ Script Content This PowerShell script queries the BIOS status and prints it. .EXAMPLE PS> ./check-bios.ps1 - βœ… BIOS model P62 v02.67 by HP (version HPQOEM - 5, S/N CZC1080B01) + βœ… BIOS model P62 v02.67, version HPQOEM - 5, S/N CZC1080B01 by HP .LINK https://github.com/fleschutz/PowerShell .NOTES @@ -48,27 +48,26 @@ Script Content try { if ($IsLinux) { - Write-Progress "Querying BIOS details..." $model = (sudo dmidecode -s system-product-name) - if ("$model" -ne "") { - $version = (sudo dmidecode -s bios-version) - $releaseDate = (sudo dmidecode -s bios-release-date) - $manufacturer = (sudo dmidecode -s system-manufacturer) - Write-Host "βœ… BIOS model $model by $manufacturer (version $version of $releaseDate)" - } - Write-Progress -completed "." + if ("$model" -eq "") { exit 0 } # no information + Write-Progress "Querying BIOS details..." + $version = (sudo dmidecode -s bios-version) + $releaseDate = (sudo dmidecode -s bios-release-date) + $manufacturer = (sudo dmidecode -s system-manufacturer) + Write-Progress -completed "Done." } else { - $BIOS = Get-CimInstance -ClassName Win32_BIOS - $model = $BIOS.Name.Trim() - $version = $BIOS.Version.Trim() - $serialNumber = $BIOS.SerialNumber.Trim() - $manufacturer = $BIOS.Manufacturer.Trim() - if ($serialNumber -eq "To be filled by O.E.M.") { - Write-Host "βœ… BIOS model $model by $manufacturer (version $version)" - } else { - Write-Host "βœ… BIOS model $model by $manufacturer (version $version, S/N $serialNumber)" - } + $details = Get-CimInstance -ClassName Win32_BIOS + $model = $details.Name.Trim() + $version = $details.Version.Trim() + $serial = $details.SerialNumber.Trim() + $manufacturer = $details.Manufacturer.Trim() } + if ($model -eq "To be filled by O.E.M.") { $model = "N/A" } + if ($version -eq "To be filled by O.E.M.") { $version = "N/A" } + if ("$releaseDate" -ne "") { $releaseDate = " of $releaseDate" } + if ("$serial" -eq "") { $serial = "N/A" } + if ($serial -eq "To be filled by O.E.M.") { $serial = "N/A" } + Write-Host "βœ… BIOS model $model, version $($version)$($releaseDate), S/N $serial by $manufacturer" exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -76,4 +75,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of check-bios.ps1 as of 08/15/2024 09:50:45)* +*(generated by convert-ps2md.ps1 using the comment-based help of check-bios.ps1 as of 11/08/2024 12:34:46)* diff --git a/docs/check-cpu.md b/docs/check-cpu.md index 5476bc50..2ff1b6ac 100644 --- a/docs/check-cpu.md +++ b/docs/check-cpu.md @@ -74,26 +74,31 @@ try { $details = Get-WmiObject -Class Win32_Processor $cpuName = $details.Name.trim() $arch = "$arch, " - $deviceID = "$($details.DeviceID), " - $speed = "$($details.MaxClockSpeed)MHz, " - $socket = "$($details.SocketDesignation) socket" + $deviceID = ", $($details.DeviceID)" + $speed = ", $($details.MaxClockSpeed)MHz" + $socket = ", $($details.SocketDesignation) socket" } $cores = [System.Environment]::ProcessorCount $celsius = GetCPUTemperature if ($celsius -eq 99999.9) { - $temp = "no temp" + $temp = "" + } elseif ($celsius -gt 80) { + $temp = ", $($celsius)Β°C TOO HOT" + $status = "⚠️" } elseif ($celsius -gt 50) { - $temp = "$($celsius)Β°C HOT" + $temp = ", $($celsius)Β°C HOT" $status = "⚠️" } elseif ($celsius -lt 0) { - $temp = "$($celsius)Β°C COLD" + $temp = ", $($celsius)Β°C TOO COLD" $status = "⚠️" + } elseif ($celsius -lt 30) { + $temp = ", $($celsius)Β°C cool" } else { - $temp = "$($celsius)Β°C OK" + $temp = ", $($celsius)Β°C" } Write-Progress -completed "Done." - Write-Host "$status $cpuName ($($arch)$cores cores, $($deviceID)$($speed)$($socket)) - $temp" + Write-Host "$status $cpuName ($($arch)$cores cores$($temp)$($deviceID)$($speed)$($socket))" exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -101,4 +106,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of check-cpu.ps1 as of 08/15/2024 09:50:45)* +*(generated by convert-ps2md.ps1 using the comment-based help of check-cpu.ps1 as of 11/08/2024 12:34:46)* diff --git a/docs/check-credentials.md b/docs/check-credentials.md index afbf224b..f2806844 100644 --- a/docs/check-credentials.md +++ b/docs/check-credentials.md @@ -6,7 +6,7 @@ This PowerShell script asks for credentials and checks them against saved ones ( Parameters ---------- ```powershell -PS> ./check-credentials.ps1 [[-TargetFile] ] [] +/home/markus/Repos/PowerShell/scripts/check-credentials.ps1 [[-TargetFile] ] [] -TargetFile Specifies the target file ("$HOME\my.credentials" by default) @@ -27,7 +27,7 @@ Example ```powershell PS> ./check-credentials.ps1 Enter username and password, please. - βœ”οΈ Your credentials are correct. + βœ… Your credentials are correct. ``` @@ -52,7 +52,7 @@ Script Content .EXAMPLE PS> ./check-credentials.ps1 Enter username and password, please. - βœ”οΈ Your credentials are correct. + βœ… Your credentials are correct. .LINK https://github.com/fleschutz/PowerShell .NOTES @@ -74,7 +74,7 @@ try { $pw2 = [Runtime.InteropServices.Marshal]::PtrToStringAuto([Runtime.InteropServices.Marshal]::SecureStringToBSTR($credsFromFile.Password)) if ($pw1 -cne $pw2) { throw "Sorry, your password is wrong." } - "βœ”οΈ Your credentials are correct." + "βœ… Your credentials are correct." exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -82,4 +82,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of check-credentials.ps1 as of 08/15/2024 09:50:45)* +*(generated by convert-ps2md.ps1 using the comment-based help of check-credentials.ps1 as of 11/08/2024 12:34:46)* diff --git a/docs/check-day.md b/docs/check-day.md index e1ad0462..70e9fe46 100644 --- a/docs/check-day.md +++ b/docs/check-day.md @@ -6,7 +6,7 @@ This PowerShell script determines and speaks the current day by text-to-speech ( Parameters ---------- ```powershell -PS> ./check-day.ps1 [] +/home/markus/Repos/PowerShell/scripts/check-day.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -17,7 +17,7 @@ Example ------- ```powershell PS> ./check-day -βœ”οΈ It's Sunday. +βœ… It's Sunday. ``` @@ -39,7 +39,7 @@ Script Content This PowerShell script determines and speaks the current day by text-to-speech (TTS). .EXAMPLE PS> ./check-day - βœ”οΈ It's Sunday. + βœ… It's Sunday. .LINK https://github.com/fleschutz/PowerShell .NOTES @@ -57,4 +57,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of check-day.ps1 as of 08/15/2024 09:50:45)* +*(generated by convert-ps2md.ps1 using the comment-based help of check-day.ps1 as of 11/08/2024 12:34:46)* diff --git a/docs/check-dns.md b/docs/check-dns.md index 7ad6dae7..b3f8e2ed 100644 --- a/docs/check-dns.md +++ b/docs/check-dns.md @@ -1,12 +1,12 @@ Script: *check-dns.ps1* ======================== -This PowerShell script measures the DNS resolution speed (using 100 popular domains) and prints it. +This PowerShell script measures the DNS resolution speed using 100 internet domains and prints it. Parameters ---------- ```powershell -PS> ./check-dns.ps1 [] +/home/markus/Repos/PowerShell/scripts/check-dns.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -17,7 +17,7 @@ Example ------- ```powershell PS> ./check-dns.ps1 -βœ… DNS resolves 56.5 domains per second +βœ… Internet DNS lookups in 33.6ms ``` @@ -36,10 +36,10 @@ Script Content .SYNOPSIS Check the DNS resolution .DESCRIPTION - This PowerShell script measures the DNS resolution speed (using 100 popular domains) and prints it. + This PowerShell script measures the DNS resolution speed using 100 internet domains and prints it. .EXAMPLE PS> ./check-dns.ps1 - βœ… DNS resolves 56.5 domains per second + βœ… Internet DNS lookups in 33.6ms .LINK https://github.com/fleschutz/PowerShell .NOTES @@ -47,24 +47,21 @@ Script Content #> try { - #Write-Progress "Measuring DNS resolution..." $table = Import-CSV "$PSScriptRoot/../data/popular-domains.csv" - $numRows = $table.Length $stopWatch = [system.diagnostics.stopwatch]::startNew() if ($IsLinux) { foreach($row in $table){$nop=dig $row.Domain +short} } else { + Clear-DnsClientCache foreach($row in $table){$nop=Resolve-DNSName $row.Domain} } - [float]$elapsed = $stopWatch.Elapsed.TotalSeconds - - #Write-Progress -completed "Measuring DNS resolution..." - $average = [math]::round($numRows / $elapsed, 1) - if ($average -lt 10.0) { - Write-Host "⚠️ DNS resolves $average domains per second only" + [float]$elapsed = $stopWatch.Elapsed.TotalSeconds * 1000.0 + $speed = [math]::round($elapsed / $table.Length, 1) + if ($speed -gt 100.0) { + Write-Host "⚠️ Internet DNS lookups take $($speed)ms!" } else { - Write-Host "βœ… DNS resolves $average domains per second" + Write-Host "βœ… Internet DNS lookups in $($speed)ms" } exit 0 # success } catch { @@ -73,4 +70,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of check-dns.ps1 as of 08/15/2024 09:50:45)* +*(generated by convert-ps2md.ps1 using the comment-based help of check-dns.ps1 as of 11/08/2024 12:34:46)* diff --git a/docs/check-drive-space.md b/docs/check-drive-space.md index 681ef641..7d18083d 100644 --- a/docs/check-drive-space.md +++ b/docs/check-drive-space.md @@ -6,7 +6,7 @@ This PowerShell script checks the given drive for free space left (10 GB by defa Parameters ---------- ```powershell -PS> ./check-drive-space.ps1 [[-driveName] ] [[-minLevel] ] [] +/home/markus/Repos/PowerShell/scripts/check-drive-space.ps1 [[-driveName] ] [[-minLevel] ] [] -driveName Specifies the drive name to check (e.g. "C") @@ -110,4 +110,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of check-drive-space.ps1 as of 08/15/2024 09:50:45)* +*(generated by convert-ps2md.ps1 using the comment-based help of check-drive-space.ps1 as of 11/08/2024 12:34:46)* diff --git a/docs/check-drives.md b/docs/check-drives.md index 849c757c..b56f75d4 100644 --- a/docs/check-drives.md +++ b/docs/check-drives.md @@ -6,14 +6,14 @@ This PowerShell script queries the free space of all drives and prints it. Parameters ---------- ```powershell -PS> ./check-drives.ps1 [[-minLevel] ] [] +/home/markus/Repos/PowerShell/scripts/check-drives.ps1 [[-minLevel] ] [] -minLevel - Specifies the minimum warning level (10GB by default) + Specifies the minimum warning level (5GB by default) Required? false Position? 1 - Default value 10 + Default value 5368709120 Accept pipeline input? false Accept wildcard characters? false @@ -26,8 +26,7 @@ Example ------- ```powershell PS> ./check-drives.ps1 -βœ… Drive C: uses 49% of 1TB - 512GB free -βœ… Drive D: uses 84% of 4TB - 641GB free +βœ… Drive C: uses 489GB (53%) of 930GB, D: uses 3TB (87%) of 4TB, E: is empty ``` @@ -48,51 +47,54 @@ Script Content .DESCRIPTION This PowerShell script queries the free space of all drives and prints it. .PARAMETER minLevel - Specifies the minimum warning level (10GB by default) + Specifies the minimum warning level (5GB by default) .EXAMPLE PS> ./check-drives.ps1 - βœ… Drive C: uses 49% of 1TB - 512GB free - βœ… Drive D: uses 84% of 4TB - 641GB free + βœ… Drive C: uses 489GB (53%) of 930GB, D: uses 3TB (87%) of 4TB, E: is empty .LINK https://github.com/fleschutz/PowerShell .NOTES Author: Markus Fleschutz | License: CC0 #> -param([int64]$minLevel = 10) # 10 GB minimum +param([int64]$minLevel = 5GB) -function Bytes2String { param([int64]$number) - if ($number -lt 1KB) { return "$number bytes" } - if ($number -lt 1MB) { return '{0:N0}KB' -f ($number / 1KB) } - if ($number -lt 1GB) { return '{0:N0}MB' -f ($number / 1MB) } - if ($number -lt 1TB) { return '{0:N0}GB' -f ($number / 1GB) } - if ($number -lt 1PB) { return '{0:N0}TB' -f ($number / 1TB) } - return '{0:N0}GB' -f ($number / 1PB) +function Bytes2String { param([int64]$bytes) + if ($bytes -lt 1KB) { return "$bytes bytes" } + if ($bytes -lt 1MB) { return '{0:N0}KB' -f ($bytes / 1KB) } + if ($bytes -lt 1GB) { return '{0:N0}MB' -f ($bytes / 1MB) } + if ($bytes -lt 1TB) { return '{0:N0}GB' -f ($bytes / 1GB) } + if ($bytes -lt 1PB) { return '{0:N0}TB' -f ($bytes / 1TB) } + return '{0:N0}GB' -f ($bytes / 1PB) } try { Write-Progress "Querying drives..." $drives = Get-PSDrive -PSProvider FileSystem - $minLevel *= 1GB - Write-Progress -completed " " + Write-Progress -completed "Done." + $status = "βœ…" + $reply = "Drive " foreach($drive in $drives) { $details = (Get-PSDrive $drive.Name) if ($IsLinux) { $name = $drive.Name } else { $name = $drive.Name + ":" } [int64]$free = $details.Free [int64]$used = $details.Used [int64]$total = ($used + $free) - + if ($reply -ne "Drive ") { $reply += ", " } if ($total -eq 0) { - Write-Host "βœ… Drive $name is empty" + $reply += "$name is empty" } elseif ($free -eq 0) { - Write-Host "⚠️ Drive $name with $(Bytes2String $total) is full" + $status = "⚠️" + $reply += "$name with ($(Bytes2String $total)) is FULL" } elseif ($free -lt $minLevel) { - Write-Host "⚠️ Drive $name with $(Bytes2String $total) is nearly full, $(Bytes2String $free) free" + $status = "⚠️" + $reply += "$name nearly full ($(Bytes2String $free) of $(Bytes2String $total) left)" } else { [int64]$percent = ($used * 100) / $total - Write-Host "βœ… Drive $name uses $percent% of $(Bytes2String $total) - $(Bytes2String $free) free" + $reply += "$name uses $(Bytes2String $used) ($percent%) of $(Bytes2String $total)" } } + Write-Host "$status $reply" exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -100,4 +102,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of check-drives.ps1 as of 08/15/2024 09:50:45)* +*(generated by convert-ps2md.ps1 using the comment-based help of check-drives.ps1 as of 11/08/2024 12:34:46)* diff --git a/docs/check-dusk.md b/docs/check-dusk.md index 98023cc4..f0af1d08 100644 --- a/docs/check-dusk.md +++ b/docs/check-dusk.md @@ -63,4 +63,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of check-dusk.ps1 as of 08/15/2024 09:50:45)* +*(generated by convert-ps2md.ps1 using the comment-based help of check-dusk.ps1 as of 11/08/2024 12:34:46)* diff --git a/docs/check-easter-sunday.md b/docs/check-easter-sunday.md index efb8f0eb..89d2c74c 100644 --- a/docs/check-easter-sunday.md +++ b/docs/check-easter-sunday.md @@ -6,7 +6,7 @@ This PowerShell script checks the time until Easter Sunday and replies by text-t Parameters ---------- ```powershell -PS> ./check-easter-sunday.ps1 [] +/home/markus/Repos/PowerShell/scripts/check-easter-sunday.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -61,4 +61,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of check-easter-sunday.ps1 as of 08/15/2024 09:50:45)* +*(generated by convert-ps2md.ps1 using the comment-based help of check-easter-sunday.ps1 as of 11/08/2024 12:34:46)* diff --git a/docs/check-file-system.md b/docs/check-file-system.md index 5a589aef..8591f551 100644 --- a/docs/check-file-system.md +++ b/docs/check-file-system.md @@ -6,7 +6,7 @@ This PowerShell script checks the file system of a drive. It needs admin rights. Parameters ---------- ```powershell -PS> ./check-file-system.ps1 [[-Drive] ] [] +/home/markus/Repos/PowerShell/scripts/check-file-system.ps1 [[-Drive] ] [] -Drive Specifies the drive to check @@ -26,7 +26,7 @@ Example ------- ```powershell PS> ./check-file-system C -βœ”οΈ file system on drive C is clean +βœ… file system on drive C is clean ``` @@ -50,7 +50,7 @@ Script Content Specifies the drive to check .EXAMPLE PS> ./check-file-system C - βœ”οΈ file system on drive C is clean + βœ… file system on drive C is clean .LINK https://github.com/fleschutz/PowerShell .NOTES @@ -75,4 +75,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of check-file-system.ps1 as of 08/15/2024 09:50:45)* +*(generated by convert-ps2md.ps1 using the comment-based help of check-file-system.ps1 as of 11/08/2024 12:34:46)* diff --git a/docs/check-file.md b/docs/check-file.md index c1064837..b1510fe3 100644 --- a/docs/check-file.md +++ b/docs/check-file.md @@ -6,7 +6,7 @@ This PowerShell script determines and prints the file type of the given file. Parameters ---------- ```powershell -PS> ./check-file.ps1 [[-Path] ] [] +/home/markus/Repos/PowerShell/scripts/check-file.ps1 [[-Path] ] [] -Path Specifies the path to the file @@ -170,4 +170,4 @@ function Check-Header { param( $path ) Check-Header $Path ``` -*(generated by convert-ps2md.ps1 using the comment-based help of check-file.ps1 as of 08/15/2024 09:50:45)* +*(generated by convert-ps2md.ps1 using the comment-based help of check-file.ps1 as of 11/08/2024 12:34:46)* diff --git a/docs/check-firewall.md b/docs/check-firewall.md index 6c55694f..7c82f71b 100644 --- a/docs/check-firewall.md +++ b/docs/check-firewall.md @@ -6,7 +6,7 @@ This PowerShell script queries the status of the firewall and prints it. Parameters ---------- ```powershell -PS> ./check-firewall.ps1 [] +/home/markus/Repos/PowerShell/scripts/check-firewall.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -65,4 +65,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of check-firewall.ps1 as of 08/15/2024 09:50:45)* +*(generated by convert-ps2md.ps1 using the comment-based help of check-firewall.ps1 as of 11/08/2024 12:34:46)* diff --git a/docs/check-gpu.md b/docs/check-gpu.md index 96ba8a14..17f71e61 100644 --- a/docs/check-gpu.md +++ b/docs/check-gpu.md @@ -65,4 +65,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of check-gpu.ps1 as of 08/15/2024 09:50:45)* +*(generated by convert-ps2md.ps1 using the comment-based help of check-gpu.ps1 as of 11/08/2024 12:34:46)* diff --git a/docs/check-hardware.md b/docs/check-hardware.md index 757b7595..804a9c4a 100644 --- a/docs/check-hardware.md +++ b/docs/check-hardware.md @@ -6,7 +6,7 @@ This PowerShell script queries the hardware details of the local computer and pr Parameters ---------- ```powershell -PS> ./check-hardware.ps1 [] +/home/markus/Repos/PowerShell/scripts/check-hardware.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -56,6 +56,7 @@ Write-Host "`n H A R D W A R E" -foregroundColor green & "$PSScriptRoot/check-cpu.ps1" & "$PSScriptRoot/check-ram.ps1" & "$PSScriptRoot/check-gpu.ps1" +& "$PSScriptRoot/check-motherboard.ps1" & "$PSScriptRoot/check-bios.ps1" & "$PSScriptRoot/check-smart-devices.ps1" & "$PSScriptRoot/check-power.ps1" @@ -63,4 +64,4 @@ Write-Host "`n H A R D W A R E" -foregroundColor green exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of check-hardware.ps1 as of 08/15/2024 09:50:45)* +*(generated by convert-ps2md.ps1 using the comment-based help of check-hardware.ps1 as of 11/08/2024 12:34:46)* diff --git a/docs/check-health.md b/docs/check-health.md index 9b217e0a..cfbcc72f 100644 --- a/docs/check-health.md +++ b/docs/check-health.md @@ -6,7 +6,7 @@ This PowerShell script queries the system health of the local computer (hardware Parameters ---------- ```powershell -PS> ./check-health.ps1 [] +/home/markus/Repos/PowerShell/scripts/check-health.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -58,4 +58,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of check-health.ps1 as of 08/15/2024 09:50:45)* +*(generated by convert-ps2md.ps1 using the comment-based help of check-health.ps1 as of 11/08/2024 12:34:46)* diff --git a/docs/check-independence-day.md b/docs/check-independence-day.md index 83581be2..8d604bc7 100644 --- a/docs/check-independence-day.md +++ b/docs/check-independence-day.md @@ -6,7 +6,7 @@ This PowerShell script checks the time until Indepence Day and replies by text-t Parameters ---------- ```powershell -PS> ./check-independence-day.ps1 [] +/home/markus/Repos/PowerShell/scripts/check-independence-day.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -61,4 +61,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of check-independence-day.ps1 as of 08/15/2024 09:50:45)* +*(generated by convert-ps2md.ps1 using the comment-based help of check-independence-day.ps1 as of 11/08/2024 12:34:46)* diff --git a/docs/check-ipv4-address.md b/docs/check-ipv4-address.md index 4997abcd..3c09f599 100644 --- a/docs/check-ipv4-address.md +++ b/docs/check-ipv4-address.md @@ -6,7 +6,7 @@ This PowerShell script checks the given IPv4 address for validity. Parameters ---------- ```powershell -PS> ./check-ipv4-address.ps1 [[-Address] ] [] +/home/markus/Repos/PowerShell/scripts/check-ipv4-address.ps1 [[-Address] ] [] -Address Specifies the IPv4 address to check @@ -26,7 +26,7 @@ Example ------- ```powershell PS> ./check-ipv4-address 192.168.11.22 -βœ”οΈ IPv4 192.168.11.22 is valid +βœ… IPv4 192.168.11.22 is valid ``` @@ -50,7 +50,7 @@ Script Content Specifies the IPv4 address to check .EXAMPLE PS> ./check-ipv4-address 192.168.11.22 - βœ”οΈ IPv4 192.168.11.22 is valid + βœ… IPv4 192.168.11.22 is valid .LINK https://github.com/fleschutz/PowerShell .NOTES @@ -72,7 +72,7 @@ try { if ($Address -eq "" ) { $Address = read-host "Enter IPv4 address to validate" } if (IsIPv4AddressValid $Address) { - "βœ”οΈ IPv4 $Address is valid" + "βœ… IPv4 $Address is valid" exit 0 # success } else { write-warning "Invalid IPv4 address: $Address" @@ -84,4 +84,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of check-ipv4-address.ps1 as of 08/15/2024 09:50:45)* +*(generated by convert-ps2md.ps1 using the comment-based help of check-ipv4-address.ps1 as of 11/08/2024 12:34:46)* diff --git a/docs/check-ipv6-address.md b/docs/check-ipv6-address.md index 50d036ed..0a2ce763 100644 --- a/docs/check-ipv6-address.md +++ b/docs/check-ipv6-address.md @@ -6,7 +6,7 @@ This PowerShell script checks the given IPv6 address for validity Parameters ---------- ```powershell -PS> ./check-ipv6-address.ps1 [[-Address] ] [] +/home/markus/Repos/PowerShell/scripts/check-ipv6-address.ps1 [[-Address] ] [] -Address Specifies the IPv6 address to check @@ -26,7 +26,7 @@ Example ------- ```powershell PS> ./check-ipv6-address fe80::200:5aee:feaa:20a2 -βœ”οΈ IPv6 fe80::200:5aee:feaa:20a2 is valid +βœ… IPv6 fe80::200:5aee:feaa:20a2 is valid ``` @@ -50,7 +50,7 @@ Script Content Specifies the IPv6 address to check .EXAMPLE PS> ./check-ipv6-address fe80::200:5aee:feaa:20a2 - βœ”οΈ IPv6 fe80::200:5aee:feaa:20a2 is valid + βœ… IPv6 fe80::200:5aee:feaa:20a2 is valid .LINK https://github.com/fleschutz/PowerShell .NOTES @@ -86,7 +86,7 @@ try { $Address = read-host "Enter IPv6 address to validate" } if (IsIPv6AddressValid $Address) { - "βœ”οΈ IPv6 $Address is valid" + "βœ… IPv6 $Address is valid" exit 0 # success } else { write-warning "Invalid IPv6 address: $Address" @@ -98,4 +98,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of check-ipv6-address.ps1 as of 08/15/2024 09:50:45)* +*(generated by convert-ps2md.ps1 using the comment-based help of check-ipv6-address.ps1 as of 11/08/2024 12:34:46)* diff --git a/docs/check-iss-position.md b/docs/check-iss-position.md index 201e6c9f..4770fa46 100644 --- a/docs/check-iss-position.md +++ b/docs/check-iss-position.md @@ -6,7 +6,7 @@ This PowerShell script queries the position of the International Space Station ( Parameters ---------- ```powershell -PS> ./check-iss-position.ps1 [] +/home/markus/Repos/PowerShell/scripts/check-iss-position.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -55,4 +55,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of check-iss-position.ps1 as of 08/15/2024 09:50:45)* +*(generated by convert-ps2md.ps1 using the comment-based help of check-iss-position.ps1 as of 11/08/2024 12:34:46)* diff --git a/docs/check-mac-address.md b/docs/check-mac-address.md index 6aa49f37..feb5c9ae 100644 --- a/docs/check-mac-address.md +++ b/docs/check-mac-address.md @@ -7,7 +7,7 @@ Supported MAC address formats are: 00:00:00:00:00:00 or 00-00-00-00-00-00 or 000 Parameters ---------- ```powershell -PS> ./check-mac-address.ps1 [[-MAC] ] [] +/home/markus/Repos/PowerShell/scripts/check-mac-address.ps1 [[-MAC] ] [] -MAC Specifies the MAC address to check @@ -27,7 +27,7 @@ Example ------- ```powershell PS> ./check-mac-address 11:22:33:44:55:66 -βœ”οΈ MAC address 11:22:33:44:55:66 is valid +βœ… MAC address 11:22:33:44:55:66 is valid ``` @@ -52,7 +52,7 @@ Script Content Specifies the MAC address to check .EXAMPLE PS> ./check-mac-address 11:22:33:44:55:66 - βœ”οΈ MAC address 11:22:33:44:55:66 is valid + βœ… MAC address 11:22:33:44:55:66 is valid .LINK https://github.com/fleschutz/PowerShell .NOTES @@ -75,7 +75,7 @@ try { $MAC = read-host "Enter MAC address to validate" } if (IsMACAddressValid $MAC) { - "βœ”οΈ MAC address $MAC is valid" + "βœ… MAC address $MAC is valid" exit 0 # success } else { write-warning "Invalid MAC address: $MAC" @@ -87,4 +87,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of check-mac-address.ps1 as of 08/15/2024 09:50:45)* +*(generated by convert-ps2md.ps1 using the comment-based help of check-mac-address.ps1 as of 11/08/2024 12:34:46)* diff --git a/docs/check-midnight.md b/docs/check-midnight.md index 5c5f4ee4..ec772b0d 100644 --- a/docs/check-midnight.md +++ b/docs/check-midnight.md @@ -60,4 +60,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of check-midnight.ps1 as of 08/15/2024 09:50:45)* +*(generated by convert-ps2md.ps1 using the comment-based help of check-midnight.ps1 as of 11/08/2024 12:34:46)* diff --git a/docs/check-month.md b/docs/check-month.md index d50f1ecc..761fe916 100644 --- a/docs/check-month.md +++ b/docs/check-month.md @@ -6,7 +6,7 @@ This PowerShell script determines and speaks the current month name by text-to-s Parameters ---------- ```powershell -PS> ./check-month.ps1 [] +/home/markus/Repos/PowerShell/scripts/check-month.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -17,7 +17,7 @@ Example ------- ```powershell PS> ./check-month -βœ”οΈ It's December. +βœ… It's December. ``` @@ -39,7 +39,7 @@ Script Content This PowerShell script determines and speaks the current month name by text-to-speech (TTS). .EXAMPLE PS> ./check-month - βœ”οΈ It's December. + βœ… It's December. .LINK https://github.com/fleschutz/PowerShell .NOTES @@ -57,4 +57,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of check-month.ps1 as of 08/15/2024 09:50:45)* +*(generated by convert-ps2md.ps1 using the comment-based help of check-month.ps1 as of 11/08/2024 12:34:47)* diff --git a/docs/check-moon-phase.md b/docs/check-moon-phase.md index 2125b099..abf6609f 100644 --- a/docs/check-moon-phase.md +++ b/docs/check-moon-phase.md @@ -6,7 +6,7 @@ This PowerShell script determines the Moon phase and answers by text-to-speech ( Parameters ---------- ```powershell -PS> ./check-moon-phase.ps1 [] +/home/markus/Repos/PowerShell/scripts/check-moon-phase.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -76,4 +76,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of check-moon-phase.ps1 as of 08/15/2024 09:50:45)* +*(generated by convert-ps2md.ps1 using the comment-based help of check-moon-phase.ps1 as of 11/08/2024 12:34:47)* diff --git a/docs/check-motherboard.md b/docs/check-motherboard.md new file mode 100644 index 00000000..5ac5bb7e --- /dev/null +++ b/docs/check-motherboard.md @@ -0,0 +1,62 @@ +Script: *check-motherboard.ps1* +======================== + +This PowerShell script lists the motherboard details. + +Parameters +---------- +```powershell +/home/markus/Repos/PowerShell/scripts/check-motherboard.ps1 [] + +[] + This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, + WarningVariable, OutBuffer, PipelineVariable, and OutVariable. +``` + +Example +------- +```powershell +PS> ./check-motherboard.ps1 +βœ… Motherboard Calla_LC by LN + +``` + +Notes +----- +Author: Markus Fleschutz | License: CC0 + +Related Links +------------- +https://github.com/fleschutz/PowerShell + +Script Content +-------------- +```powershell +<# +.SYNOPSIS + Lists motherboard details +.DESCRIPTION + This PowerShell script lists the motherboard details. +.EXAMPLE + PS> ./check-motherboard.ps1 + βœ… Motherboard Calla_LC by LN +.LINK + https://github.com/fleschutz/PowerShell +.NOTES + Author: Markus Fleschutz | License: CC0 +#> + +try { + if ($IsLinux) { + } else { + $details = Get-WmiObject -Class Win32_BaseBoard + "βœ… Motherboard $($details.Product) by $($details.Manufacturer)" + } + exit 0 # success +} catch { + "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" + exit 1 +} +``` + +*(generated by convert-ps2md.ps1 using the comment-based help of check-motherboard.ps1 as of 11/08/2024 12:34:47)* diff --git a/docs/check-network.md b/docs/check-network.md index bfe1b072..481b09ef 100644 --- a/docs/check-network.md +++ b/docs/check-network.md @@ -6,7 +6,7 @@ This PowerShell script queries the network details of the local computer and pri Parameters ---------- ```powershell -PS> ./check-network.ps1 [] +/home/markus/Repos/PowerShell/scripts/check-network.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -21,7 +21,7 @@ PS> ./check-network.ps1 N E T W O R K -βœ… Online with 30ms latency (16ms..56ms, 0/10 loss) +βœ… Firewall enabled ... ``` @@ -39,14 +39,14 @@ Script Content ```powershell <# .SYNOPSIS - Checks the network details + Checks the network .DESCRIPTION This PowerShell script queries the network details of the local computer and prints it. .EXAMPLE PS> ./check-network.ps1 - N E T W O R K - βœ… Online with 30ms latency (16ms..56ms, 0/10 loss) + N E T W O R K + βœ… Firewall enabled ... .LINK https://github.com/fleschutz/PowerShell @@ -55,13 +55,16 @@ Script Content #> Write-Host "`n N E T W O R K" -foregroundColor green -& "$PSScriptRoot/list-ip-addresses.ps1" -& "$PSScriptRoot/ping-remote-hosts.ps1" & "$PSScriptRoot/check-firewall" -& "$PSScriptRoot/check-dns.ps1" +& "$PSScriptRoot/list-local-ip.ps1" +& "$PSScriptRoot/list-network-shares.ps1" +& "$PSScriptRoot/ping-local-devices.ps1" & "$PSScriptRoot/check-vpn.ps1" -& "$PSScriptRoot/ping-local-hosts.ps1" +& "$PSScriptRoot/list-internet-ip.ps1" +& "$PSScriptRoot/ping-internet.ps1" +& "$PSScriptRoot/check-dns.ps1" +& "$PSScriptRoot/list-ssh-key.ps1" exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of check-network.ps1 as of 08/15/2024 09:50:45)* +*(generated by convert-ps2md.ps1 using the comment-based help of check-network.ps1 as of 11/08/2024 12:34:47)* diff --git a/docs/check-noon.md b/docs/check-noon.md index bf4d6121..ee25536c 100644 --- a/docs/check-noon.md +++ b/docs/check-noon.md @@ -59,4 +59,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of check-noon.ps1 as of 08/15/2024 09:50:46)* +*(generated by convert-ps2md.ps1 using the comment-based help of check-noon.ps1 as of 11/08/2024 12:34:47)* diff --git a/docs/check-os.md b/docs/check-os.md index 021c8bc9..41f65f8d 100644 --- a/docs/check-os.md +++ b/docs/check-os.md @@ -6,7 +6,7 @@ This PowerShell script queries the operating system status and prints it. Parameters ---------- ```powershell -PS> ./check-os.ps1 [] +/home/markus/Repos/PowerShell/scripts/check-os.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -17,7 +17,7 @@ Example ------- ```powershell PS> ./check-os.ps1 -βœ… Windows 10 Pro 64-bit (v10.0.19045, since 6/22/2021, S/N 00123-45678-15135-AAOEM, P/K AB123-CD456-EF789-GH000-WFR6P) +βœ… Windows 10 Pro 64-bit since 6/22/2021 (v10.0.19045, S/N 00123-45678-15135-AAOEM, P/K AB123-CD456-EF789-GH000-WFR6P) ``` @@ -39,7 +39,7 @@ Script Content This PowerShell script queries the operating system status and prints it. .EXAMPLE PS> ./check-os.ps1 - βœ… Windows 10 Pro 64-bit (v10.0.19045, since 6/22/2021, S/N 00123-45678-15135-AAOEM, P/K AB123-CD456-EF789-GH000-WFR6P) + βœ… Windows 10 Pro 64-bit since 6/22/2021 (v10.0.19045, S/N 00123-45678-15135-AAOEM, P/K AB123-CD456-EF789-GH000-WFR6P) .LINK https://github.com/fleschutz/PowerShell .NOTES @@ -64,7 +64,7 @@ try { $InstallDate = $OSDetails.InstallDate $ProductKey = (Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" -Name BackupProductKeyDefault).BackupProductKeyDefault - Write-Host "βœ… $Name $Arch (v$Version, since $($InstallDate.ToShortDateString()), S/N $Serial, P/K $ProductKey)" + Write-Host "βœ… $Name $Arch since $($InstallDate.ToShortDateString()) (v$Version, S/N $Serial, P/K $ProductKey)" } exit 0 # success } catch { @@ -73,4 +73,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of check-os.ps1 as of 08/15/2024 09:50:46)* +*(generated by convert-ps2md.ps1 using the comment-based help of check-os.ps1 as of 11/08/2024 12:34:47)* diff --git a/docs/check-outlook.md b/docs/check-outlook.md index a8ca2741..815d5a5b 100644 --- a/docs/check-outlook.md +++ b/docs/check-outlook.md @@ -6,7 +6,7 @@ This PowerShell script checks the inbox of Outlook for new/unread mails. Parameters ---------- ```powershell -PS> ./check-outlook.ps1 [] +/home/markus/Repos/PowerShell/scripts/check-outlook.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -65,4 +65,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of check-outlook.ps1 as of 08/15/2024 09:50:46)* +*(generated by convert-ps2md.ps1 using the comment-based help of check-outlook.ps1 as of 11/08/2024 12:34:47)* diff --git a/docs/check-password.md b/docs/check-password.md index 610be986..6939e017 100644 --- a/docs/check-password.md +++ b/docs/check-password.md @@ -6,7 +6,7 @@ This PowerShell script checks the security status of the given password by havei Parameters ---------- ```powershell -PS> ./check-password.ps1 [[-password] ] [] +/home/markus/Repos/PowerShell/scripts/check-password.ps1 [[-password] ] [] -password @@ -94,4 +94,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of check-password.ps1 as of 08/15/2024 09:50:46)* +*(generated by convert-ps2md.ps1 using the comment-based help of check-password.ps1 as of 11/08/2024 12:34:47)* diff --git a/docs/check-pending-reboot.md b/docs/check-pending-reboot.md index 8edb38f0..9d340714 100644 --- a/docs/check-pending-reboot.md +++ b/docs/check-pending-reboot.md @@ -41,50 +41,48 @@ function Test-RegistryValue { param([parameter(Mandatory=$true)][ValidateNotNull } try { - $Reason = "" + $reply = "βœ… No pending reboot" if ($IsLinux) { if (Test-Path "/var/run/reboot-required") { - $Reason = "found: /var/run/reboot-required" - Write-Host "⚠️ Pending reboot ($Reason)" + $reply = "⚠️ Pending reboot (found: /var/run/reboot-required)" } } else { + $reason = "" if (Test-Path -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\RebootRequired") { - $Reason += ", ...\Auto Update\RebootRequired" + $reason += ", ...\Auto Update\RebootRequired" } if (Test-Path -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\PostRebootReporting") { - $Reason += ", ...\Auto Update\PostRebootReporting" + $reason += ", ...\Auto Update\PostRebootReporting" } if (Test-Path -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\RebootPending") { - $Reason += ", ...\Component Based Servicing\RebootPending" + $reason += ", ...\Component Based Servicing\RebootPending" } if (Test-Path -Path "HKLM:\SOFTWARE\Microsoft\ServerManager\CurrentRebootAttempts") { - $Reason += ", ...\ServerManager\CurrentRebootAttempts" + $reason += ", ...\ServerManager\CurrentRebootAttempts" } if (Test-RegistryValue -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Component Based Servicing" -Value "RebootInProgress") { - $Reason += ", ...\CurrentVersion\Component Based Servicing with 'RebootInProgress'" + $reason += ", ...\CurrentVersion\Component Based Servicing with 'RebootInProgress'" } if (Test-RegistryValue -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Component Based Servicing" -Value "PackagesPending") { - $Reason += ", '...\CurrentVersion\Component Based Servicing' with 'PackagesPending'" + $reason += ", '...\CurrentVersion\Component Based Servicing' with 'PackagesPending'" } if (Test-RegistryValue -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager" -Value "PendingFileRenameOperations2") { - $Reason += ", '...\CurrentControlSet\Control\Session Manager' with 'PendingFileRenameOperations2'" + $reason += ", '...\CurrentControlSet\Control\Session Manager' with 'PendingFileRenameOperations2'" } if (Test-RegistryValue -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce" -Value "DVDRebootSignal") { - $Reason += ", '...\Windows\CurrentVersion\RunOnce' with 'DVDRebootSignal'" + $reason += ", '...\Windows\CurrentVersion\RunOnce' with 'DVDRebootSignal'" } if (Test-RegistryValue -Path "HKLM:\SYSTEM\CurrentControlSet\Services\Netlogon" -Value "JoinDomain") { - $Reason += ", '...\CurrentControlSet\Services\Netlogon' with 'JoinDomain'" + $reason += ", '...\CurrentControlSet\Services\Netlogon' with 'JoinDomain'" } if (Test-RegistryValue -Path "HKLM:\SYSTEM\CurrentControlSet\Services\Netlogon" -Value "AvoidSpnSet") { - $Reason += ", '...\CurrentControlSet\Services\Netlogon' with 'AvoidSpnSet'" + $reason += ", '...\CurrentControlSet\Services\Netlogon' with 'AvoidSpnSet'" } - if ($Reason -ne "") { - Write-Host "⚠️ Pending reboot (registry got $($Reason.substring(2)))" + if ($reason -ne "") { + $reply = "⚠️ Pending reboot (registry got $($reason.substring(2)))" } } - if ($Reason -eq "") { - Write-Host "βœ… No pending reboot" - } + Write-Host $reply exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -92,4 +90,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of check-pending-reboot.ps1 as of 08/15/2024 09:50:46)* +*(generated by convert-ps2md.ps1 using the comment-based help of check-pending-reboot.ps1 as of 11/08/2024 12:34:47)* diff --git a/docs/check-pnp-devices.md b/docs/check-pnp-devices.md index 698e94c4..7dd69442 100644 --- a/docs/check-pnp-devices.md +++ b/docs/check-pnp-devices.md @@ -6,7 +6,7 @@ This PowerShell script checks all Plug'n'PLay devices connected to the local com Parameters ---------- ```powershell -PS> ./check-pnp-devices.ps1 [] +/home/markus/Repos/PowerShell/scripts/check-pnp-devices.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -65,4 +65,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of check-pnp-devices.ps1 as of 08/15/2024 09:50:46)* +*(generated by convert-ps2md.ps1 using the comment-based help of check-pnp-devices.ps1 as of 11/08/2024 12:34:47)* diff --git a/docs/check-power.md b/docs/check-power.md index e3ffc8ee..fa28787d 100644 --- a/docs/check-power.md +++ b/docs/check-power.md @@ -6,7 +6,7 @@ This PowerShell script queries the power status and prints it. Parameters ---------- ```powershell -PS> ./check-power.ps1 [] +/home/markus/Repos/PowerShell/scripts/check-power.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -17,7 +17,7 @@ Example ------- ```powershell PS> ./check-power.ps1 -⚠️ Battery at 9% with 54min remaining Β· power scheme 'HP Optimized' +⚠️ Battery 9% only with 54min remaining (power scheme is 'HP Optimized') ``` @@ -39,7 +39,7 @@ Script Content This PowerShell script queries the power status and prints it. .EXAMPLE PS> ./check-power.ps1 - ⚠️ Battery at 9% with 54min remaining Β· power scheme 'HP Optimized' + ⚠️ Battery 9% only with 54min remaining (power scheme is 'HP Optimized') .LINK https://github.com/fleschutz/PowerShell .NOTES @@ -54,35 +54,34 @@ try { $details = [System.Windows.Forms.SystemInformation]::PowerStatus [int]$percent = 100 * $details.BatteryLifePercent [int]$remaining = $details.BatteryLifeRemaining / 60 + $powerScheme = (powercfg /getactivescheme) + $powerScheme = $powerScheme -Replace "^(.*) \(","" + $powerScheme = $powerScheme -Replace "\)$","" if ($details.PowerLineStatus -eq "Online") { if ($details.BatteryChargeStatus -eq "NoSystemBattery") { $reply = "βœ… AC powered" } elseif ($percent -ge 95) { - $reply = "βœ… Battery $percent% full" + $reply = "βœ… Battery nearly full ($percent%, power scheme is '$powerScheme')" } else { - $reply = "βœ… Battery charging ($percent%)" + $reply = "βœ… Battery $percent% and charging (power scheme is '$powerScheme')" } } else { # must be offline if (($remaining -eq 0) -and ($percent -ge 60)) { - $reply = "βœ… Battery $percent% full" + $reply = "βœ… Battery $percent% full (power scheme is '$powerScheme')" } elseif ($remaining -eq 0) { - $reply = "βœ… Battery at $percent%" + $reply = "βœ… Battery at $percent% (power scheme is '$powerScheme')" } elseif ($remaining -le 5) { - $reply = "⚠️ Battery at $percent% with ONLY $($remaining)min remaining" + $reply = "⚠️ Battery $percent% ONLY $($remaining)min remaining (power scheme is '$powerScheme')" } elseif ($remaining -le 30) { - $reply = "⚠️ Battery at $percent% with only $($remaining)min remaining" + $reply = "⚠️ Battery $percent% only $($remaining)min remaining (power scheme is '$powerScheme')" } elseif ($percent -lt 10) { - $reply = "⚠️ Battery at $percent% with $($remaining)min remaining" - } elseif ($percent -ge 80) { - $reply = "βœ… Battery $percent% full with $($remaining)min remaining" + $reply = "⚠️ Battery $percent% only with $($remaining)min remaining (power scheme is '$powerScheme') " + } elseif ($percent -ge 90) { + $reply = "βœ… Battery $percent% full with $($remaining)min remaining (power scheme is '$powerScheme')" } else { - $reply = "βœ… Battery at $percent% with $($remaining)min remaining" + $reply = "βœ… Battery $percent% with $($remaining)min remaining (power scheme is '$powerScheme') " } } - $powerScheme = (powercfg /getactivescheme) - $powerScheme = $powerScheme -Replace "^(.*) \(","" - $powerScheme = $powerScheme -Replace "\)$","" - $reply += ", power scheme is '$powerScheme'" } Write-Host $reply exit 0 # success @@ -92,4 +91,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of check-power.ps1 as of 08/15/2024 09:50:46)* +*(generated by convert-ps2md.ps1 using the comment-based help of check-power.ps1 as of 11/08/2024 12:34:47)* diff --git a/docs/check-powershell.md b/docs/check-powershell.md index 195836a0..2029e8eb 100644 --- a/docs/check-powershell.md +++ b/docs/check-powershell.md @@ -59,4 +59,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of check-powershell.ps1 as of 08/15/2024 09:50:46)* +*(generated by convert-ps2md.ps1 using the comment-based help of check-powershell.ps1 as of 11/08/2024 12:34:47)* diff --git a/docs/check-ps1-file.md b/docs/check-ps1-file.md index d178c323..67df3d97 100644 --- a/docs/check-ps1-file.md +++ b/docs/check-ps1-file.md @@ -6,7 +6,7 @@ This PowerShell script checks the given PowerShell script file(s) for validity. Parameters ---------- ```powershell -PS> ./check-ps1-file.ps1 [[-filePattern] ] [] +/home/markus/Repos/PowerShell/scripts/check-ps1-file.ps1 [[-filePattern] ] [] -filePattern Specifies the file pattern to the PowerShell file(s) @@ -26,7 +26,7 @@ Example ------- ```powershell PS> ./check-ps1-file *.ps1 -βœ”οΈ Valid PowerShell in myfile.ps1 +βœ… Valid PowerShell in myfile.ps1 ``` @@ -50,7 +50,7 @@ Script Content Specifies the file pattern to the PowerShell file(s) .EXAMPLE PS> ./check-ps1-file *.ps1 - βœ”οΈ Valid PowerShell in myfile.ps1 + βœ… Valid PowerShell in myfile.ps1 .LINK https://github.com/fleschutz/PowerShell .NOTES @@ -67,7 +67,7 @@ try { $syntaxError = @() [void][System.Management.Automation.Language.Parser]::ParseFile($file, [ref]$null, [ref]$syntaxError) if ("$syntaxError" -ne "") { throw "$syntaxError" } - "βœ”οΈ Valid PowerShell in $($file.Name)" + "βœ… Valid PowerShell in $($file.Name)" } exit 0 # success } catch { @@ -76,4 +76,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of check-ps1-file.ps1 as of 08/15/2024 09:50:46)* +*(generated by convert-ps2md.ps1 using the comment-based help of check-ps1-file.ps1 as of 11/08/2024 12:34:47)* diff --git a/docs/check-ram.md b/docs/check-ram.md index 57b2324f..17873cd8 100644 --- a/docs/check-ram.md +++ b/docs/check-ram.md @@ -98,4 +98,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of check-ram.ps1 as of 08/15/2024 09:50:46)* +*(generated by convert-ps2md.ps1 using the comment-based help of check-ram.ps1 as of 11/08/2024 12:34:47)* diff --git a/docs/check-repo.md b/docs/check-repo.md index a365f130..38cc1e57 100644 --- a/docs/check-repo.md +++ b/docs/check-repo.md @@ -6,7 +6,7 @@ This PowerShell script verifies the integrity of a local Git repository and perf Parameters ---------- ```powershell -PS> ./check-repo.ps1 [[-pathToRepo] ] [] +/home/markus/Repos/PowerShell/scripts/check-repo.ps1 [[-pathToRepo] ] [] -pathToRepo Specifies the file path to the local Git repository (current working directory by default) @@ -121,7 +121,7 @@ try { $repoDirName = (Get-Item "$FullPath").Name [int]$elapsed = $stopWatch.Elapsed.TotalSeconds - "βœ”οΈ Checked πŸ“‚$repoDirName repo in $($elapsed)s." + "βœ… Checked πŸ“‚$repoDirName repo in $($elapsed)s." exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -129,4 +129,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of check-repo.ps1 as of 08/15/2024 09:50:46)* +*(generated by convert-ps2md.ps1 using the comment-based help of check-repo.ps1 as of 11/08/2024 12:34:47)* diff --git a/docs/check-repos.md b/docs/check-repos.md index 4624f5c6..aede6e66 100644 --- a/docs/check-repos.md +++ b/docs/check-repos.md @@ -6,7 +6,7 @@ This PowerShell script verifies the data integrity of all Git repositories in a Parameters ---------- ```powershell -PS> ./check-repos.ps1 [[-parentDir] ] [] +/home/markus/Repos/PowerShell/scripts/check-repos.ps1 [[-parentDir] ] [] -parentDir Specifies the file path to the parent folder @@ -29,7 +29,7 @@ PS> ./check-repos.ps1 C:\Repos ⏳ Checking parent folder πŸ“‚C:\Repos... 16 subfolders ⏳ Checking πŸ“‚rust repository (1/16)... ... -βœ”οΈ Checked all 16 Git repos in πŸ“‚C:\Repos in 356s. +βœ… Checked all 16 Git repos in πŸ“‚C:\Repos in 356s. ``` @@ -56,7 +56,7 @@ Script Content ⏳ Checking parent folder πŸ“‚C:\Repos... 16 subfolders ⏳ Checking πŸ“‚rust repository (1/16)... ... - βœ”οΈ Checked all 16 Git repos in πŸ“‚C:\Repos in 356s. + βœ… Checked all 16 Git repos in πŸ“‚C:\Repos in 356s. .LINK https://github.com/fleschutz/PowerShell .NOTES @@ -83,7 +83,7 @@ try { } [int]$elapsed = $stopWatch.Elapsed.TotalSeconds - "βœ”οΈ Checked all $numFolders Git repos in πŸ“‚$parentDir in $($elapsed)s." + "βœ… Checked all $numFolders Git repos in πŸ“‚$parentDir in $($elapsed)s." exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -91,4 +91,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of check-repos.ps1 as of 08/15/2024 09:50:46)* +*(generated by convert-ps2md.ps1 using the comment-based help of check-repos.ps1 as of 11/08/2024 12:34:47)* diff --git a/docs/check-santa.md b/docs/check-santa.md index 9faef17b..1b74cb9d 100644 --- a/docs/check-santa.md +++ b/docs/check-santa.md @@ -6,7 +6,7 @@ This PowerShell script checks the time until Saint Nicholas Day and replies by t Parameters ---------- ```powershell -PS> ./check-santa.ps1 [] +/home/markus/Repos/PowerShell/scripts/check-santa.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -56,4 +56,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of check-santa.ps1 as of 08/15/2024 09:50:46)* +*(generated by convert-ps2md.ps1 using the comment-based help of check-santa.ps1 as of 11/08/2024 12:34:47)* diff --git a/docs/check-smart-devices.md b/docs/check-smart-devices.md index a683d926..c61bcc4d 100644 --- a/docs/check-smart-devices.md +++ b/docs/check-smart-devices.md @@ -24,7 +24,7 @@ Script Content This PowerShell script queries the status of the SSD/HDD devices (supporting S.M.A.R.T.) and prints it. .EXAMPLE PS> ./check-smart-devices.ps1 - βœ… 1TB Samsung SSD 970 EVO via NVMe (37Β°C, 2388 hours, 289x on/off, v2B2QEXE7) - selftest OK + βœ… 1TB Samsung SSD 970 EVO via NVMe (37Β°C, 2388 hours, 289x on/off, v2B2QEXE7, test passed) .LINK https://github.com/fleschutz/PowerShell .NOTES @@ -82,7 +82,10 @@ try { $capacity = "" } if ($details.temperature.current -gt 50) { - $temp = "$($details.temperature.current)Β°C (!)" + $temp = "$($details.temperature.current)Β°C TOO HOT" + $status = "⚠️" + } elseif ($details.temperature.current -lt 0) { + $temp = "$($details.temperature.current)Β°C TOO COLD" $status = "⚠️" } else { $temp = "$($details.temperature.current)Β°C" @@ -100,13 +103,13 @@ try { $powerOn = "$($details.power_cycle_count)x on/off" } if ($details.smart_status.passed) { - $selftest = "selftest OK" + $selftest = "test passed" } else { - $selftest = "selftest FAILED" + $selftest = "test FAILED" $status = "⚠️" } $firmwareVersion = $details.firmware_version - Write-Host "$status $capacity$modelName via $protocol ($temp, $hours, $powerOn, v$firmwareVersion) - $selftest" + Write-Host "$status $capacity$modelName via $protocol ($temp, $hours, $powerOn, v$firmwareVersion, $selftest)" } #Write-Progress -completed "Done." exit 0 # success @@ -116,4 +119,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of check-smart-devices.ps1 as of 08/15/2024 09:50:46)* +*(generated by convert-ps2md.ps1 using the comment-based help of check-smart-devices.ps1 as of 11/08/2024 12:34:47)* diff --git a/docs/check-software.md b/docs/check-software.md index 094e0baf..9cf68faa 100644 --- a/docs/check-software.md +++ b/docs/check-software.md @@ -6,7 +6,7 @@ This PowerShell script queries the software status of the local computer and pri Parameters ---------- ```powershell -PS> ./check-software.ps1 [] +/home/markus/Repos/PowerShell/scripts/check-software.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -61,8 +61,7 @@ Write-Host "`n S O F T W A R E" -foregroundColor green & "$PSScriptRoot/check-powershell.ps1" & "$PSScriptRoot/check-time-zone.ps1" & "$PSScriptRoot/check-swap-space.ps1" -& "$PSScriptRoot/check-pending-reboot.ps1" exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of check-software.ps1 as of 08/15/2024 09:50:46)* +*(generated by convert-ps2md.ps1 using the comment-based help of check-software.ps1 as of 11/08/2024 12:34:47)* diff --git a/docs/check-subnet-mask.md b/docs/check-subnet-mask.md index d5e8935a..c4e7288b 100644 --- a/docs/check-subnet-mask.md +++ b/docs/check-subnet-mask.md @@ -6,7 +6,7 @@ This PowerShell script checks the given subnet mask for validity. Parameters ---------- ```powershell -PS> ./check-subnet-mask.ps1 [[-address] ] [] +/home/markus/Repos/PowerShell/scripts/check-subnet-mask.ps1 [[-address] ] [] -address Specifies the subnet mask to check @@ -26,7 +26,7 @@ Example ------- ```powershell PS> ./check-subnet-mask.ps1 255.255.255.0 -βœ”οΈ subnet mask 255.255.255.0 is valid +βœ… subnet mask 255.255.255.0 is valid ``` @@ -50,7 +50,7 @@ Script Content Specifies the subnet mask to check .EXAMPLE PS> ./check-subnet-mask.ps1 255.255.255.0 - βœ”οΈ subnet mask 255.255.255.0 is valid + βœ… subnet mask 255.255.255.0 is valid .LINK https://github.com/fleschutz/PowerShell .NOTES @@ -72,7 +72,7 @@ try { if ($address -eq "" ) { $address = read-host "Enter subnet mask to validate" } if (IsSubNetMaskValid $address) { - "βœ”οΈ subnet mask $Address is valid" + "βœ… subnet mask $Address is valid" exit 0 # success } else { write-warning "Invalid subnet mask: $address" @@ -84,4 +84,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of check-subnet-mask.ps1 as of 08/15/2024 09:50:46)* +*(generated by convert-ps2md.ps1 using the comment-based help of check-subnet-mask.ps1 as of 11/08/2024 12:34:47)* diff --git a/docs/check-swap-space.md b/docs/check-swap-space.md index 5bb4585d..fb0bc7af 100644 --- a/docs/check-swap-space.md +++ b/docs/check-swap-space.md @@ -6,7 +6,7 @@ This PowerShell script queries the current status of the swap space and prints i Parameters ---------- ```powershell -PS> ./check-swap-space.ps1 [[-minLevel] ] [] +/home/markus/Repos/PowerShell/scripts/check-swap-space.ps1 [[-minLevel] ] [] -minLevel Specifies the minimum level in MB (10 MB by default) @@ -26,7 +26,7 @@ Example ------- ```powershell PS> ./check-swap-space.ps1 -βœ… Swap space uses 21% of 1GB - 1005MB free +βœ… Swap space uses 1GB (21%) of 5GB ``` @@ -50,7 +50,7 @@ Script Content Specifies the minimum level in MB (10 MB by default) .EXAMPLE PS> ./check-swap-space.ps1 - βœ… Swap space uses 21% of 1GB - 1005MB free + βœ… Swap space uses 1GB (21%) of 5GB .LINK https://github.com/fleschutz/PowerShell .NOTES @@ -91,14 +91,14 @@ try { if ($total -eq 0) { Write-Output "⚠️ No swap space configured" } elseif ($free -eq 0) { - Write-Output "⚠️ Swap space of $(MB2String $total) is full" + Write-Output "⚠️ Swap space with $(MB2String $total) is FULL !!!" } elseif ($free -lt $minLevel) { - Write-Output "⚠️ Swap space has only $(MB2String $free) of $(MB2String $total) free" + Write-Output "⚠️ Swap space has only $(MB2String $free) of $(MB2String $total) left!" } elseif ($used -lt 3) { - Write-Output "βœ… Swap space unused - full $(MB2String $free) free" + Write-Output "βœ… Swap space has $(MB2String $total) reserved" } else { [int64]$percent = ($used * 100) / $total - Write-Output "βœ… Swap space at $percent% of $(MB2String $total) - $(MB2String $free) free" + Write-Output "βœ… Swap space uses $(MB2String $used) ($percent%) of $(MB2String $total)" } exit 0 # success } catch { @@ -107,4 +107,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of check-swap-space.ps1 as of 08/15/2024 09:50:46)* +*(generated by convert-ps2md.ps1 using the comment-based help of check-swap-space.ps1 as of 11/08/2024 12:34:47)* diff --git a/docs/check-symlinks.md b/docs/check-symlinks.md index ccbd7d8d..b40f8799 100644 --- a/docs/check-symlinks.md +++ b/docs/check-symlinks.md @@ -7,7 +7,7 @@ It returns the number of broken symlinks as exit value. Parameters ---------- ```powershell -PS> ./check-symlinks.ps1 [[-Folder] ] [] +/home/markus/Repos/PowerShell/scripts/check-symlinks.ps1 [[-Folder] ] [] -Folder Specifies the path to the folder @@ -28,7 +28,7 @@ Example ```powershell PS> ./check-symlinks C:\Users ⏳ Checking symlinks at πŸ“‚C:\Users including subfolders... -βœ”οΈ Found 0 broken symlinks at πŸ“‚C:\Users in 60 sec +βœ… Found 0 broken symlinks at πŸ“‚C:\Users in 60 sec ``` @@ -54,7 +54,7 @@ Script Content .EXAMPLE PS> ./check-symlinks C:\Users ⏳ Checking symlinks at πŸ“‚C:\Users including subfolders... - βœ”οΈ Found 0 broken symlinks at πŸ“‚C:\Users in 60 sec + βœ… Found 0 broken symlinks at πŸ“‚C:\Users in 60 sec .LINK https://github.com/fleschutz/PowerShell .NOTES @@ -87,11 +87,11 @@ try { [int]$Elapsed = $StopWatch.Elapsed.TotalSeconds if ($NumTotal -eq 0) { - "βœ”οΈ No symlink found at πŸ“‚$FullPath in $Elapsed sec" + "βœ… No symlink found at πŸ“‚$FullPath in $Elapsed sec" } elseif ($NumBroken -eq 1) { - "βœ”οΈ Found $NumBroken broken symlink at πŸ“‚$FullPath in $Elapsed sec" + "βœ… Found $NumBroken broken symlink at πŸ“‚$FullPath in $Elapsed sec" } else { - "βœ”οΈ Found $NumBroken broken symlinks at πŸ“‚$FullPath in $Elapsed sec" + "βœ… Found $NumBroken broken symlinks at πŸ“‚$FullPath in $Elapsed sec" } exit $NumBroken } catch { @@ -100,4 +100,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of check-symlinks.ps1 as of 08/15/2024 09:50:46)* +*(generated by convert-ps2md.ps1 using the comment-based help of check-symlinks.ps1 as of 11/08/2024 12:34:47)* diff --git a/docs/check-time-zone.md b/docs/check-time-zone.md index 879fc4e1..3faede13 100644 --- a/docs/check-time-zone.md +++ b/docs/check-time-zone.md @@ -6,7 +6,7 @@ This PowerShell script queries the local time zone and prints it. Parameters ---------- ```powershell -PS> ./check-time-zone.ps1 [] +/home/markus/Repos/PowerShell/scripts/check-time-zone.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -17,7 +17,7 @@ Example ------- ```powershell PS> ./check-time-zone.ps1 -βœ… 3:27 PM in W. Europe Summer Time (UTC+01:00:00 +1h DST) +βœ… 3:27 PM West Europe Summer Time (UTC+01:00:00 +1h DST) ``` @@ -39,7 +39,7 @@ Script Content This PowerShell script queries the local time zone and prints it. .EXAMPLE PS> ./check-time-zone.ps1 - βœ… 3:27 PM in W. Europe Summer Time (UTC+01:00:00 +1h DST) + βœ… 3:27 PM West Europe Summer Time (UTC+01:00:00 +1h DST) .LINK https://github.com/fleschutz/PowerShell .NOTES @@ -58,7 +58,7 @@ try { $TZName = $TZ.StandardName $DST="" } - Write-Host "βœ… $Time in $TZName (UTC+$($offset)$($DST))" + Write-Host "βœ… $Time $TZName (UTC+$($offset)$($DST))" exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -66,4 +66,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of check-time-zone.ps1 as of 08/15/2024 09:50:46)* +*(generated by convert-ps2md.ps1 using the comment-based help of check-time-zone.ps1 as of 11/08/2024 12:34:47)* diff --git a/docs/check-uptime.md b/docs/check-uptime.md index 5ab5f6a6..cc26c59f 100644 --- a/docs/check-uptime.md +++ b/docs/check-uptime.md @@ -44,6 +44,15 @@ function TimeSpanAsString([TimeSpan]$uptime) } } +function Test-RegistryValue { param([parameter(Mandatory=$true)][ValidateNotNullOrEmpty()]$Path, [parameter(Mandatory=$true)] [ValidateNotNullOrEmpty()]$Value) + try { + Get-ItemProperty -Path $Path -Name $Value -EA Stop + return $true + } catch { + return $false + } +} + try { [system.threading.thread]::currentthread.currentculture = [system.globalization.cultureinfo]"en-US" if ($IsLinux) { @@ -53,7 +62,51 @@ try { $lastBootTime = (Get-CimInstance Win32_OperatingSystem).LastBootUpTime $uptime = New-TimeSpan -Start $lastBootTime -End (Get-Date) } - Write-Host "βœ… $(hostname) is up for $(TimeSpanAsString $uptime) since $($lastBootTime.ToShortDateString())" + $status = "βœ…" + $pending = "" + if ($IsLinux) { + if (Test-Path "/var/run/reboot-required") { + $status = "⚠️" + $pending = "with pending reboot (found /var/run/reboot-required)" + } + } else { + $reason = "" + if (Test-Path -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\RebootRequired") { + $reason += ", ...\Auto Update\RebootRequired" + } + if (Test-Path -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\PostRebootReporting") { + $reason += ", ...\Auto Update\PostRebootReporting" + } + if (Test-Path -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\RebootPending") { + $reason += ", ...\Component Based Servicing\RebootPending" + } + if (Test-Path -Path "HKLM:\SOFTWARE\Microsoft\ServerManager\CurrentRebootAttempts") { + $reason += ", ...\ServerManager\CurrentRebootAttempts" + } + if (Test-RegistryValue -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Component Based Servicing" -Value "RebootInProgress") { + $reason += ", ...\CurrentVersion\Component Based Servicing with 'RebootInProgress'" + } + if (Test-RegistryValue -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Component Based Servicing" -Value "PackagesPending") { + $reason += ", '...\CurrentVersion\Component Based Servicing' with 'PackagesPending'" + } + if (Test-RegistryValue -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager" -Value "PendingFileRenameOperations2") { + $reason += ", '...\CurrentControlSet\Control\Session Manager' with 'PendingFileRenameOperations2'" + } + if (Test-RegistryValue -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce" -Value "DVDRebootSignal") { + $reason += ", '...\Windows\CurrentVersion\RunOnce' with 'DVDRebootSignal'" + } + if (Test-RegistryValue -Path "HKLM:\SYSTEM\CurrentControlSet\Services\Netlogon" -Value "JoinDomain") { + $reason += ", '...\CurrentControlSet\Services\Netlogon' with 'JoinDomain'" + } + if (Test-RegistryValue -Path "HKLM:\SYSTEM\CurrentControlSet\Services\Netlogon" -Value "AvoidSpnSet") { + $reason += ", '...\CurrentControlSet\Services\Netlogon' with 'AvoidSpnSet'" + } + if ($reason -ne "") { + $status = "⚠️" + $pending = "with pending reboot ($($reason.substring(2)) in registry)" + } + } + Write-Host "$status $(hostname) is up for $(TimeSpanAsString $uptime) since $($lastBootTime.ToShortDateString()) $pending" exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -61,4 +114,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of check-uptime.ps1 as of 08/15/2024 09:50:46)* +*(generated by convert-ps2md.ps1 using the comment-based help of check-uptime.ps1 as of 11/08/2024 12:34:47)* diff --git a/docs/check-vpn.md b/docs/check-vpn.md index d9a39801..f151b20c 100644 --- a/docs/check-vpn.md +++ b/docs/check-vpn.md @@ -6,7 +6,7 @@ This PowerShell script queries the status of the VPN connection(s) and prints it Parameters ---------- ```powershell -PS> ./check-vpn.ps1 [] +/home/markus/Repos/PowerShell/scripts/check-vpn.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -65,4 +65,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of check-vpn.ps1 as of 08/15/2024 09:50:46)* +*(generated by convert-ps2md.ps1 using the comment-based help of check-vpn.ps1 as of 11/08/2024 12:34:47)* diff --git a/docs/check-weather.md b/docs/check-weather.md index 58d8f0d3..010b9d51 100644 --- a/docs/check-weather.md +++ b/docs/check-weather.md @@ -6,7 +6,7 @@ This PowerShell script checks the current weather report. Parameters ---------- ```powershell -PS> ./check-weather.ps1 [[-location] ] [] +/home/markus/Repos/PowerShell/scripts/check-weather.ps1 [[-location] ] [] -location Specifies the location to use (determined automatically per default) @@ -81,4 +81,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of check-weather.ps1 as of 08/15/2024 09:50:46)* +*(generated by convert-ps2md.ps1 using the comment-based help of check-weather.ps1 as of 11/08/2024 12:34:47)* diff --git a/docs/check-week.md b/docs/check-week.md index 874d792c..df188021 100644 --- a/docs/check-week.md +++ b/docs/check-week.md @@ -6,7 +6,7 @@ This PowerShell script determines and speaks the current week number by text-to- Parameters ---------- ```powershell -PS> ./check-week.ps1 [] +/home/markus/Repos/PowerShell/scripts/check-week.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -54,4 +54,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of check-week.ps1 as of 08/15/2024 09:50:46)* +*(generated by convert-ps2md.ps1 using the comment-based help of check-week.ps1 as of 11/08/2024 12:34:47)* diff --git a/docs/check-wind.md b/docs/check-wind.md index 3acc5267..939b73ee 100644 --- a/docs/check-wind.md +++ b/docs/check-wind.md @@ -6,7 +6,7 @@ This PowerShell script determines the current wind conditions and replies by tex Parameters ---------- ```powershell -PS> ./check-wind.ps1 [[-location] ] [] +/home/markus/Repos/PowerShell/scripts/check-wind.ps1 [[-location] ] [] -location Specifies the location to use (determined automatically per default) @@ -72,4 +72,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of check-wind.ps1 as of 08/15/2024 09:50:46)* +*(generated by convert-ps2md.ps1 using the comment-based help of check-wind.ps1 as of 11/08/2024 12:34:47)* diff --git a/docs/check-windows-system-files.md b/docs/check-windows-system-files.md index d11e64cd..3f7fb906 100644 --- a/docs/check-windows-system-files.md +++ b/docs/check-windows-system-files.md @@ -6,7 +6,7 @@ This PowerShell script checks the validity of the Windows system files. It requi Parameters ---------- ```powershell -PS> ./check-windows-system-files.ps1 [] +/home/markus/Repos/PowerShell/scripts/check-windows-system-files.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -17,7 +17,7 @@ Example ------- ```powershell PS> ./check-windows-system-files.ps1 -βœ”οΈ checked Windows system files +βœ… checked Windows system files ``` @@ -39,7 +39,7 @@ Script Content This PowerShell script checks the validity of the Windows system files. It requires admin rights. .EXAMPLE PS> ./check-windows-system-files.ps1 - βœ”οΈ checked Windows system files + βœ… checked Windows system files .LINK https://github.com/fleschutz/PowerShell .NOTES @@ -52,7 +52,7 @@ try { sfc /verifyOnly if ($lastExitCode -ne "0") { throw "'sfc /verifyOnly' failed" } - "βœ”οΈ checked Windows system files" + "βœ… checked Windows system files" exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -60,4 +60,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of check-windows-system-files.ps1 as of 08/15/2024 09:50:46)* +*(generated by convert-ps2md.ps1 using the comment-based help of check-windows-system-files.ps1 as of 11/08/2024 12:34:47)* diff --git a/docs/check-xml-file.md b/docs/check-xml-file.md index ea9d3193..ddafc73e 100644 --- a/docs/check-xml-file.md +++ b/docs/check-xml-file.md @@ -6,7 +6,7 @@ This PowerShell script checks the given XML file for validity. Parameters ---------- ```powershell -PS> ./check-xml-file.ps1 [[-path] ] [] +/home/markus/Repos/PowerShell/scripts/check-xml-file.ps1 [[-path] ] [] -path Specifies the path to the XML file @@ -26,7 +26,7 @@ Example ------- ```powershell PS> ./check-xml-file.ps1 myfile.xml -βœ”οΈ Valid XML in πŸ“„myfile.xml +βœ… Valid XML in πŸ“„myfile.xml ``` @@ -50,7 +50,7 @@ Script Content Specifies the path to the XML file .EXAMPLE PS> ./check-xml-file.ps1 myfile.xml - βœ”οΈ Valid XML in πŸ“„myfile.xml + βœ… Valid XML in πŸ“„myfile.xml .LINK https://github.com/fleschutz/PowerShell .NOTES @@ -77,7 +77,7 @@ try { if ($script:ErrorCount -gt 0) { throw "Invalid XML" } - "βœ”οΈ Valid XML in πŸ“„$path" + "βœ… Valid XML in πŸ“„$path" exit 0 # success } catch { "⚠️ $($Error[0]) in πŸ“„$path" @@ -85,4 +85,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of check-xml-file.ps1 as of 08/15/2024 09:50:46)* +*(generated by convert-ps2md.ps1 using the comment-based help of check-xml-file.ps1 as of 11/08/2024 12:34:47)* diff --git a/docs/check-xml-files.md b/docs/check-xml-files.md index 5f62ade8..1094b465 100644 --- a/docs/check-xml-files.md +++ b/docs/check-xml-files.md @@ -6,7 +6,7 @@ This PowerShell script verifies any XML file (with suffix .xml) in the given dir Parameters ---------- ```powershell -PS> ./check-xml-files.ps1 [[-path] ] [] +/home/markus/Repos/PowerShell/scripts/check-xml-files.ps1 [[-path] ] [] -path Specifies the path to the directory tree (current working dir by default) @@ -27,7 +27,7 @@ Example ```powershell PS> ./check-xml-files.ps1 C:\Windows ... -βœ”οΈ Checked 3387 XML files (2462 invalid, 925 valid) within πŸ“‚C:\Windows in 116 sec +βœ… Checked 3387 XML files (2462 invalid, 925 valid) within πŸ“‚C:\Windows in 116 sec ``` @@ -52,7 +52,7 @@ Script Content .EXAMPLE PS> ./check-xml-files.ps1 C:\Windows ... - βœ”οΈ Checked 3387 XML files (2462 invalid, 925 valid) within πŸ“‚C:\Windows in 116 sec + βœ… Checked 3387 XML files (2462 invalid, 925 valid) within πŸ“‚C:\Windows in 116 sec .LINK https://github.com/fleschutz/PowerShell .NOTES @@ -75,7 +75,7 @@ try { [int]$total = $valid + $invalid [int]$elapsed = $stopWatch.Elapsed.TotalSeconds - "βœ”οΈ Checked $total XML files ($invalid invalid, $valid valid) within πŸ“‚$path in $elapsed sec" + "βœ… Checked $total XML files ($invalid invalid, $valid valid) within πŸ“‚$path in $elapsed sec" exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -83,4 +83,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of check-xml-files.ps1 as of 08/15/2024 09:50:46)* +*(generated by convert-ps2md.ps1 using the comment-based help of check-xml-files.ps1 as of 11/08/2024 12:34:47)* diff --git a/docs/clean-repo.md b/docs/clean-repo.md index ce7f08ee..82b53f3a 100644 --- a/docs/clean-repo.md +++ b/docs/clean-repo.md @@ -7,7 +7,7 @@ NOTE: To be used with care! This cannot be undone! Parameters ---------- ```powershell -PS> ./clean-repo.ps1 [[-path] ] [] +/home/markus/Repos/PowerShell/scripts/clean-repo.ps1 [[-path] ] [] -path Specifies the file path to the local Git repository (current working directory by default) @@ -31,7 +31,7 @@ PS> ./clean-repo.ps1 C:\Repos\rust ⏳ (2/4) Checking local repository... C:\Repos\rust ⏳ (3/4) Removing untracked files in repository... ⏳ (4/4) Removing untracked files in submodules... -βœ”οΈ Cleaned up πŸ“‚rust repository in 2s. +βœ… Cleaned up πŸ“‚rust repo in 2s. ``` @@ -60,7 +60,7 @@ Script Content ⏳ (2/4) Checking local repository... C:\Repos\rust ⏳ (3/4) Removing untracked files in repository... ⏳ (4/4) Removing untracked files in submodules... - βœ”οΈ Cleaned up πŸ“‚rust repository in 2s. + βœ… Cleaned up πŸ“‚rust repo in 2s. .LINK https://github.com/fleschutz/PowerShell .NOTES @@ -93,7 +93,7 @@ try { if ($lastExitCode -ne "0") { throw "'git clean' in the submodules failed with exit code $lastExitCode" } [int]$elapsed = $stopWatch.Elapsed.TotalSeconds - "βœ”οΈ Cleaned up πŸ“‚$repoName repository in $($elapsed)s." + "βœ… Cleaned up πŸ“‚$repoName repo in $($elapsed)s." exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -101,4 +101,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of clean-repo.ps1 as of 08/15/2024 09:50:46)* +*(generated by convert-ps2md.ps1 using the comment-based help of clean-repo.ps1 as of 11/08/2024 12:34:47)* diff --git a/docs/clean-repos.md b/docs/clean-repos.md index d24b25e1..25b789e5 100644 --- a/docs/clean-repos.md +++ b/docs/clean-repos.md @@ -6,7 +6,7 @@ This PowerShell script cleans all Git repositories in a folder from untracked fi Parameters ---------- ```powershell -PS> ./clean-repos.ps1 [[-parentDir] ] [] +/home/markus/Repos/PowerShell/scripts/clean-repos.ps1 [[-parentDir] ] [] -parentDir Specifies the path to the parent folder (current working dir by default) @@ -92,7 +92,7 @@ try { if ($lastExitCode -ne "0") { throw "'git clean -xfd -f' in submodules failed with exit code $lastExitCode" } } [int]$elapsed = $stopWatch.Elapsed.TotalSeconds - "βœ”οΈ Cleaned $numFolders Git repos under πŸ“‚$parentDirName in $elapsed sec" + "βœ… Cleaned $numFolders Git repos under πŸ“‚$parentDirName in $elapsed sec" exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -100,4 +100,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of clean-repos.ps1 as of 08/15/2024 09:50:46)* +*(generated by convert-ps2md.ps1 using the comment-based help of clean-repos.ps1 as of 11/08/2024 12:34:47)* diff --git a/docs/clear-dns-cache.md b/docs/clear-dns-cache.md index f49aa34a..ad907305 100644 --- a/docs/clear-dns-cache.md +++ b/docs/clear-dns-cache.md @@ -6,7 +6,7 @@ This PowerShell script clears the DNS client cache of the local computer. Parameters ---------- ```powershell -PS> ./clear-dns-cache.ps1 [] +/home/markus/Repos/PowerShell/scripts/clear-dns-cache.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -17,7 +17,7 @@ Example ------- ```powershell PS> ./clear-dns-cache.ps1 -βœ”οΈ Cleared DNS cache in 1 sec +βœ… Cleared DNS cache in 1s. ``` @@ -39,7 +39,7 @@ Script Content This PowerShell script clears the DNS client cache of the local computer. .EXAMPLE PS> ./clear-dns-cache.ps1 - βœ”οΈ Cleared DNS cache in 1 sec + βœ… Cleared DNS cache in 1s. .LINK https://github.com/fleschutz/PowerShell .NOTES @@ -47,12 +47,12 @@ Script Content #> try { - $StopWatch = [system.diagnostics.stopwatch]::startNew() + $stopWatch = [system.diagnostics.stopwatch]::startNew() Clear-DnsClientCache - [int]$Elapsed = $StopWatch.Elapsed.TotalSeconds - "βœ”οΈ Cleared DNS cache in $Elapsed sec" + [int]$elapsed = $stopWatch.Elapsed.TotalSeconds + "βœ… Cleared DNS cache in $($elapsed)s." exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -60,4 +60,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of clear-dns-cache.ps1 as of 08/15/2024 09:50:46)* +*(generated by convert-ps2md.ps1 using the comment-based help of clear-dns-cache.ps1 as of 11/08/2024 12:34:47)* diff --git a/docs/clear-recycle-bin.md b/docs/clear-recycle-bin.md index 1c39e1ea..b4bffa6c 100644 --- a/docs/clear-recycle-bin.md +++ b/docs/clear-recycle-bin.md @@ -7,7 +7,7 @@ IMPORTANT NOTE: this cannot be undo! Parameters ---------- ```powershell -PS> ./clear-recycle-bin.ps1 [] +/home/markus/Repos/PowerShell/scripts/clear-recycle-bin.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -58,4 +58,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of clear-recycle-bin.ps1 as of 08/15/2024 09:50:46)* +*(generated by convert-ps2md.ps1 using the comment-based help of clear-recycle-bin.ps1 as of 11/08/2024 12:34:47)* diff --git a/docs/clone-repos.md b/docs/clone-repos.md index 85365d39..ef085b3c 100644 --- a/docs/clone-repos.md +++ b/docs/clone-repos.md @@ -6,7 +6,7 @@ This PowerShell script clones popular Git repositories into a common target dire Parameters ---------- ```powershell -PS> ./clone-repos.ps1 [[-targetDir] ] [] +/home/markus/Repos/PowerShell/scripts/clone-repos.ps1 [[-targetDir] ] [] -targetDir Specifies the file path to the target directory (current working directory by default) @@ -26,8 +26,11 @@ Example ------- ```powershell PS> ./clone-repos C:\MyRepos +⏳ (1) Searching for Git executable... git version 2.46.0.windows.1 +⏳ (2) Reading data/popular-repos.csv... 29 repos +⏳ (3) Checking target folder... πŸ“‚Repos +⏳ (4/32) Cloning πŸ“‚base256 (dev tool) from git@github.com:fleschutz/talk2windows.git (shallow main branch)... ... -βœ”οΈ Cloned 29 additional Git repos into πŸ“‚MyRepos in 123s. ``` @@ -51,8 +54,11 @@ Script Content Specifies the file path to the target directory (current working directory by default) .EXAMPLE PS> ./clone-repos C:\MyRepos + ⏳ (1) Searching for Git executable... git version 2.46.0.windows.1 + ⏳ (2) Reading data/popular-repos.csv... 29 repos + ⏳ (3) Checking target folder... πŸ“‚Repos + ⏳ (4/32) Cloning πŸ“‚base256 (dev tool) from git@github.com:fleschutz/talk2windows.git (shallow main branch)... ... - βœ”οΈ Cloned 29 additional Git repos into πŸ“‚MyRepos in 123s. .LINK https://github.com/fleschutz/PowerShell .NOTES @@ -89,22 +95,22 @@ try { $step++ if (Test-Path "$targetDir/$folderName" -pathType container) { - "⏳ ($step/$($total + 3)) Skipping πŸ“‚$folderName - the $category exists already..." + "⏳ ($step/$($total + 3)) Skipping πŸ“‚$folderName ($category): exists already" $skipped++ } elseif ($shallow -eq "yes") { - "⏳ ($step/$($total + 3)) Cloning into πŸ“‚$folderName (a $category, $branch branch, shallow)..." + "⏳ ($step/$($total + 3)) Cloning πŸ“‚$folderName ($category) from $URL (shallow $branch branch)..." & git clone --branch "$branch" --single-branch --recurse-submodules "$URL" "$targetDir/$folderName" if ($lastExitCode -ne "0") { throw "'git clone --branch $branch $URL' failed with exit code $lastExitCode" } $cloned++ } else { - "⏳ ($step/$($total + 3)) Cloning into πŸ“‚$folderName (a $category, $branch branch, full history)..." + "⏳ ($step/$($total + 3)) Cloning πŸ“‚$folderName ($category) from $URL (full $branch branch)..." & git clone --branch "$branch" --recurse-submodules "$URL" "$targetDir/$folderName" if ($lastExitCode -ne "0") { throw "'git clone --branch $branch $URL' failed with exit code $lastExitCode" } $clone++ } } [int]$elapsed = $stopWatch.Elapsed.TotalSeconds - "βœ”οΈ Cloned $cloned additional Git repos into πŸ“‚$targetDirName in $($elapsed)s." + "βœ… Cloned $cloned additional Git repos into πŸ“‚$targetDirName in $($elapsed)s." exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -112,4 +118,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of clone-repos.ps1 as of 08/15/2024 09:50:46)* +*(generated by convert-ps2md.ps1 using the comment-based help of clone-repos.ps1 as of 11/08/2024 12:34:47)* diff --git a/docs/clone-shallow.md b/docs/clone-shallow.md index 60d20abb..00bc0753 100644 --- a/docs/clone-shallow.md +++ b/docs/clone-shallow.md @@ -6,7 +6,7 @@ This PowerShell script clones popular Git repositories into a common target dire Parameters ---------- ```powershell -PS> ./clone-shallow.ps1 [[-targetDir] ] [] +/home/markus/Repos/PowerShell/scripts/clone-shallow.ps1 [[-targetDir] ] [] -targetDir Specifies the file path to the target directory (current working directory by default) @@ -66,7 +66,7 @@ try { [int]$elapsed = $stopWatch.Elapsed.TotalSeconds - "βœ”οΈ Cloned the shallow repository in $elapsed sec" + "βœ… Cloned the shallow repository in $elapsed sec" exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -74,4 +74,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of clone-shallow.ps1 as of 08/15/2024 09:50:46)* +*(generated by convert-ps2md.ps1 using the comment-based help of clone-shallow.ps1 as of 11/08/2024 12:34:47)* diff --git a/docs/close-calculator.md b/docs/close-calculator.md index a3ecd4af..bd00a0b6 100644 --- a/docs/close-calculator.md +++ b/docs/close-calculator.md @@ -6,7 +6,7 @@ This PowerShell script closes the calculator application gracefully. Parameters ---------- ```powershell -PS> ./close-calculator.ps1 [] +/home/markus/Repos/PowerShell/scripts/close-calculator.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -48,4 +48,4 @@ Stop-Process -name "CalculatorApp" exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of close-calculator.ps1 as of 08/15/2024 09:50:46)* +*(generated by convert-ps2md.ps1 using the comment-based help of close-calculator.ps1 as of 11/08/2024 12:34:47)* diff --git a/docs/close-chrome.md b/docs/close-chrome.md index ad3a0a2e..a5145739 100644 --- a/docs/close-chrome.md +++ b/docs/close-chrome.md @@ -6,7 +6,7 @@ This PowerShell script closes the Google Chrome Web browser gracefully. Parameters ---------- ```powershell -PS> ./close-chrome.ps1 [] +/home/markus/Repos/PowerShell/scripts/close-chrome.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of close-chrome.ps1 as of 08/15/2024 09:50:46)* +*(generated by convert-ps2md.ps1 using the comment-based help of close-chrome.ps1 as of 11/08/2024 12:34:47)* diff --git a/docs/close-cortana.md b/docs/close-cortana.md index 40c8d57e..d252e9db 100644 --- a/docs/close-cortana.md +++ b/docs/close-cortana.md @@ -6,7 +6,7 @@ This PowerShell script closes Microsoft's Cortana application gracefully. Parameters ---------- ```powershell -PS> ./close-cortana.ps1 [] +/home/markus/Repos/PowerShell/scripts/close-cortana.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of close-cortana.ps1 as of 08/15/2024 09:50:46)* +*(generated by convert-ps2md.ps1 using the comment-based help of close-cortana.ps1 as of 11/08/2024 12:34:47)* diff --git a/docs/close-edge.md b/docs/close-edge.md index 78143b8c..0254d4e6 100644 --- a/docs/close-edge.md +++ b/docs/close-edge.md @@ -6,7 +6,7 @@ This PowerShell script closes the Microsoft Edge Web browser gracefully. Parameters ---------- ```powershell -PS> ./close-edge.ps1 [] +/home/markus/Repos/PowerShell/scripts/close-edge.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -52,4 +52,4 @@ if ($lastExitCode -ne "0") { exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of close-edge.ps1 as of 08/15/2024 09:50:46)* +*(generated by convert-ps2md.ps1 using the comment-based help of close-edge.ps1 as of 11/08/2024 12:34:47)* diff --git a/docs/close-file-explorer.md b/docs/close-file-explorer.md index f21f662c..cae75725 100644 --- a/docs/close-file-explorer.md +++ b/docs/close-file-explorer.md @@ -6,7 +6,7 @@ This PowerShell script closes the Microsoft File Explorer application gracefully Parameters ---------- ```powershell -PS> ./close-file-explorer.ps1 [] +/home/markus/Repos/PowerShell/scripts/close-file-explorer.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of close-file-explorer.ps1 as of 08/15/2024 09:50:46)* +*(generated by convert-ps2md.ps1 using the comment-based help of close-file-explorer.ps1 as of 11/08/2024 12:34:47)* diff --git a/docs/close-firefox.md b/docs/close-firefox.md index aa07e762..cd3799f2 100644 --- a/docs/close-firefox.md +++ b/docs/close-firefox.md @@ -6,7 +6,7 @@ This PowerShell script closes the Mozilla Firefox Web browser gracefully. Parameters ---------- ```powershell -PS> ./close-firefox.ps1 [] +/home/markus/Repos/PowerShell/scripts/close-firefox.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of close-firefox.ps1 as of 08/15/2024 09:50:46)* +*(generated by convert-ps2md.ps1 using the comment-based help of close-firefox.ps1 as of 11/08/2024 12:34:47)* diff --git a/docs/close-git-extensions.md b/docs/close-git-extensions.md index 6cb31cd4..07560c9e 100644 --- a/docs/close-git-extensions.md +++ b/docs/close-git-extensions.md @@ -6,7 +6,7 @@ This PowerShell script closes the Git Extensions application gracefully. Parameters ---------- ```powershell -PS> ./close-git-extensions.ps1 [] +/home/markus/Repos/PowerShell/scripts/close-git-extensions.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -52,4 +52,4 @@ if ($lastExitCode -ne "0") { exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of close-git-extensions.ps1 as of 08/15/2024 09:50:46)* +*(generated by convert-ps2md.ps1 using the comment-based help of close-git-extensions.ps1 as of 11/08/2024 12:34:47)* diff --git a/docs/close-magnifier.md b/docs/close-magnifier.md index e012777b..f10b831a 100644 --- a/docs/close-magnifier.md +++ b/docs/close-magnifier.md @@ -6,7 +6,7 @@ This PowerShell script closes the Windows Screen Magnifier application gracefull Parameters ---------- ```powershell -PS> ./close-magnifier.ps1 [] +/home/markus/Repos/PowerShell/scripts/close-magnifier.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -48,4 +48,4 @@ tskill magnify exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of close-magnifier.ps1 as of 08/15/2024 09:50:46)* +*(generated by convert-ps2md.ps1 using the comment-based help of close-magnifier.ps1 as of 11/08/2024 12:34:47)* diff --git a/docs/close-microsoft-paint.md b/docs/close-microsoft-paint.md index 5fe97151..174dc827 100644 --- a/docs/close-microsoft-paint.md +++ b/docs/close-microsoft-paint.md @@ -6,7 +6,7 @@ This PowerShell script closes the Microsoft Paint application gracefully. Parameters ---------- ```powershell -PS> ./close-microsoft-paint.ps1 [] +/home/markus/Repos/PowerShell/scripts/close-microsoft-paint.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -52,4 +52,4 @@ if ($lastExitCode -ne "0") { exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of close-microsoft-paint.ps1 as of 08/15/2024 09:50:46)* +*(generated by convert-ps2md.ps1 using the comment-based help of close-microsoft-paint.ps1 as of 11/08/2024 12:34:47)* diff --git a/docs/close-microsoft-store.md b/docs/close-microsoft-store.md index 84608be9..93c79a6d 100644 --- a/docs/close-microsoft-store.md +++ b/docs/close-microsoft-store.md @@ -6,7 +6,7 @@ This PowerShell script closes the Microsoft Store application gracefully. Parameters ---------- ```powershell -PS> ./close-microsoft-store.ps1 [] +/home/markus/Repos/PowerShell/scripts/close-microsoft-store.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -52,4 +52,4 @@ if ($lastExitCode -ne "0") { exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of close-microsoft-store.ps1 as of 08/15/2024 09:50:46)* +*(generated by convert-ps2md.ps1 using the comment-based help of close-microsoft-store.ps1 as of 11/08/2024 12:34:47)* diff --git a/docs/close-netflix.md b/docs/close-netflix.md index cffe9e41..de6309c3 100644 --- a/docs/close-netflix.md +++ b/docs/close-netflix.md @@ -6,7 +6,7 @@ This PowerShell script closes the Netflix application gracefully. Parameters ---------- ```powershell -PS> ./close-netflix.ps1 [] +/home/markus/Repos/PowerShell/scripts/close-netflix.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of close-netflix.ps1 as of 08/15/2024 09:50:46)* +*(generated by convert-ps2md.ps1 using the comment-based help of close-netflix.ps1 as of 11/08/2024 12:34:47)* diff --git a/docs/close-notepad.md b/docs/close-notepad.md index 0dcc12dc..60705989 100644 --- a/docs/close-notepad.md +++ b/docs/close-notepad.md @@ -6,7 +6,7 @@ This PowerShell script closes the Notepad application gracefully. Parameters ---------- ```powershell -PS> ./close-notepad.ps1 [] +/home/markus/Repos/PowerShell/scripts/close-notepad.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of close-notepad.ps1 as of 08/15/2024 09:50:46)* +*(generated by convert-ps2md.ps1 using the comment-based help of close-notepad.ps1 as of 11/08/2024 12:34:47)* diff --git a/docs/close-obs-studio.md b/docs/close-obs-studio.md index acdecf3b..aa047860 100644 --- a/docs/close-obs-studio.md +++ b/docs/close-obs-studio.md @@ -6,7 +6,7 @@ This PowerShell script closes the OBS Studio application gracefully. Parameters ---------- ```powershell -PS> ./close-obs-studio.ps1 [] +/home/markus/Repos/PowerShell/scripts/close-obs-studio.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -52,4 +52,4 @@ if ($lastExitCode -ne "0") { exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of close-obs-studio.ps1 as of 08/15/2024 09:50:46)* +*(generated by convert-ps2md.ps1 using the comment-based help of close-obs-studio.ps1 as of 11/08/2024 12:34:47)* diff --git a/docs/close-one-calendar.md b/docs/close-one-calendar.md index eda5f60c..2ecfb838 100644 --- a/docs/close-one-calendar.md +++ b/docs/close-one-calendar.md @@ -6,7 +6,7 @@ This PowerShell script closes the OneCalendar application gracefully. Parameters ---------- ```powershell -PS> ./close-one-calendar.ps1 [] +/home/markus/Repos/PowerShell/scripts/close-one-calendar.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -52,4 +52,4 @@ if ($lastExitCode -ne "0") { exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of close-one-calendar.ps1 as of 08/15/2024 09:50:46)* +*(generated by convert-ps2md.ps1 using the comment-based help of close-one-calendar.ps1 as of 11/08/2024 12:34:47)* diff --git a/docs/close-outlook.md b/docs/close-outlook.md index caad40f0..97156ac3 100644 --- a/docs/close-outlook.md +++ b/docs/close-outlook.md @@ -6,7 +6,7 @@ This PowerShell script closes the Microsoft Outlook email application gracefully Parameters ---------- ```powershell -PS> ./close-outlook.ps1 [] +/home/markus/Repos/PowerShell/scripts/close-outlook.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -52,4 +52,4 @@ if ($lastExitCode -ne "0") { exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of close-outlook.ps1 as of 08/15/2024 09:50:46)* +*(generated by convert-ps2md.ps1 using the comment-based help of close-outlook.ps1 as of 11/08/2024 12:34:47)* diff --git a/docs/close-paint-three-d.md b/docs/close-paint-three-d.md index 921274f0..7c92694b 100644 --- a/docs/close-paint-three-d.md +++ b/docs/close-paint-three-d.md @@ -6,7 +6,7 @@ This PowerShell script closes the Paint 3D application gracefully. Parameters ---------- ```powershell -PS> ./close-paint-three-d.ps1 [] +/home/markus/Repos/PowerShell/scripts/close-paint-three-d.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -52,4 +52,4 @@ if ($lastExitCode -ne "0") { exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of close-paint-three-d.ps1 as of 08/15/2024 09:50:46)* +*(generated by convert-ps2md.ps1 using the comment-based help of close-paint-three-d.ps1 as of 11/08/2024 12:34:47)* diff --git a/docs/close-program.md b/docs/close-program.md index a85938ab..23efd75f 100644 --- a/docs/close-program.md +++ b/docs/close-program.md @@ -6,7 +6,7 @@ This PowerShell script closes a program's processes gracefully. Parameters ---------- ```powershell -PS> ./close-program.ps1 [[-fullProgramName] ] [[-programName] ] [[-programAliasName] ] [] +/home/markus/Repos/PowerShell/scripts/close-program.ps1 [[-fullProgramName] ] [[-programName] ] [[-programAliasName] ] [] -fullProgramName Specifies the full program name @@ -107,9 +107,9 @@ try { Stop-Process -name $programName -force -errorAction 'silentlycontinue' } if ($($processes.Count) -eq 1) { - "βœ”οΈ $fullProgramName closed." + "βœ… $fullProgramName closed." } else { - "βœ”οΈ $fullProgramName closed and $($processes.Count) processes stopped." + "βœ… $fullProgramName closed and $($processes.Count) processes stopped." } exit 0 # success } catch { @@ -118,4 +118,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of close-program.ps1 as of 08/15/2024 09:50:47)* +*(generated by convert-ps2md.ps1 using the comment-based help of close-program.ps1 as of 11/08/2024 12:34:48)* diff --git a/docs/close-serenade.md b/docs/close-serenade.md index 199ab430..390376a4 100644 --- a/docs/close-serenade.md +++ b/docs/close-serenade.md @@ -6,7 +6,7 @@ This PowerShell script closes the Serenade.ai application gracefully. Parameters ---------- ```powershell -PS> ./close-serenade.ps1 [] +/home/markus/Repos/PowerShell/scripts/close-serenade.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of close-serenade.ps1 as of 08/15/2024 09:50:47)* +*(generated by convert-ps2md.ps1 using the comment-based help of close-serenade.ps1 as of 11/08/2024 12:34:48)* diff --git a/docs/close-snipping-tool.md b/docs/close-snipping-tool.md index 2a2eb08a..4ea25444 100644 --- a/docs/close-snipping-tool.md +++ b/docs/close-snipping-tool.md @@ -6,7 +6,7 @@ This PowerShell script closes the Snipping Tool application gracefully. Parameters ---------- ```powershell -PS> ./close-snipping-tool.ps1 [] +/home/markus/Repos/PowerShell/scripts/close-snipping-tool.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of close-snipping-tool.ps1 as of 08/15/2024 09:50:47)* +*(generated by convert-ps2md.ps1 using the comment-based help of close-snipping-tool.ps1 as of 11/08/2024 12:34:48)* diff --git a/docs/close-spotify.md b/docs/close-spotify.md index c3319bf9..9fa587f8 100644 --- a/docs/close-spotify.md +++ b/docs/close-spotify.md @@ -6,7 +6,7 @@ This PowerShell script closes the Spotify application gracefully. Parameters ---------- ```powershell -PS> ./close-spotify.ps1 [] +/home/markus/Repos/PowerShell/scripts/close-spotify.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of close-spotify.ps1 as of 08/15/2024 09:50:47)* +*(generated by convert-ps2md.ps1 using the comment-based help of close-spotify.ps1 as of 11/08/2024 12:34:48)* diff --git a/docs/close-task-manager.md b/docs/close-task-manager.md index 1e863355..637a0c83 100644 --- a/docs/close-task-manager.md +++ b/docs/close-task-manager.md @@ -6,7 +6,7 @@ This PowerShell script closes the Task Manager application gracefully. Parameters ---------- ```powershell -PS> ./close-task-manager.ps1 [] +/home/markus/Repos/PowerShell/scripts/close-task-manager.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -48,4 +48,4 @@ tskill taskmgr exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of close-task-manager.ps1 as of 08/15/2024 09:50:47)* +*(generated by convert-ps2md.ps1 using the comment-based help of close-task-manager.ps1 as of 11/08/2024 12:34:48)* diff --git a/docs/close-three-d-viewer.md b/docs/close-three-d-viewer.md index 0189eba9..20f61199 100644 --- a/docs/close-three-d-viewer.md +++ b/docs/close-three-d-viewer.md @@ -6,7 +6,7 @@ This PowerShell script closes the 3D-Viewer application gracefully. Parameters ---------- ```powershell -PS> ./close-three-d-viewer.ps1 [] +/home/markus/Repos/PowerShell/scripts/close-three-d-viewer.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -52,4 +52,4 @@ if ($lastExitCode -ne "0") { exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of close-three-d-viewer.ps1 as of 08/15/2024 09:50:47)* +*(generated by convert-ps2md.ps1 using the comment-based help of close-three-d-viewer.ps1 as of 11/08/2024 12:34:48)* diff --git a/docs/close-thunderbird.md b/docs/close-thunderbird.md index d58c6d5f..823ab876 100644 --- a/docs/close-thunderbird.md +++ b/docs/close-thunderbird.md @@ -6,7 +6,7 @@ This PowerShell script closes the Mozilla Thunderbird email application graceful Parameters ---------- ```powershell -PS> ./close-thunderbird.ps1 [] +/home/markus/Repos/PowerShell/scripts/close-thunderbird.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -52,4 +52,4 @@ if ($lastExitCode -ne "0") { exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of close-thunderbird.ps1 as of 08/15/2024 09:50:47)* +*(generated by convert-ps2md.ps1 using the comment-based help of close-thunderbird.ps1 as of 11/08/2024 12:34:48)* diff --git a/docs/close-visual-studio.md b/docs/close-visual-studio.md index 6ab3b720..5ecfd1fa 100644 --- a/docs/close-visual-studio.md +++ b/docs/close-visual-studio.md @@ -6,7 +6,7 @@ This PowerShell script closes the Microsoft Visual Studio application gracefully Parameters ---------- ```powershell -PS> ./close-visual-studio.ps1 [] +/home/markus/Repos/PowerShell/scripts/close-visual-studio.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -52,4 +52,4 @@ if ($lastExitCode -ne "0") { exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of close-visual-studio.ps1 as of 08/15/2024 09:50:47)* +*(generated by convert-ps2md.ps1 using the comment-based help of close-visual-studio.ps1 as of 11/08/2024 12:34:48)* diff --git a/docs/close-vlc.md b/docs/close-vlc.md index 6acf528a..2994687b 100644 --- a/docs/close-vlc.md +++ b/docs/close-vlc.md @@ -6,7 +6,7 @@ This PowerShell script closes the VLC media player application gracefully. Parameters ---------- ```powershell -PS> ./close-vlc.ps1 [] +/home/markus/Repos/PowerShell/scripts/close-vlc.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of close-vlc.ps1 as of 08/15/2024 09:50:47)* +*(generated by convert-ps2md.ps1 using the comment-based help of close-vlc.ps1 as of 11/08/2024 12:34:48)* diff --git a/docs/close-windows-terminal.md b/docs/close-windows-terminal.md index d2cb5c05..17f00438 100644 --- a/docs/close-windows-terminal.md +++ b/docs/close-windows-terminal.md @@ -6,7 +6,7 @@ This PowerShell script closes the Windows Terminal application gracefully. Parameters ---------- ```powershell -PS> ./close-windows-terminal.ps1 [] +/home/markus/Repos/PowerShell/scripts/close-windows-terminal.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of close-windows-terminal.ps1 as of 08/15/2024 09:50:47)* +*(generated by convert-ps2md.ps1 using the comment-based help of close-windows-terminal.ps1 as of 11/08/2024 12:34:48)* diff --git a/docs/configure-git.md b/docs/configure-git.md index 1dee7c7f..4d6423c8 100644 --- a/docs/configure-git.md +++ b/docs/configure-git.md @@ -1,12 +1,12 @@ Script: *configure-git.ps1* ======================== -This PowerShell script configures the Git user settings. +This PowerShell script configures your Git user settings. Parameters ---------- ```powershell -PS> ./configure-git.ps1 [[-fullName] ] [[-emailAddress] ] [[-favoriteEditor] ] [] +/home/markus/Repos/PowerShell/scripts/configure-git.ps1 [[-fullName] ] [[-emailAddress] ] [[-favoriteEditor] ] [] -fullName Specifies the user's full name @@ -44,12 +44,12 @@ Example ------- ```powershell PS> ./configure-git.ps1 "Joe Doe" joe@doe.com vim -⏳ (1/6) Searching for Git executable... git version 2.42.0.windows.1 -⏳ (2/6) Query user settings... -⏳ (3/6) Saving basic settings (autocrlf,symlinks,longpaths,etc.)... -⏳ (4/6) Saving user settings (name,email,editor)... -⏳ (5/6) Saving user shortcuts ('git br', 'git ls', 'git st', etc.)... -⏳ (6/6) Listing your current settings... +⏳ (1/5) Searching for Git executable... git version 2.42.0.windows.1 +⏳ (2/5) Asking for user details... +⏳ (3/5) Saving basic settings (autocrlf,symlinks,longpaths,etc.)... +⏳ (4/5) Saving user settings (name,email,editor)... +⏳ (5/5) Saving user shortcuts ('git br', 'git ls', 'git st', etc.)... +βœ… Saved your Git configuration to ~/.gitconfig in 11s. ``` @@ -68,7 +68,7 @@ Script Content .SYNOPSIS Configures Git .DESCRIPTION - This PowerShell script configures the Git user settings. + This PowerShell script configures your Git user settings. .PARAMETER fullName Specifies the user's full name .PARAMETER emailAddress @@ -77,12 +77,13 @@ Script Content Specifies the user's favorite text editor .EXAMPLE PS> ./configure-git.ps1 "Joe Doe" joe@doe.com vim - ⏳ (1/6) Searching for Git executable... git version 2.42.0.windows.1 - ⏳ (2/6) Query user settings... - ⏳ (3/6) Saving basic settings (autocrlf,symlinks,longpaths,etc.)... - ⏳ (4/6) Saving user settings (name,email,editor)... - ⏳ (5/6) Saving user shortcuts ('git br', 'git ls', 'git st', etc.)... - ⏳ (6/6) Listing your current settings... + ⏳ (1/5) Searching for Git executable... git version 2.42.0.windows.1 + ⏳ (2/5) Asking for user details... + ⏳ (3/5) Saving basic settings (autocrlf,symlinks,longpaths,etc.)... + ⏳ (4/5) Saving user settings (name,email,editor)... + ⏳ (5/5) Saving user shortcuts ('git br', 'git ls', 'git st', etc.)... + βœ… Saved your Git configuration to ~/.gitconfig in 11s. + .LINK https://github.com/fleschutz/PowerShell .NOTES @@ -92,17 +93,17 @@ Script Content param([string]$fullName = "", [string]$emailAddress = "", [string]$favoriteEditor = "") try { - Write-Host "⏳ (1/6) Searching for Git executable... " -noNewline + Write-Host "⏳ (1/5) Searching for Git executable... " -noNewline & git --version if ($lastExitCode -ne "0") { throw "Can't execute 'git' - make sure Git is installed and available" } - "⏳ (2/6) Query user settings..." + "⏳ (2/5) Asking for user details..." if ($fullName -eq "") { $fullName = Read-Host "Enter your full name" } if ($emailAddress -eq "") { $emailAddress = Read-Host "Enter your e-mail address"} - if ($favoriteEditor -eq "") { $favoriteEditor = Read-Host "Enter your favorite text editor (atom,code,emacs,nano,notepad,subl,vi,vim,...)" } + if ($favoriteEditor -eq "") { $favoriteEditor = Read-Host "Enter your favorite text editor, e.g. atom,code,emacs,nano,notepad,subl,vi,vim" } $stopWatch = [system.diagnostics.stopwatch]::startNew() - "⏳ (3/6) Saving basic settings (autocrlf,symlinks,longpaths,etc.)..." + "⏳ (3/5) Saving basic settings (autocrlf,symlinks,longpaths,etc.)..." & git config --global core.autocrlf false # don't change newlines & git config --global core.symlinks true # enable support for symbolic link files & git config --global core.longpaths true # enable support for long file paths @@ -112,13 +113,13 @@ try { & git config --global fetch.parallel 0 # enable parallel fetching to improve the speed if ($lastExitCode -ne "0") { throw "'git config' failed with exit code $lastExitCode" } - "⏳ (4/6) Saving user settings (name,email,editor)..." + "⏳ (4/5) Saving user settings (name,email,editor)..." & git config --global user.name $fullName & git config --global user.email $emailAddress & git config --global core.editor $favoriteEditor if ($lastExitCode -ne "0") { throw "'git config' failed with exit code $lastExitCode" } - "⏳ (5/6) Saving user shortcuts ('git br', 'git ls', 'git st', etc.)..." + "⏳ (5/5) Saving user shortcuts ('git br', 'git ls', 'git st', etc.)..." & git config --global alias.br "branch" & git config --global alias.chp "cherry-pick --no-commit" & git config --global alias.ci "commit" @@ -131,12 +132,8 @@ try { & git config --global alias.st "status" if ($lastExitCode -ne "0") { throw "'git config' failed" } - "⏳ (6/6) Listing your current settings..." - & git config --list - if ($lastExitCode -ne "0") { throw "'git config --list' failed with exit code $lastExitCode" } - [int]$elapsed = $stopWatch.Elapsed.TotalSeconds - "βœ”οΈ Saved your Git configuration in $elapsed sec" + "βœ… Saved your Git configuration to ~/.gitconfig in $($elapsed)s." exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber)): $($Error[0])" @@ -144,4 +141,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of configure-git.ps1 as of 08/15/2024 09:50:47)* +*(generated by convert-ps2md.ps1 using the comment-based help of configure-git.ps1 as of 11/08/2024 12:34:48)* diff --git a/docs/connect-vpn.md b/docs/connect-vpn.md index 2600d0af..dc0ae28a 100644 --- a/docs/connect-vpn.md +++ b/docs/connect-vpn.md @@ -6,7 +6,7 @@ This PowerShell script tries to connect to the VPN. Parameters ---------- ```powershell -PS> ./connect-vpn.ps1 [] +/home/markus/Repos/PowerShell/scripts/connect-vpn.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -62,4 +62,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of connect-vpn.ps1 as of 08/15/2024 09:50:47)* +*(generated by convert-ps2md.ps1 using the comment-based help of connect-vpn.ps1 as of 11/08/2024 12:34:48)* diff --git a/docs/convert-csv2txt.md b/docs/convert-csv2txt.md index a36384a0..3bd10ae9 100644 --- a/docs/convert-csv2txt.md +++ b/docs/convert-csv2txt.md @@ -6,7 +6,7 @@ This PowerShell script converts a .CSV file into a text file and prints it. Parameters ---------- ```powershell -PS> ./convert-csv2txt.ps1 [[-Path] ] [] +/home/markus/Repos/PowerShell/scripts/convert-csv2txt.ps1 [[-Path] ] [] -Path Specifies the path to the .CSV file @@ -72,4 +72,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of convert-csv2txt.ps1 as of 08/15/2024 09:50:47)* +*(generated by convert-ps2md.ps1 using the comment-based help of convert-csv2txt.ps1 as of 11/08/2024 12:34:48)* diff --git a/docs/convert-dir2zip.md b/docs/convert-dir2zip.md index 164c5ac5..717d6869 100644 --- a/docs/convert-dir2zip.md +++ b/docs/convert-dir2zip.md @@ -6,7 +6,7 @@ This PowerShell script creates a new compressed .ZIP file from a directory (incl Parameters ---------- ```powershell -PS> ./convert-dir2zip.ps1 [[-dirPath] ] [[-zipPath] ] [] +/home/markus/Repos/PowerShell/scripts/convert-dir2zip.ps1 [[-dirPath] ] [[-zipPath] ] [] -dirPath Specifies the path to the directory @@ -35,7 +35,7 @@ Example ------- ```powershell PS> ./convert-dir2zip.ps1 C:\Windows Win.zip -βœ”οΈ Converted into compressed Win.zip in 291s. +βœ… Converted into compressed Win.zip in 291s. ``` @@ -61,7 +61,7 @@ Script Content Specifies the path to the target .ZIP file (default is dirPath.zip) .EXAMPLE PS> ./convert-dir2zip.ps1 C:\Windows Win.zip - βœ”οΈ Converted into compressed Win.zip in 291s. + βœ… Converted into compressed Win.zip in 291s. .LINK https://github.com/fleschutz/PowerShell .NOTES @@ -80,7 +80,7 @@ try { Compress-Archive -path $dirPath -destinationPath $zipPath [int]$elapsed = $StopWatch.Elapsed.TotalSeconds - "βœ”οΈ Converted into compressed $zipPath in $($elapsed)s." + "βœ… Converted into compressed $zipPath in $($elapsed)s." exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -88,4 +88,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of convert-dir2zip.ps1 as of 08/15/2024 09:50:47)* +*(generated by convert-ps2md.ps1 using the comment-based help of convert-dir2zip.ps1 as of 11/08/2024 12:34:48)* diff --git a/docs/convert-docx2md.md b/docs/convert-docx2md.md index c741f076..77ff1042 100644 --- a/docs/convert-docx2md.md +++ b/docs/convert-docx2md.md @@ -6,7 +6,7 @@ This PowerShell script converts .DOCX file(s) into Markdown. Parameters ---------- ```powershell -PS> ./convert-docx2md.ps1 [[-FilePattern] ] [] +/home/markus/Repos/PowerShell/scripts/convert-docx2md.ps1 [[-FilePattern] ] [] -FilePattern Specifies the file pattern to the .DOCX file(s) @@ -73,7 +73,7 @@ try { } [int]$Elapsed = $StopWatch.Elapsed.TotalSeconds - "βœ”οΈ converted in $Elapsed sec" + "βœ… converted in $Elapsed sec" exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -81,4 +81,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of convert-docx2md.ps1 as of 08/15/2024 09:50:47)* +*(generated by convert-ps2md.ps1 using the comment-based help of convert-docx2md.ps1 as of 11/08/2024 12:34:48)* diff --git a/docs/convert-frames2mp4.md b/docs/convert-frames2mp4.md index c06c500e..4ed76d55 100644 --- a/docs/convert-frames2mp4.md +++ b/docs/convert-frames2mp4.md @@ -60,4 +60,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of convert-frames2mp4.ps1 as of 08/15/2024 09:50:47)* +*(generated by convert-ps2md.ps1 using the comment-based help of convert-frames2mp4.ps1 as of 11/08/2024 12:34:48)* diff --git a/docs/convert-image2ascii.md b/docs/convert-image2ascii.md index 324eed5a..14263cde 100644 --- a/docs/convert-image2ascii.md +++ b/docs/convert-image2ascii.md @@ -114,4 +114,4 @@ Script Content } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of convert-image2ascii.ps1 as of 08/15/2024 09:50:47)* +*(generated by convert-ps2md.ps1 using the comment-based help of convert-image2ascii.ps1 as of 11/08/2024 12:34:48)* diff --git a/docs/convert-image2blurred-frames.md b/docs/convert-image2blurred-frames.md index 30f82c56..59f577a4 100644 --- a/docs/convert-image2blurred-frames.md +++ b/docs/convert-image2blurred-frames.md @@ -70,4 +70,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of convert-image2blurred-frames.ps1 as of 08/15/2024 09:50:47)* +*(generated by convert-ps2md.ps1 using the comment-based help of convert-image2blurred-frames.ps1 as of 11/08/2024 12:34:48)* diff --git a/docs/convert-image2pixelated-frames.md b/docs/convert-image2pixelated-frames.md index 27a01426..9ad1ef33 100644 --- a/docs/convert-image2pixelated-frames.md +++ b/docs/convert-image2pixelated-frames.md @@ -70,4 +70,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of convert-image2pixelated-frames.ps1 as of 08/15/2024 09:50:47)* +*(generated by convert-ps2md.ps1 using the comment-based help of convert-image2pixelated-frames.ps1 as of 11/08/2024 12:34:48)* diff --git a/docs/convert-md2docx.md b/docs/convert-md2docx.md index bf5e87fd..790aa32f 100644 --- a/docs/convert-md2docx.md +++ b/docs/convert-md2docx.md @@ -22,4 +22,4 @@ Script Content gci -r -i *.md |foreach{$docx=$_.directoryname+"\"+$_.basename+".docx";pandoc -f markdown -s --citeproc $_.name -o $docx} ``` -*(generated by convert-ps2md.ps1 using the comment-based help of convert-md2docx.ps1 as of 08/15/2024 09:50:47)* +*(generated by convert-ps2md.ps1 using the comment-based help of convert-md2docx.ps1 as of 11/08/2024 12:34:48)* diff --git a/docs/convert-md2html.md b/docs/convert-md2html.md index 40f462ef..6e62aea2 100644 --- a/docs/convert-md2html.md +++ b/docs/convert-md2html.md @@ -6,7 +6,7 @@ This PowerShell script converts Markdown file(s) into HTML. Parameters ---------- ```powershell -PS> ./convert-md2html.ps1 [[-FilePattern] ] [] +/home/markus/Repos/PowerShell/scripts/convert-md2html.ps1 [[-FilePattern] ] [] -FilePattern Specifies the file pattern to the Markdown file(s) @@ -72,7 +72,7 @@ try { pandoc --standalone --template "$PSScriptRoot/../data/templates/template.html" -s $_.name -o $TargetPath } [int]$Elapsed = $StopWatch.Elapsed.TotalSeconds - "βœ”οΈ converted in $Elapsed sec" + "βœ… converted in $Elapsed sec" exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -80,4 +80,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of convert-md2html.ps1 as of 08/15/2024 09:50:47)* +*(generated by convert-ps2md.ps1 using the comment-based help of convert-md2html.ps1 as of 11/08/2024 12:34:48)* diff --git a/docs/convert-md2pdf.md b/docs/convert-md2pdf.md index 44d5a68a..e283c736 100644 --- a/docs/convert-md2pdf.md +++ b/docs/convert-md2pdf.md @@ -20,4 +20,4 @@ Script Content gci -r -i *.md |foreach{$pdf=$_.directoryname+"\"+$_.basename+".pdf";pandoc -f markdown -s --citeproc $_.name -o $pdf} ``` -*(generated by convert-ps2md.ps1 using the comment-based help of convert-md2pdf.ps1 as of 08/15/2024 09:50:47)* +*(generated by convert-ps2md.ps1 using the comment-based help of convert-md2pdf.ps1 as of 11/08/2024 12:34:48)* diff --git a/docs/convert-mysql2csv.md b/docs/convert-mysql2csv.md index 5d0cc1ec..4b4ed0a5 100644 --- a/docs/convert-mysql2csv.md +++ b/docs/convert-mysql2csv.md @@ -6,7 +6,7 @@ This PowerShell script converts a MySQL database table to a .CSV file. Parameters ---------- ```powershell -PS> ./convert-mysql2csv.ps1 [[-server] ] [[-database] ] [[-username] ] [[-password] ] [[-query] ] [] +/home/markus/Repos/PowerShell/scripts/convert-mysql2csv.ps1 [[-server] ] [[-database] ] [[-username] ] [[-password] ] [[-query] ] [] -server Specifies the server's hostname or IP address @@ -119,4 +119,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of convert-mysql2csv.ps1 as of 08/15/2024 09:50:47)* +*(generated by convert-ps2md.ps1 using the comment-based help of convert-mysql2csv.ps1 as of 11/08/2024 12:34:48)* diff --git a/docs/convert-ps2bat.md b/docs/convert-ps2bat.md index b087c67a..8e27813e 100644 --- a/docs/convert-ps2bat.md +++ b/docs/convert-ps2bat.md @@ -6,7 +6,7 @@ This PowerShell script converts one or more PowerShell scripts to .bat batch fil Parameters ---------- ```powershell -PS> ./convert-ps2bat.ps1 [[-Filepattern] ] [] +/home/markus/Repos/PowerShell/scripts/convert-ps2bat.ps1 [[-Filepattern] ] [] -Filepattern Specifies the file pattern @@ -89,4 +89,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of convert-ps2bat.ps1 as of 08/15/2024 09:50:47)* +*(generated by convert-ps2md.ps1 using the comment-based help of convert-ps2bat.ps1 as of 11/08/2024 12:34:48)* diff --git a/docs/convert-ps2md.md b/docs/convert-ps2md.md index f715eda0..c37c16e6 100644 --- a/docs/convert-ps2md.md +++ b/docs/convert-ps2md.md @@ -6,7 +6,7 @@ This PowerShell script converts the comment-based help of a PowerShell script to Parameters ---------- ```powershell -PS> ./convert-ps2md.ps1 [[-filename] ] [] +/home/markus/Repos/PowerShell/scripts/convert-ps2md.ps1 [[-filename] ] [] -filename Specifies the path to the PowerShell script @@ -185,4 +185,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of convert-ps2md.ps1 as of 08/15/2024 09:50:47)* +*(generated by convert-ps2md.ps1 using the comment-based help of convert-ps2md.ps1 as of 11/08/2024 12:34:48)* diff --git a/docs/convert-sql2csv.md b/docs/convert-sql2csv.md index c6bab983..fcd96a08 100644 --- a/docs/convert-sql2csv.md +++ b/docs/convert-sql2csv.md @@ -6,7 +6,7 @@ This PowerShell script converts a SQL database table to a .CSV file. Parameters ---------- ```powershell -PS> ./convert-sql2csv.ps1 [[-server] ] [[-database] ] [[-username] ] [[-password] ] [[-query] ] [] +/home/markus/Repos/PowerShell/scripts/convert-sql2csv.ps1 [[-server] ] [[-database] ] [[-username] ] [[-password] ] [[-query] ] [] -server Specifies the server's hostname or IP address @@ -120,4 +120,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of convert-sql2csv.ps1 as of 08/15/2024 09:50:47)* +*(generated by convert-ps2md.ps1 using the comment-based help of convert-sql2csv.ps1 as of 11/08/2024 12:34:48)* diff --git a/docs/convert-txt2wav.md b/docs/convert-txt2wav.md index 48c5b036..e436f20e 100644 --- a/docs/convert-txt2wav.md +++ b/docs/convert-txt2wav.md @@ -6,7 +6,7 @@ This PowerShell script converts text to a .WAV audio file. Parameters ---------- ```powershell -PS> ./convert-txt2wav.ps1 [[-Text] ] [[-WavFile] ] [] +/home/markus/Repos/PowerShell/scripts/convert-txt2wav.ps1 [[-Text] ] [[-WavFile] ] [] -Text Specifies the text to use @@ -84,4 +84,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of convert-txt2wav.ps1 as of 08/15/2024 09:50:47)* +*(generated by convert-ps2md.ps1 using the comment-based help of convert-txt2wav.ps1 as of 11/08/2024 12:34:48)* diff --git a/docs/copy-photos-sorted.md b/docs/copy-photos-sorted.md index 27a19bca..6aeb5174 100644 --- a/docs/copy-photos-sorted.md +++ b/docs/copy-photos-sorted.md @@ -29,7 +29,7 @@ Script Content .EXAMPLE PS> ./copy-photos-sorted.ps1 D:\iPhone\DCIM C:\MyPhotos ⏳ Copying IMG_20240903_134445.jpg to C:\MyPhotos\2024\09 SEP\... - βœ”οΈ Copied 1 photo (0 skipped) to πŸ“‚C:\MyPhotos in 41s. + βœ… Copied 1 photo (0 skipped) to πŸ“‚C:\MyPhotos in 41s. .LINK https://github.com/fleschutz/PowerShell .NOTES @@ -107,7 +107,7 @@ try { } [int]$elapsed = $stopWatch.Elapsed.TotalSeconds [int]$copied = $files.Count - $skipped - "βœ”οΈ Copied $copied photos ($skipped skipped) to πŸ“‚$targetDir in $($elapsed)s." + "βœ… Copied $copied photos ($skipped skipped) to πŸ“‚$targetDir in $($elapsed)s." exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -115,4 +115,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of copy-photos-sorted.ps1 as of 08/15/2024 09:50:47)* +*(generated by convert-ps2md.ps1 using the comment-based help of copy-photos-sorted.ps1 as of 11/08/2024 12:34:48)* diff --git a/docs/count-characters.md b/docs/count-characters.md index a386828f..f58d434f 100644 --- a/docs/count-characters.md +++ b/docs/count-characters.md @@ -6,7 +6,7 @@ This PowerShell script counts the number of characters in the given string. Parameters ---------- ```powershell -PS> ./count-characters.ps1 [[-givenString] ] [] +/home/markus/Repos/PowerShell/scripts/count-characters.ps1 [[-givenString] ] [] -givenString Specifies the given string. @@ -26,7 +26,7 @@ Example ------- ```powershell PS> ./count-characters.ps1 "Hello World" -βœ”οΈ 11 characters counted in 'Hello World'. +βœ… 11 characters counted in 'Hello World'. ``` @@ -50,7 +50,7 @@ Script Content Specifies the given string. .EXAMPLE PS> ./count-characters.ps1 "Hello World" - βœ”οΈ 11 characters counted in 'Hello World'. + βœ… 11 characters counted in 'Hello World'. .LINK https://github.com/fleschutz/PowerShell .NOTES @@ -63,7 +63,7 @@ try { if ($givenString -eq "" ) { $givenString = Read-Host "Enter the string" } [int64]$numChars = $givenString.Length - "βœ”οΈ $numChars characters counted in '$givenString'." + "βœ… $numChars characters counted in '$givenString'." exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -71,4 +71,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of count-characters.ps1 as of 08/15/2024 09:50:47)* +*(generated by convert-ps2md.ps1 using the comment-based help of count-characters.ps1 as of 11/08/2024 12:34:48)* diff --git a/docs/count-lines.md b/docs/count-lines.md index 74fa9d8c..a7b83797 100644 --- a/docs/count-lines.md +++ b/docs/count-lines.md @@ -6,7 +6,7 @@ This PowerShell script counts the number of lines in text files (.txt/.md/.c/.h/ Parameters ---------- ```powershell -PS> ./count-lines.ps1 [[-pathToDirTree] ] [] +/home/markus/Repos/PowerShell/scripts/count-lines.ps1 [[-pathToDirTree] ] [] -pathToDirTree Specifies the path to the directory tree. @@ -26,7 +26,7 @@ Example ------- ```powershell PS> ./count-lines.ps1 C:\Repos\cmake -βœ”οΈ Found 639921 lines in 11411 text files within πŸ“‚cmake in 34 sec. +βœ… Found 639921 lines in 11411 text files within πŸ“‚cmake in 34 sec. ``` @@ -50,7 +50,7 @@ Script Content Specifies the path to the directory tree. .EXAMPLE PS> ./count-lines.ps1 C:\Repos\cmake - βœ”οΈ Found 639921 lines in 11411 text files within πŸ“‚cmake in 34 sec. + βœ… Found 639921 lines in 11411 text files within πŸ“‚cmake in 34 sec. .LINK https://github.com/fleschutz/PowerShell .NOTES @@ -75,7 +75,7 @@ try { $folderName = (Get-Item "$pathToDirTree").Name Write-Progress -completed " " [int]$Elapsed = $stopWatch.Elapsed.TotalSeconds - "βœ”οΈ Found $numLines lines in $numFiles text files within πŸ“‚$folderName in $Elapsed sec." + "βœ… Found $numLines lines in $numFiles text files within πŸ“‚$folderName in $Elapsed sec." exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -83,4 +83,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of count-lines.ps1 as of 08/15/2024 09:50:47)* +*(generated by convert-ps2md.ps1 using the comment-based help of count-lines.ps1 as of 11/08/2024 12:34:48)* diff --git a/docs/decrypt-file.md b/docs/decrypt-file.md index b06db7ad..492e2dbe 100644 --- a/docs/decrypt-file.md +++ b/docs/decrypt-file.md @@ -6,7 +6,7 @@ This PowerShell script decrypts a file using the given password and AES encrypti Parameters ---------- ```powershell -PS> ./decrypt-file.ps1 [[-Path] ] [[-Password] ] [] +/home/markus/Repos/PowerShell/scripts/decrypt-file.ps1 [[-Path] ] [[-Password] ] [] -Path Specifies the path to the file to decrypt @@ -189,7 +189,7 @@ try { DecryptFile "$Path" -Algorithm AES -KeyAsPlainText $PasswordBase64 -RemoveSource [int]$Elapsed = $StopWatch.Elapsed.TotalSeconds - "βœ”οΈ file decrypted in $Elapsed sec" + "βœ… file decrypted in $Elapsed sec" exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -197,4 +197,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of decrypt-file.ps1 as of 08/15/2024 09:50:47)* +*(generated by convert-ps2md.ps1 using the comment-based help of decrypt-file.ps1 as of 11/08/2024 12:34:48)* diff --git a/docs/disable-ipv6.md b/docs/disable-ipv6.md index 24bb868b..7ff73f49 100644 --- a/docs/disable-ipv6.md +++ b/docs/disable-ipv6.md @@ -6,7 +6,7 @@ This PowerShell script disables IPv6 on all network interfaces of the local comp Parameters ---------- ```powershell -PS> ./disable-ipv6.ps1 [] +/home/markus/Repos/PowerShell/scripts/disable-ipv6.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -48,7 +48,7 @@ Script Content try { Disable-NetAdapterBinding -Name '*' -ComponentID 'ms_tcpip6' - "βœ”οΈ IPv6 is disabled now." + "βœ… IPv6 is disabled now." exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -56,4 +56,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of disable-ipv6.ps1 as of 08/15/2024 09:50:47)* +*(generated by convert-ps2md.ps1 using the comment-based help of disable-ipv6.ps1 as of 11/08/2024 12:34:48)* diff --git a/docs/disconnect-vpn.md b/docs/disconnect-vpn.md index d3775f92..51113790 100644 --- a/docs/disconnect-vpn.md +++ b/docs/disconnect-vpn.md @@ -6,7 +6,7 @@ This PowerShell script disconnects the active VPN connection. Parameters ---------- ```powershell -PS> ./disconnect-vpn.ps1 [] +/home/markus/Repos/PowerShell/scripts/disconnect-vpn.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -63,4 +63,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of disconnect-vpn.ps1 as of 08/15/2024 09:50:47)* +*(generated by convert-ps2md.ps1 using the comment-based help of disconnect-vpn.ps1 as of 11/08/2024 12:34:48)* diff --git a/docs/download-dir.md b/docs/download-dir.md index d5ac55d8..f34ce4d3 100644 --- a/docs/download-dir.md +++ b/docs/download-dir.md @@ -6,7 +6,7 @@ This PowerShell script downloads a folder (including subfolders) from the given Parameters ---------- ```powershell -PS> ./download-dir.ps1 [[-URL] ] [] +/home/markus/Repos/PowerShell/scripts/download-dir.ps1 [[-URL] ] [] -URL Specifies the URL where to download from @@ -69,7 +69,7 @@ try { if ($lastExitCode -ne "0") { throw "Can't execute 'wget --mirror $URL'" } [int]$Elapsed = $StopWatch.Elapsed.TotalSeconds - "βœ”οΈ downloaded directory from $URL in $Elapsed sec" + "βœ… downloaded directory from $URL in $Elapsed sec" exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -77,4 +77,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of download-dir.ps1 as of 08/15/2024 09:50:47)* +*(generated by convert-ps2md.ps1 using the comment-based help of download-dir.ps1 as of 11/08/2024 12:34:48)* diff --git a/docs/download-file.md b/docs/download-file.md index 4b630755..dff4397a 100644 --- a/docs/download-file.md +++ b/docs/download-file.md @@ -6,7 +6,7 @@ This PowerShell script downloads a file from the given URL Parameters ---------- ```powershell -PS> ./download-file.ps1 [[-URL] ] [] +/home/markus/Repos/PowerShell/scripts/download-file.ps1 [[-URL] ] [] -URL Specifies the URL where to download from @@ -69,7 +69,7 @@ try { if ($lastExitCode -ne "0") { throw "Can't execute 'wget --mirror $URL'" } [int]$Elapsed = $StopWatch.Elapsed.TotalSeconds - "βœ”οΈ downloaded file from $URL in $Elapsed sec" + "βœ… downloaded file from $URL in $Elapsed sec" exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -77,4 +77,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of download-file.ps1 as of 08/15/2024 09:50:47)* +*(generated by convert-ps2md.ps1 using the comment-based help of download-file.ps1 as of 11/08/2024 12:34:48)* diff --git a/docs/edit.md b/docs/edit.md index 818efc00..580c736a 100644 --- a/docs/edit.md +++ b/docs/edit.md @@ -6,7 +6,7 @@ This PowerShell script opens a text editor with the given text file. Parameters ---------- ```powershell -PS> ./edit.ps1 [[-path] ] [] +/home/markus/Repos/PowerShell/scripts/edit.ps1 [[-path] ] [] -path Specifies the path to the text file (will be queried if none given) @@ -59,7 +59,7 @@ param([string]$path = "") function TryEditor { param([string]$editor, [string]$path) try { - Write-Host -noNewline "$editorΒ·" + Write-Host "$editor.." -noNewline & $editor "$path" if ($lastExitCode -ne "0") { "⚠️ Can't execute '$editor' - make sure it's installed and available" @@ -74,7 +74,8 @@ function TryEditor { param([string]$editor, [string]$path) try { if ($path -eq "" ) { $path = Read-Host "Enter the path to the text file" } - Write-Host -noNewline "Trying " + Write-Host "Searching for " -noNewline + TryEditor "neovim" $path TryEditor "vim" $path TryEditor "vi" $path TryEditor "nano" $path @@ -92,4 +93,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of edit.ps1 as of 08/15/2024 09:50:47)* +*(generated by convert-ps2md.ps1 using the comment-based help of edit.ps1 as of 11/08/2024 12:34:48)* diff --git a/docs/enable-crash-dumps.md b/docs/enable-crash-dumps.md index f908a47c..24d1d798 100644 --- a/docs/enable-crash-dumps.md +++ b/docs/enable-crash-dumps.md @@ -6,7 +6,7 @@ This PowerShell script enables the writing of crash dumps. Parameters ---------- ```powershell -PS> ./enable-crash-dumps.ps1 [] +/home/markus/Repos/PowerShell/scripts/enable-crash-dumps.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -330,4 +330,4 @@ Else exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of enable-crash-dumps.ps1 as of 08/15/2024 09:50:47)* +*(generated by convert-ps2md.ps1 using the comment-based help of enable-crash-dumps.ps1 as of 11/08/2024 12:34:48)* diff --git a/docs/enable-god-mode.md b/docs/enable-god-mode.md index 64097ce0..cc114bc1 100644 --- a/docs/enable-god-mode.md +++ b/docs/enable-god-mode.md @@ -6,7 +6,7 @@ This PowerShell script enables the god mode in Windows. It adds a new icon to th Parameters ---------- ```powershell -PS> ./enable-god-mode.ps1 [] +/home/markus/Repos/PowerShell/scripts/enable-god-mode.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -53,7 +53,7 @@ try { ItemType = 'Directory' } $null = New-Item @GodModeSplat - "βœ”οΈ God mode enabled, please click the new desktop icon" + "βœ… God mode enabled, please click the new desktop icon" exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -61,4 +61,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of enable-god-mode.ps1 as of 08/15/2024 09:50:47)* +*(generated by convert-ps2md.ps1 using the comment-based help of enable-god-mode.ps1 as of 11/08/2024 12:34:48)* diff --git a/docs/enable-ipv6.md b/docs/enable-ipv6.md index ab139788..f1bd2ba0 100644 --- a/docs/enable-ipv6.md +++ b/docs/enable-ipv6.md @@ -6,7 +6,7 @@ This PowerShell script enables IPv6 on all network interfaces of the local compu Parameters ---------- ```powershell -PS> ./enable-ipv6.ps1 [] +/home/markus/Repos/PowerShell/scripts/enable-ipv6.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -48,7 +48,7 @@ Script Content try { Enable-NetAdapterBinding -Name '*' -ComponentID 'ms_tcpip6' - "βœ”οΈ IPv6 is enabled now." + "βœ… IPv6 is enabled now." exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -56,4 +56,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of enable-ipv6.ps1 as of 08/15/2024 09:50:47)* +*(generated by convert-ps2md.ps1 using the comment-based help of enable-ipv6.ps1 as of 11/08/2024 12:34:48)* diff --git a/docs/encrypt-file.md b/docs/encrypt-file.md index 4a67a4fa..65430c5c 100644 --- a/docs/encrypt-file.md +++ b/docs/encrypt-file.md @@ -6,7 +6,7 @@ This PowerShell script encrypts a file using the given password and AES encrypti Parameters ---------- ```powershell -PS> ./encrypt-file.ps1 [[-Path] ] [[-Password] ] [] +/home/markus/Repos/PowerShell/scripts/encrypt-file.ps1 [[-Path] ] [[-Password] ] [] -Path Specifies the path to the file to encrypt @@ -174,7 +174,7 @@ try { EncryptFile "$Path" -Algorithm AES -KeyAsPlainText $PasswordAsBase64 -RemoveSource [int]$Elapsed = $StopWatch.Elapsed.TotalSeconds - "βœ”οΈ file encrypted in $Elapsed sec" + "βœ… file encrypted in $Elapsed sec" exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -182,4 +182,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of encrypt-file.ps1 as of 08/15/2024 09:50:47)* +*(generated by convert-ps2md.ps1 using the comment-based help of encrypt-file.ps1 as of 11/08/2024 12:34:49)* diff --git a/docs/enter-chat.md b/docs/enter-chat.md index 90d7a6cf..fb4be83f 100644 --- a/docs/enter-chat.md +++ b/docs/enter-chat.md @@ -6,7 +6,7 @@ This PowerShell script enters a chat using a common network shared file. Parameters ---------- ```powershell -PS> ./enter-chat.ps1 [] +/home/markus/Repos/PowerShell/scripts/enter-chat.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -125,4 +125,4 @@ function Get-ChatChannel } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of enter-chat.ps1 as of 08/15/2024 09:50:47)* +*(generated by convert-ps2md.ps1 using the comment-based help of enter-chat.ps1 as of 11/08/2024 12:34:49)* diff --git a/docs/enter-host.md b/docs/enter-host.md new file mode 100644 index 00000000..5b5f2c6e --- /dev/null +++ b/docs/enter-host.md @@ -0,0 +1,97 @@ +Script: *enter-host.ps1* +======================== + +This PowerShell script logs into a remote host via secure shell (SSH). + +Parameters +---------- +```powershell +/home/markus/Repos/PowerShell/scripts/enter-host.ps1 [[-remoteHost] ] [] + +-remoteHost + Specifies the remote hostname or IP address + + Required? false + Position? 1 + Default value + Accept pipeline input? false + Accept wildcard characters? false + +[] + This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, + WarningVariable, OutBuffer, PipelineVariable, and OutVariable. +``` + +Example +------- +```powershell +PS> ./enter-host.ps1 tux +βœ… tux is up and running (3ms latency). +⏳ Connecting as user 'markus' using OpenSSH_for_Windows_9.5p1, LibreSSL 3.8.2 +markus@tux's password: +... + +``` + +Notes +----- +Author: Markus Fleschutz | License: CC0 + +Related Links +------------- +https://github.com/fleschutz/PowerShell + +Script Content +-------------- +```powershell +<# +.SYNOPSIS + Enter another host via SSH +.DESCRIPTION + This PowerShell script logs into a remote host via secure shell (SSH). +.PARAMETER remoteHost + Specifies the remote hostname or IP address +.EXAMPLE + PS> ./enter-host.ps1 tux + βœ… tux is up and running (3ms latency). + ⏳ Connecting as user 'markus' using OpenSSH_for_Windows_9.5p1, LibreSSL 3.8.2 + markus@tux's password: + ... +.LINK + https://github.com/fleschutz/PowerShell +.NOTES + Author: Markus Fleschutz | License: CC0 +#> + +param([string]$remoteHost = "") + +try { + if ($remoteHost -eq "") { + $remoteHost = Read-Host "Enter the remote hostname or IP address" + $remoteUser = Read-Host "Enter the username at $remoteHost" + } elseif ($IsLinux) { + $remoteUser = $(whoami) + } else { + $remoteUser = $env:USERNAME + $remoteUser = $remoteUser.toLower() + } + + & "$PSScriptRoot/ping-host.ps1" $remoteHost + if ($lastExitCode -ne "0") { + Write-Host "Let's try to wake '$remoteHost' up..." + & "$PSScriptRoot/wake-up-host.ps1" + } + + Write-Host "⏳ Connecting as user '$remoteUser' using " -noNewline + & ssh -V + if ($lastExitCode -ne "0") { throw "'ssh -V' failed with exit code $lastExitCode" } + + & ssh "$($remoteUser)@$($remoteHost)" + exit 0 # success +} catch { + "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" + exit 1 +} +``` + +*(generated by convert-ps2md.ps1 using the comment-based help of enter-host.ps1 as of 11/08/2024 12:34:49)* diff --git a/docs/export-to-manuals.md b/docs/export-to-manuals.md index 27365157..c3d4491f 100644 --- a/docs/export-to-manuals.md +++ b/docs/export-to-manuals.md @@ -6,7 +6,7 @@ This PowerShell script exports the comment-based help of all PowerShell scripts Parameters ---------- ```powershell -PS> ./export-to-manuals.ps1 [[-filePattern] ] [[-targetDir] ] [] +/home/markus/Repos/PowerShell/scripts/export-to-manuals.ps1 [[-filePattern] ] [[-targetDir] ] [] -filePattern @@ -35,7 +35,7 @@ Example PS> ./export-to-manuals.ps1 ⏳ (1/2) Reading PowerShell scripts from /home/mf/PowerShell/scripts/*.ps1 ... ⏳ (2/2) Exporting Markdown manuals to /home/mf/PowerShell/docs ... -βœ”οΈ Exported 518 Markdown manuals in 28 sec. +βœ… Exported 518 Markdown manuals in 28 sec. ``` @@ -59,7 +59,7 @@ Script Content PS> ./export-to-manuals.ps1 ⏳ (1/2) Reading PowerShell scripts from /home/mf/PowerShell/scripts/*.ps1 ... ⏳ (2/2) Exporting Markdown manuals to /home/mf/PowerShell/docs ... - βœ”οΈ Exported 518 Markdown manuals in 28 sec. + βœ… Exported 518 Markdown manuals in 28 sec. .LINK https://github.com/fleschutz/PowerShell .NOTES @@ -82,7 +82,7 @@ try { } [int]$elapsed = $stopWatch.Elapsed.TotalSeconds - "βœ”οΈ Exported $($scripts.Count) Markdown manuals in $elapsed sec." + "βœ… Exported $($scripts.Count) Markdown manuals in $elapsed sec." exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -90,4 +90,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of export-to-manuals.ps1 as of 08/15/2024 09:50:47)* +*(generated by convert-ps2md.ps1 using the comment-based help of export-to-manuals.ps1 as of 11/08/2024 12:34:49)* diff --git a/docs/fetch-repo.md b/docs/fetch-repo.md index 39856a2a..42e859ca 100644 --- a/docs/fetch-repo.md +++ b/docs/fetch-repo.md @@ -6,9 +6,10 @@ This PowerShell script fetches remote updates into a local Git repository (inclu Parameters ---------- ```powershell -PS> ./fetch-repo.ps1 [[-pathToRepo] ] [] +/home/markus/Repos/PowerShell/scripts/fetch-repo.ps1 [[-path] ] [] --pathToRepo +-path + Specifies the file path to the local Git repository (default is working directory). Required? false Position? 1 @@ -27,8 +28,8 @@ Example PS> ./fetch-repo.ps1 ⏳ (1/3) Searching for Git executable... git version 2.41.0.windows.3 ⏳ (2/3) Checking local repository... C:\Repos\rust -⏳ (3/3) Fetching updates... -βœ”οΈ Fetched updates into πŸ“‚rust repo in 2s. +⏳ (3/3) Fetching updates (including submodules)... +βœ… Updates fetched into πŸ“‚rust repo in 2s. ``` @@ -48,39 +49,39 @@ Script Content Fetches updates into a Git repo .DESCRIPTION This PowerShell script fetches remote updates into a local Git repository (including submodules). -.PARAMETER RepoDir +.PARAMETER path Specifies the file path to the local Git repository (default is working directory). .EXAMPLE PS> ./fetch-repo.ps1 ⏳ (1/3) Searching for Git executable... git version 2.41.0.windows.3 ⏳ (2/3) Checking local repository... C:\Repos\rust - ⏳ (3/3) Fetching updates... - βœ”οΈ Fetched updates into πŸ“‚rust repo in 2s. + ⏳ (3/3) Fetching updates (including submodules)... + βœ… Updates fetched into πŸ“‚rust repo in 2s. .LINK https://github.com/fleschutz/PowerShell .NOTES Author: Markus Fleschutz | License: CC0 #> -param([string]$pathToRepo = "$PWD") +param([string]$path = "$PWD") try { $stopWatch = [system.diagnostics.stopwatch]::startNew() - Write-Host "⏳ (1/3) Searching for Git executable... " -noNewline + Write-Host "⏳ (1/3) Searching for Git executable... " -noNewline & git --version if ($lastExitCode -ne "0") { throw "Can't execute 'git' - make sure Git is installed and available" } - Write-Host "⏳ (2/3) Checking local repository... $pathToRepo" - if (!(Test-Path "$pathToRepo" -pathType container)) { throw "Can't access folder: $pathToRepo" } - $repoDirName = (Get-Item "$pathToRepo").Name + Write-Host "⏳ (2/3) Checking local repository... $path" + if (!(Test-Path "$path" -pathType container)) { throw "Can't access folder: $path" } + $repoDirName = (Get-Item "$path").Name - Write-Host "⏳ (3/3) Fetching updates..." - & git -C "$pathToRepo" fetch --all --recurse-submodules --tags --prune --prune-tags --force --quiet + Write-Host "⏳ (3/3) Fetching updates (including submodules)..." + & git -C "$path" fetch --all --recurse-submodules --tags --prune --prune-tags --force --quiet if ($lastExitCode -ne "0") { throw "'git fetch --all' failed with exit code $lastExitCode" } [int]$elapsed = $stopWatch.Elapsed.TotalSeconds - "βœ”οΈ Fetched updates into πŸ“‚$repoDirName repo in $($elapsed)s." + "βœ… Updates fetched into πŸ“‚$repoDirName repo in $($elapsed)s." exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -88,4 +89,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of fetch-repo.ps1 as of 08/15/2024 09:50:47)* +*(generated by convert-ps2md.ps1 using the comment-based help of fetch-repo.ps1 as of 11/08/2024 12:34:49)* diff --git a/docs/fetch-repos.md b/docs/fetch-repos.md index 639c3ff7..5dd70879 100644 --- a/docs/fetch-repos.md +++ b/docs/fetch-repos.md @@ -6,7 +6,7 @@ This PowerShell script fetches updates into all Git repositories in a folder (in Parameters ---------- ```powershell -PS> ./fetch-repos.ps1 [[-parentDirPath] ] [] +/home/markus/Repos/PowerShell/scripts/fetch-repos.ps1 [[-parentDirPath] ] [] -parentDirPath Specifies the path to the parent folder @@ -26,9 +26,9 @@ Example ------- ```powershell PS> ./fetch-repos.ps1 C:\MyRepos -⏳ (1) Searching for Git executable... git version 2.42.0 +⏳ (1) Searching for Git executable... git version 2.46.0.windows.1 ⏳ (2) Checking parent folder... 33 subfolders -⏳ (3/35) Fetching into πŸ“‚base256unicode... +⏳ (3/35) Fetching into πŸ“‚curl... ... ``` @@ -53,9 +53,9 @@ Script Content Specifies the path to the parent folder .EXAMPLE PS> ./fetch-repos.ps1 C:\MyRepos - ⏳ (1) Searching for Git executable... git version 2.42.0 + ⏳ (1) Searching for Git executable... git version 2.46.0.windows.1 ⏳ (2) Checking parent folder... 33 subfolders - ⏳ (3/35) Fetching into πŸ“‚base256unicode... + ⏳ (3/35) Fetching into πŸ“‚curl... ... .LINK https://github.com/fleschutz/PowerShell @@ -85,12 +85,12 @@ try { Write-Host "⏳ ($step/$($numFolders + 2)) Fetching into πŸ“‚$folderName...`t`t" & git -C "$folder" fetch --all --recurse-submodules --prune --prune-tags --force - if ($lastExitCode -ne "0") { throw "'git fetch --all' in $folder failed with exit code $lastExitCode" } + if ($lastExitCode -ne "0") { throw "'git fetch --all' in πŸ“‚$folder failed with exit code $lastExitCode" } $step++ } [int]$elapsed = $stopWatch.Elapsed.TotalSeconds - "βœ”οΈ Fetched updates into $numFolders repos under πŸ“‚$parentDirPathName in $elapsed sec" + "βœ… Fetched into $numFolders repos under πŸ“‚$parentDirPathName in $($elapsed)s." exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -98,4 +98,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of fetch-repos.ps1 as of 08/15/2024 09:50:47)* +*(generated by convert-ps2md.ps1 using the comment-based help of fetch-repos.ps1 as of 11/08/2024 12:34:49)* diff --git a/docs/firefox-installer.md b/docs/firefox-installer.md index ebe7e212..54d7a06c 100644 --- a/docs/firefox-installer.md +++ b/docs/firefox-installer.md @@ -6,7 +6,7 @@ Download and install latest firefox Parameters ---------- ```powershell -PS> ./firefox-installer.ps1 [] +/home/markus/Repos/PowerShell/scripts/firefox-installer.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -64,4 +64,4 @@ try { ``` -*(generated by convert-ps2md.ps1 using the comment-based help of firefox-installer.ps1 as of 08/15/2024 09:50:48)* +*(generated by convert-ps2md.ps1 using the comment-based help of firefox-installer.ps1 as of 11/08/2024 12:34:49)* diff --git a/docs/get-md5.md b/docs/get-md5.md index 97638c62..2bc966ce 100644 --- a/docs/get-md5.md +++ b/docs/get-md5.md @@ -6,7 +6,7 @@ This PowerShell script calculates and prints the MD5 checksum of the given file. Parameters ---------- ```powershell -PS> ./get-md5.ps1 [[-file] ] [] +/home/markus/Repos/PowerShell/scripts/get-md5.ps1 [[-file] ] [] -file Specifies the path to the file @@ -26,7 +26,7 @@ Example ------- ```powershell PS> ./get-md5 C:\MyFile.txt -βœ”οΈ MD5 hash is 041E16F16E60AD250EB794AF0681BD4A +βœ… MD5 hash is 041E16F16E60AD250EB794AF0681BD4A ``` @@ -50,7 +50,7 @@ Script Content Specifies the path to the file .EXAMPLE PS> ./get-md5 C:\MyFile.txt - βœ”οΈ MD5 hash is 041E16F16E60AD250EB794AF0681BD4A + βœ… MD5 hash is 041E16F16E60AD250EB794AF0681BD4A .LINK https://github.com/fleschutz/PowerShell .NOTES @@ -64,7 +64,7 @@ try { $Result = Get-Filehash $file -algorithm MD5 - "βœ”οΈ MD5 hash is $($Result.Hash)" + "βœ… MD5 hash is $($Result.Hash)" exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -72,4 +72,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of get-md5.ps1 as of 08/15/2024 09:50:48)* +*(generated by convert-ps2md.ps1 using the comment-based help of get-md5.ps1 as of 11/08/2024 12:34:49)* diff --git a/docs/get-sha1.md b/docs/get-sha1.md index 841f2978..6fab40c3 100644 --- a/docs/get-sha1.md +++ b/docs/get-sha1.md @@ -6,7 +6,7 @@ This PowerShell script calculates and prints the SHA1 checksum of the given file Parameters ---------- ```powershell -PS> ./get-sha1.ps1 [[-file] ] [] +/home/markus/Repos/PowerShell/scripts/get-sha1.ps1 [[-file] ] [] -file Specifies the path to the file @@ -26,7 +26,7 @@ Example ------- ```powershell PS> ./get-sha1 C:\MyFile.txt -βœ”οΈ SHA1 hash is 8105D424D350E308AED92BD9DDEB74A1B53C5D7C +βœ… SHA1 hash is 8105D424D350E308AED92BD9DDEB74A1B53C5D7C ``` @@ -50,7 +50,7 @@ Script Content Specifies the path to the file .EXAMPLE PS> ./get-sha1 C:\MyFile.txt - βœ”οΈ SHA1 hash is 8105D424D350E308AED92BD9DDEB74A1B53C5D7C + βœ… SHA1 hash is 8105D424D350E308AED92BD9DDEB74A1B53C5D7C .LINK https://github.com/fleschutz/PowerShell .NOTES @@ -64,7 +64,7 @@ try { $Result = get-filehash $file -algorithm SHA1 - "βœ”οΈ SHA1 hash is $($Result.Hash)" + "βœ… SHA1 hash is $($Result.Hash)" exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -72,4 +72,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of get-sha1.ps1 as of 08/15/2024 09:50:48)* +*(generated by convert-ps2md.ps1 using the comment-based help of get-sha1.ps1 as of 11/08/2024 12:34:49)* diff --git a/docs/get-sha256.md b/docs/get-sha256.md index 0cb653b5..58e534af 100644 --- a/docs/get-sha256.md +++ b/docs/get-sha256.md @@ -6,7 +6,7 @@ This PowerShell script calculates and prints the SHA256 checksum of the given fi Parameters ---------- ```powershell -PS> ./get-sha256.ps1 [[-file] ] [] +/home/markus/Repos/PowerShell/scripts/get-sha256.ps1 [[-file] ] [] -file Specifies the path to the file @@ -26,7 +26,7 @@ Example ------- ```powershell PS> ./get-sha256 C:\MyFile.txt -βœ”οΈ SHA256 hash is: CEB4AD71524996EB8AA3ADCE04F1E45636A4B58B8BF4462E6971CF2E56B4293E +βœ… SHA256 hash is: CEB4AD71524996EB8AA3ADCE04F1E45636A4B58B8BF4462E6971CF2E56B4293E ``` @@ -50,7 +50,7 @@ Script Content Specifies the path to the file .EXAMPLE PS> ./get-sha256 C:\MyFile.txt - βœ”οΈ SHA256 hash is: CEB4AD71524996EB8AA3ADCE04F1E45636A4B58B8BF4462E6971CF2E56B4293E + βœ… SHA256 hash is: CEB4AD71524996EB8AA3ADCE04F1E45636A4B58B8BF4462E6971CF2E56B4293E .LINK https://github.com/fleschutz/PowerShell .NOTES @@ -64,7 +64,7 @@ try { $Result = get-filehash $file -algorithm SHA256 - "βœ”οΈ SHA256 hash is: $($Result.Hash)" + "βœ… SHA256 hash is: $($Result.Hash)" exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -72,4 +72,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of get-sha256.ps1 as of 08/15/2024 09:50:48)* +*(generated by convert-ps2md.ps1 using the comment-based help of get-sha256.ps1 as of 11/08/2024 12:34:49)* diff --git a/docs/hello-world.md b/docs/hello-world.md new file mode 100644 index 00000000..491a04c8 --- /dev/null +++ b/docs/hello-world.md @@ -0,0 +1,53 @@ +Script: *hello-world.ps1* +======================== + +This PowerShell script is a sample script writing "Hello World" to the console. + +Parameters +---------- +```powershell +/home/markus/Repos/PowerShell/scripts/hello-world.ps1 [] + +[] + This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, + WarningVariable, OutBuffer, PipelineVariable, and OutVariable. +``` + +Example +------- +```powershell +PS> ./hello-world.ps1 +Hello World + +``` + +Notes +----- +Author: Markus Fleschutz | License: CC0 + +Related Links +------------- +https://github.com/fleschutz/PowerShell + +Script Content +-------------- +```powershell +<# +.SYNOPSIS + Sample Script +.DESCRIPTION + This PowerShell script is a sample script writing "Hello World" to the console. +.EXAMPLE + PS> ./hello-world.ps1 + Hello World +.LINK + https://github.com/fleschutz/PowerShell +.NOTES + Author: Markus Fleschutz | License: CC0 +#> + +Write-Output "Hello World" +exit 0 # success +``` + +*(generated by convert-ps2md.ps1 using the comment-based help of hello-world.ps1 as of 11/08/2024 12:34:49)* diff --git a/docs/hibernate.md b/docs/hibernate.md index 1b4864e4..17971a9c 100644 --- a/docs/hibernate.md +++ b/docs/hibernate.md @@ -6,7 +6,7 @@ This PowerShell script hibernates the local computer immediately. Parameters ---------- ```powershell -PS> ./hibernate.ps1 [] +/home/markus/Repos/PowerShell/scripts/hibernate.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -59,4 +59,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of hibernate.ps1 as of 08/15/2024 09:50:48)* +*(generated by convert-ps2md.ps1 using the comment-based help of hibernate.ps1 as of 11/08/2024 12:34:49)* diff --git a/docs/import-vm.md b/docs/import-vm.md index 8c6a82f4..f3baa35f 100644 --- a/docs/import-vm.md +++ b/docs/import-vm.md @@ -23,4 +23,4 @@ Start-VM $VMName exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of import-vm.ps1 as of 08/15/2024 09:50:48)* +*(generated by convert-ps2md.ps1 using the comment-based help of import-vm.ps1 as of 11/08/2024 12:34:49)* diff --git a/docs/inspect-exe.md b/docs/inspect-exe.md index a0b9e21a..9f5ec9a3 100644 --- a/docs/inspect-exe.md +++ b/docs/inspect-exe.md @@ -6,7 +6,7 @@ This PowerShell script prints basic information of an executable file. Parameters ---------- ```powershell -PS> ./inspect-exe.ps1 [[-PathToExe] ] [] +/home/markus/Repos/PowerShell/scripts/inspect-exe.ps1 [[-PathToExe] ] [] -PathToExe Specifies the path to the executable file @@ -68,4 +68,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of inspect-exe.ps1 as of 08/15/2024 09:50:48)* +*(generated by convert-ps2md.ps1 using the comment-based help of inspect-exe.ps1 as of 11/08/2024 12:34:49)* diff --git a/docs/install-audacity.md b/docs/install-audacity.md index 5413b56e..95c728fb 100644 --- a/docs/install-audacity.md +++ b/docs/install-audacity.md @@ -6,7 +6,7 @@ This PowerShell script installs Audacity. Parameters ---------- ```powershell -PS> ./install-audacity.ps1 [] +/home/markus/Repos/PowerShell/scripts/install-audacity.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -58,4 +58,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of install-audacity.ps1 as of 08/15/2024 09:50:48)* +*(generated by convert-ps2md.ps1 using the comment-based help of install-audacity.ps1 as of 11/08/2024 12:34:49)* diff --git a/docs/install-basic-apps.md b/docs/install-basic-apps.md index b6b1b82a..547e47e0 100644 --- a/docs/install-basic-apps.md +++ b/docs/install-basic-apps.md @@ -7,7 +7,7 @@ NOTE: Apps from Microsoft Store are preferred (due to security and automatic upd Parameters ---------- ```powershell -PS> ./install-basic-apps.ps1 [] +/home/markus/Repos/PowerShell/scripts/install-basic-apps.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -21,7 +21,7 @@ PS> ./install-basic-apps.ps1 ⏳ (1) Loading data/basic-apps.csv... 37 apps listed ⏳ (2) Applications to install/upgrade: 7-Zip Β· Aquile Reader ... ... -βœ”οΈ Installed 37 basic apps (0 skipped) in 387 sec. +βœ… Installed 37 basic apps (0 skipped) in 387 sec. ``` @@ -47,7 +47,7 @@ Script Content ⏳ (1) Loading data/basic-apps.csv... 37 apps listed ⏳ (2) Applications to install/upgrade: 7-Zip Β· Aquile Reader ... ... - βœ”οΈ Installed 37 basic apps (0 skipped) in 387 sec. + βœ… Installed 37 basic apps (0 skipped) in 387 sec. .LINK https://github.com/fleschutz/PowerShell .NOTES @@ -85,7 +85,7 @@ try { } [int]$numInstalled = ($numEntries - $numSkipped) [int]$elapsed = $stopWatch.Elapsed.TotalSeconds - "βœ”οΈ Installed $numInstalled basic apps ($numSkipped skipped) in $elapsed sec." + "βœ… Installed $numInstalled basic apps ($numSkipped skipped) in $elapsed sec." exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -93,4 +93,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of install-basic-apps.ps1 as of 08/15/2024 09:50:48)* +*(generated by convert-ps2md.ps1 using the comment-based help of install-basic-apps.ps1 as of 11/08/2024 12:34:49)* diff --git a/docs/install-basic-snaps.md b/docs/install-basic-snaps.md index 2764cea6..05fb23b7 100644 --- a/docs/install-basic-snaps.md +++ b/docs/install-basic-snaps.md @@ -6,7 +6,7 @@ This PowerShell script installs 18 basic Linux snaps. Parameters ---------- ```powershell -PS> ./install-basic-snaps.ps1 [] +/home/markus/Repos/PowerShell/scripts/install-basic-snaps.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -70,7 +70,7 @@ try { sudo snap install plexmediaserver [int]$Elapsed = $StopWatch.Elapsed.TotalSeconds - "βœ”οΈ installed 19 Snaps in $Elapsed sec" + "βœ… installed 19 Snaps in $Elapsed sec" exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -78,4 +78,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of install-basic-snaps.ps1 as of 08/15/2024 09:50:48)* +*(generated by convert-ps2md.ps1 using the comment-based help of install-basic-snaps.ps1 as of 11/08/2024 12:34:49)* diff --git a/docs/install-calibre-server.md b/docs/install-calibre-server.md index 7275740d..44434b17 100644 --- a/docs/install-calibre-server.md +++ b/docs/install-calibre-server.md @@ -6,7 +6,7 @@ This PowerShell script installs and starts a local Calibre server as background Parameters ---------- ```powershell -PS> ./install-calibre-server.ps1 [[-port] ] [[-mediaFolder] ] [[-userDB] ] [[-logfile] ] [] +/home/markus/Repos/PowerShell/scripts/install-calibre-server.ps1 [[-port] ] [[-mediaFolder] ] [[-userDB] ] [[-logfile] ] [] -port Specifies the Web port number (8099 by default) @@ -111,7 +111,7 @@ try { & calibre-server --port $port --num-per-page 100 --userdb $userDB --log $logfile --daemonize $HOME/'Calibre Library' [int]$elapsed = $stopWatch.Elapsed.TotalSeconds - "βœ”οΈ Installed Calibre server on port $port in $($elapsed)s (media at: $mediaFolder, user DB: $userDB, log to: $logfile)" + "βœ… Installed Calibre server on port $port in $($elapsed)s (media at: $mediaFolder, user DB: $userDB, log to: $logfile)" exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -119,4 +119,4 @@ exit 1 } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of install-calibre-server.ps1 as of 08/15/2024 09:50:48)* +*(generated by convert-ps2md.ps1 using the comment-based help of install-calibre-server.ps1 as of 11/08/2024 12:34:49)* diff --git a/docs/install-chocolatey.md b/docs/install-chocolatey.md index 30ed6256..5cb1286d 100644 --- a/docs/install-chocolatey.md +++ b/docs/install-chocolatey.md @@ -6,7 +6,7 @@ This PowerShell script installs Chocolatey onto the local computer (needs admin Parameters ---------- ```powershell -PS> ./install-chocolatey.ps1 [] +/home/markus/Repos/PowerShell/scripts/install-chocolatey.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -56,4 +56,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of install-chocolatey.ps1 as of 08/15/2024 09:50:48)* +*(generated by convert-ps2md.ps1 using the comment-based help of install-chocolatey.ps1 as of 11/08/2024 12:34:49)* diff --git a/docs/install-chrome.md b/docs/install-chrome.md index bddb6014..fa176bd9 100644 --- a/docs/install-chrome.md +++ b/docs/install-chrome.md @@ -6,7 +6,7 @@ This PowerShell script installs the Google Chrome browser. Parameters ---------- ```powershell -PS> ./install-chrome.ps1 [] +/home/markus/Repos/PowerShell/scripts/install-chrome.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -58,4 +58,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of install-chrome.ps1 as of 08/15/2024 09:50:48)* +*(generated by convert-ps2md.ps1 using the comment-based help of install-chrome.ps1 as of 11/08/2024 12:34:49)* diff --git a/docs/install-crystal-disk-info.md b/docs/install-crystal-disk-info.md index 8e8b3f56..b2e9f8cb 100644 --- a/docs/install-crystal-disk-info.md +++ b/docs/install-crystal-disk-info.md @@ -6,7 +6,7 @@ This PowerShell script installs CrystalDiskInfo from the Microsoft Store. Parameters ---------- ```powershell -PS> ./install-crystal-disk-info.ps1 [] +/home/markus/Repos/PowerShell/scripts/install-crystal-disk-info.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -58,4 +58,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of install-crystal-disk-info.ps1 as of 08/15/2024 09:50:48)* +*(generated by convert-ps2md.ps1 using the comment-based help of install-crystal-disk-info.ps1 as of 11/08/2024 12:34:49)* diff --git a/docs/install-crystal-disk-mark.md b/docs/install-crystal-disk-mark.md index bf58c8bf..751b5fc0 100644 --- a/docs/install-crystal-disk-mark.md +++ b/docs/install-crystal-disk-mark.md @@ -6,7 +6,7 @@ This PowerShell script installs CrystalDiskMark from the Microsoft Store. Parameters ---------- ```powershell -PS> ./install-crystal-disk-mark.ps1 [] +/home/markus/Repos/PowerShell/scripts/install-crystal-disk-mark.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -58,4 +58,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of install-crystal-disk-mark.ps1 as of 08/15/2024 09:50:48)* +*(generated by convert-ps2md.ps1 using the comment-based help of install-crystal-disk-mark.ps1 as of 11/08/2024 12:34:49)* diff --git a/docs/install-discord.md b/docs/install-discord.md index f596a4bb..f0d50106 100644 --- a/docs/install-discord.md +++ b/docs/install-discord.md @@ -6,7 +6,7 @@ This PowerShell script installs Discord from the Microsoft Store. Parameters ---------- ```powershell -PS> ./install-discord.ps1 [] +/home/markus/Repos/PowerShell/scripts/install-discord.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -58,4 +58,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of install-discord.ps1 as of 08/15/2024 09:50:48)* +*(generated by convert-ps2md.ps1 using the comment-based help of install-discord.ps1 as of 11/08/2024 12:34:49)* diff --git a/docs/install-edge.md b/docs/install-edge.md index fdff7e91..78c57c72 100644 --- a/docs/install-edge.md +++ b/docs/install-edge.md @@ -6,7 +6,7 @@ This PowerShell script installs the Microsoft Edge Browser from the Microsoft St Parameters ---------- ```powershell -PS> ./install-edge.ps1 [] +/home/markus/Repos/PowerShell/scripts/install-edge.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -58,4 +58,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of install-edge.ps1 as of 08/15/2024 09:50:48)* +*(generated by convert-ps2md.ps1 using the comment-based help of install-edge.ps1 as of 11/08/2024 12:34:49)* diff --git a/docs/install-evcc.md b/docs/install-evcc.md index 224cd6e3..0729d983 100644 --- a/docs/install-evcc.md +++ b/docs/install-evcc.md @@ -6,7 +6,7 @@ This PowerShell script installs evcc. Sevcc is an extensible EV Charge Controlle Parameters ---------- ```powershell -PS> ./install-evcc.ps1 [] +/home/markus/Repos/PowerShell/scripts/install-evcc.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -69,7 +69,7 @@ try { throw "Sorry, only Linux installation currently supported" } [int]$Elapsed = $StopWatch.Elapsed.TotalSeconds - "βœ”οΈ evcc installed successfully in $Elapsed sec" + "βœ… evcc installed successfully in $Elapsed sec" exit 0 # success } catch { "Sorry: $($Error[0])" @@ -77,4 +77,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of install-evcc.ps1 as of 08/15/2024 09:50:48)* +*(generated by convert-ps2md.ps1 using the comment-based help of install-evcc.ps1 as of 11/08/2024 12:34:49)* diff --git a/docs/install-firefox.md b/docs/install-firefox.md index 52aa2b71..3bddf51a 100644 --- a/docs/install-firefox.md +++ b/docs/install-firefox.md @@ -6,7 +6,7 @@ This PowerShell script installs Mozilla Firefox from the Microsoft Store. Parameters ---------- ```powershell -PS> ./install-firefox.ps1 [] +/home/markus/Repos/PowerShell/scripts/install-firefox.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -58,4 +58,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of install-firefox.ps1 as of 08/15/2024 09:50:48)* +*(generated by convert-ps2md.ps1 using the comment-based help of install-firefox.ps1 as of 11/08/2024 12:34:49)* diff --git a/docs/install-git-extensions.md b/docs/install-git-extensions.md index 48e56959..95710939 100644 --- a/docs/install-git-extensions.md +++ b/docs/install-git-extensions.md @@ -6,7 +6,7 @@ This PowerShell script installs Git Extensions. Parameters ---------- ```powershell -PS> ./install-git-extensions.ps1 [] +/home/markus/Repos/PowerShell/scripts/install-git-extensions.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -58,4 +58,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of install-git-extensions.ps1 as of 08/15/2024 09:50:48)* +*(generated by convert-ps2md.ps1 using the comment-based help of install-git-extensions.ps1 as of 11/08/2024 12:34:49)* diff --git a/docs/install-git-for-windows.md b/docs/install-git-for-windows.md index c46f03dc..07a6a1bc 100644 --- a/docs/install-git-for-windows.md +++ b/docs/install-git-for-windows.md @@ -6,7 +6,7 @@ This PowerShell script installs Git for Windows. Parameters ---------- ```powershell -PS> ./install-git-for-windows.ps1 [] +/home/markus/Repos/PowerShell/scripts/install-git-for-windows.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -58,4 +58,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of install-git-for-windows.ps1 as of 08/15/2024 09:50:48)* +*(generated by convert-ps2md.ps1 using the comment-based help of install-git-for-windows.ps1 as of 11/08/2024 12:34:49)* diff --git a/docs/install-github-cli.md b/docs/install-github-cli.md index 39387d4d..67a480da 100644 --- a/docs/install-github-cli.md +++ b/docs/install-github-cli.md @@ -6,7 +6,7 @@ This PowerShell script installs the GitHub command-line interface (CLI). Parameters ---------- ```powershell -PS> ./install-github-cli.ps1 [] +/home/markus/Repos/PowerShell/scripts/install-github-cli.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -18,7 +18,7 @@ Example ```powershell PS> ./install-github-cli.ps1 ⏳ Installing GitHub CLI... -βœ” Installation of GitHub CLI took 17 sec +βœ” GitHub CLI installed successfully in 17s - to authenticate execute: 'gh auth login'. ``` @@ -41,7 +41,7 @@ Script Content .EXAMPLE PS> ./install-github-cli.ps1 ⏳ Installing GitHub CLI... - βœ” Installation of GitHub CLI took 17 sec + βœ” GitHub CLI installed successfully in 17s - to authenticate execute: 'gh auth login'. .LINK https://github.com/fleschutz/PowerShell .NOTES @@ -50,7 +50,7 @@ Script Content try { "⏳ Installing GitHub CLI..." - $StopWatch = [system.diagnostics.stopwatch]::startNew() + $stopWatch = [system.diagnostics.stopwatch]::startNew() if ($IsMacOS) { & brew install gh @@ -58,9 +58,10 @@ try { & sudo apt install gh } else { & winget install --id GitHub.cli + if ($lastExitCode -ne "0") { throw "Installation of GitHub CLI failed, maybe it's already installed." } } - [int]$Elapsed = $StopWatch.Elapsed.TotalSeconds - "βœ”οΈ Installation of GitHub CLI took $Elapsed sec" + [int]$elapsed = $stopWatch.Elapsed.TotalSeconds + "βœ… GitHub CLI installed successfully in $($elapsed)s - to authenticate execute: 'gh auth login'" exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -68,4 +69,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of install-github-cli.ps1 as of 08/15/2024 09:50:48)* +*(generated by convert-ps2md.ps1 using the comment-based help of install-github-cli.ps1 as of 11/08/2024 12:34:49)* diff --git a/docs/install-gitlab.md b/docs/install-gitlab.md new file mode 100644 index 00000000..a9d042c3 --- /dev/null +++ b/docs/install-gitlab.md @@ -0,0 +1,34 @@ +Script: *install-gitlab.ps1* +======================== + +install-gitlab.ps1 + + +Parameters +---------- +```powershell + + +[] + This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, + WarningVariable, OutBuffer, PipelineVariable, and OutVariable. +``` + +Script Content +-------------- +```powershell + +"1. Install and configure the necessary dependencies" +& sudo apt-get update +& sudo apt-get install -y curl openssh-server ca-certificates tzdata perl + + +# sudo apt-get install -y postfix + +"2. Add the GitLab package repository and install the package" +& curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.deb.sh | sudo bash + + +``` + +*(generated by convert-ps2md.ps1 using the comment-based help of install-gitlab.ps1 as of 11/08/2024 12:34:49)* diff --git a/docs/install-irfanview.md b/docs/install-irfanview.md index 77172f7a..bbf747e7 100644 --- a/docs/install-irfanview.md +++ b/docs/install-irfanview.md @@ -6,7 +6,7 @@ This PowerShell script installs IrfanView from the Microsoft Store. Parameters ---------- ```powershell -PS> ./install-irfanview.ps1 [] +/home/markus/Repos/PowerShell/scripts/install-irfanview.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -58,4 +58,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of install-irfanview.ps1 as of 08/15/2024 09:50:48)* +*(generated by convert-ps2md.ps1 using the comment-based help of install-irfanview.ps1 as of 11/08/2024 12:34:49)* diff --git a/docs/install-knot-resolver.md b/docs/install-knot-resolver.md index 94eb6cad..b89d5cf4 100644 --- a/docs/install-knot-resolver.md +++ b/docs/install-knot-resolver.md @@ -6,7 +6,7 @@ This PowerShell script installs Knot Resolver. Knot Resolver is a DNS resolver d Parameters ---------- ```powershell -PS> ./install-knot-resolver.ps1 [] +/home/markus/Repos/PowerShell/scripts/install-knot-resolver.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -62,7 +62,7 @@ try { & sudo snap start knot-resolver-gael [int]$Elapsed = $StopWatch.Elapsed.TotalSeconds - "βœ”οΈ installed Knot Resolver in $Elapsed sec" + "βœ… installed Knot Resolver in $Elapsed sec" exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -70,4 +70,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of install-knot-resolver.ps1 as of 08/15/2024 09:50:48)* +*(generated by convert-ps2md.ps1 using the comment-based help of install-knot-resolver.ps1 as of 11/08/2024 12:34:49)* diff --git a/docs/install-microsoft-teams.md b/docs/install-microsoft-teams.md index 5516370b..80da02d2 100644 --- a/docs/install-microsoft-teams.md +++ b/docs/install-microsoft-teams.md @@ -6,7 +6,7 @@ This PowerShell script installs Microsoft Teams from the Microsoft Store. Parameters ---------- ```powershell -PS> ./install-microsoft-teams.ps1 [] +/home/markus/Repos/PowerShell/scripts/install-microsoft-teams.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -58,4 +58,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of install-microsoft-teams.ps1 as of 08/15/2024 09:50:48)* +*(generated by convert-ps2md.ps1 using the comment-based help of install-microsoft-teams.ps1 as of 11/08/2024 12:34:49)* diff --git a/docs/install-netflix.md b/docs/install-netflix.md index 533df130..41dbd146 100644 --- a/docs/install-netflix.md +++ b/docs/install-netflix.md @@ -6,7 +6,7 @@ This PowerShell script installs Netflix from the Microsoft Store. Parameters ---------- ```powershell -PS> ./install-netflix.ps1 [] +/home/markus/Repos/PowerShell/scripts/install-netflix.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -58,4 +58,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of install-netflix.ps1 as of 08/15/2024 09:50:48)* +*(generated by convert-ps2md.ps1 using the comment-based help of install-netflix.ps1 as of 11/08/2024 12:34:49)* diff --git a/docs/install-obs-studio.md b/docs/install-obs-studio.md index a6a338b9..0f7f0c06 100644 --- a/docs/install-obs-studio.md +++ b/docs/install-obs-studio.md @@ -6,7 +6,7 @@ This PowerShell script installs OBS Studio (admin rights are needed). Parameters ---------- ```powershell -PS> ./install-obs-studio.ps1 [] +/home/markus/Repos/PowerShell/scripts/install-obs-studio.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -56,7 +56,7 @@ try { } [int]$Elapsed = $StopWatch.Elapsed.TotalSeconds - "βœ”οΈ installed OBS Studio in $Elapsed sec" + "βœ… installed OBS Studio in $Elapsed sec" exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -64,4 +64,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of install-obs-studio.ps1 as of 08/15/2024 09:50:48)* +*(generated by convert-ps2md.ps1 using the comment-based help of install-obs-studio.ps1 as of 11/08/2024 12:34:49)* diff --git a/docs/install-octoprint.md b/docs/install-octoprint.md index 472702ec..28ca4f1c 100644 --- a/docs/install-octoprint.md +++ b/docs/install-octoprint.md @@ -32,4 +32,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of install-octoprint.ps1 as of 08/15/2024 09:50:48)* +*(generated by convert-ps2md.ps1 using the comment-based help of install-octoprint.ps1 as of 11/08/2024 12:34:49)* diff --git a/docs/install-one-calendar.md b/docs/install-one-calendar.md index b80bba09..f69551ed 100644 --- a/docs/install-one-calendar.md +++ b/docs/install-one-calendar.md @@ -6,7 +6,7 @@ This PowerShell script installs One Calendar from the Microsoft Store. Parameters ---------- ```powershell -PS> ./install-one-calendar.ps1 [] +/home/markus/Repos/PowerShell/scripts/install-one-calendar.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -58,4 +58,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of install-one-calendar.ps1 as of 08/15/2024 09:50:48)* +*(generated by convert-ps2md.ps1 using the comment-based help of install-one-calendar.ps1 as of 11/08/2024 12:34:49)* diff --git a/docs/install-opera-browser.md b/docs/install-opera-browser.md index 9423f8da..8a29a4f9 100644 --- a/docs/install-opera-browser.md +++ b/docs/install-opera-browser.md @@ -6,7 +6,7 @@ This PowerShell script installs Opera Browser from Microsoft Store. Parameters ---------- ```powershell -PS> ./install-opera-browser.ps1 [] +/home/markus/Repos/PowerShell/scripts/install-opera-browser.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -58,4 +58,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of install-opera-browser.ps1 as of 08/15/2024 09:50:48)* +*(generated by convert-ps2md.ps1 using the comment-based help of install-opera-browser.ps1 as of 11/08/2024 12:34:49)* diff --git a/docs/install-opera-gx.md b/docs/install-opera-gx.md index eab162b4..abf3046a 100644 --- a/docs/install-opera-gx.md +++ b/docs/install-opera-gx.md @@ -6,7 +6,7 @@ This PowerShell script installs Opera GX from Microsoft Store. Parameters ---------- ```powershell -PS> ./install-opera-gx.ps1 [] +/home/markus/Repos/PowerShell/scripts/install-opera-gx.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -58,4 +58,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of install-opera-gx.ps1 as of 08/15/2024 09:50:48)* +*(generated by convert-ps2md.ps1 using the comment-based help of install-opera-gx.ps1 as of 11/08/2024 12:34:49)* diff --git a/docs/install-paint-3d.md b/docs/install-paint-3d.md index ebcd4fbb..925500d9 100644 --- a/docs/install-paint-3d.md +++ b/docs/install-paint-3d.md @@ -6,7 +6,7 @@ This PowerShell script installs Paint 3D from the Microsoft Store. Parameters ---------- ```powershell -PS> ./install-paint-3d.ps1 [] +/home/markus/Repos/PowerShell/scripts/install-paint-3d.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -58,4 +58,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of install-paint-3d.ps1 as of 08/15/2024 09:50:48)* +*(generated by convert-ps2md.ps1 using the comment-based help of install-paint-3d.ps1 as of 11/08/2024 12:34:49)* diff --git a/docs/install-power-toys.md b/docs/install-power-toys.md index 5ac30460..eb155524 100644 --- a/docs/install-power-toys.md +++ b/docs/install-power-toys.md @@ -6,7 +6,7 @@ This PowerShell script installs the Microsoft Powertoys. Parameters ---------- ```powershell -PS> ./install-power-toys.ps1 [] +/home/markus/Repos/PowerShell/scripts/install-power-toys.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -58,4 +58,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of install-power-toys.ps1 as of 08/15/2024 09:50:48)* +*(generated by convert-ps2md.ps1 using the comment-based help of install-power-toys.ps1 as of 11/08/2024 12:34:49)* diff --git a/docs/install-powershell.md b/docs/install-powershell.md index 1c66b56e..72ab11c2 100644 --- a/docs/install-powershell.md +++ b/docs/install-powershell.md @@ -7,9 +7,9 @@ If '-Daily' is specified, then the latest PowerShell daily package will be insta Parameters ---------- ```powershell -PS> ./install-powershell.ps1 [-Destination ] [-Daily] [-DoNotOverwrite] [-AddToPath] [-Preview] [] +/home/markus/Repos/PowerShell/scripts/install-powershell.ps1 [-Destination ] [-Daily] [-DoNotOverwrite] [-AddToPath] [-Preview] [] -PS> ./install-powershell.ps1 [-UseMSI] [-Quiet] [-AddExplorerContextMenu] [-EnablePSRemoting] [-Preview] [] +/home/markus/Repos/PowerShell/scripts/install-powershell.ps1 [-UseMSI] [-Quiet] [-AddExplorerContextMenu] [-EnablePSRemoting] [-Preview] [] -Destination The destination path to install PowerShell to. @@ -180,7 +180,11 @@ if (-not $Destination) { if ($IsWinEnv) { $Destination = "$env:LOCALAPPDATA\Microsoft\powershell" } else { - $Destination = "~/.powershell" + if (Test-Path -path "/opt/PowerShell" -pathType container) { + $Destination = "/opt/PowerShell" + } else { + $Destination = "~/.powershell" + } } if ($Daily) { @@ -228,16 +232,16 @@ function Expand-ArchiveInternal { } } -function Remove-Destination([string] $Destination) { - if (Test-Path -Path $Destination) { +function Remove-Destination([string]$Destination) { + if (Test-Path -path $Destination -pathType container) { if ($DoNotOverwrite) { throw "Destination folder '$Destination' already exist. Use a different path or omit '-DoNotOverwrite' to overwrite." } - Write-Host "⏳ (4/4) Removing old installation at $Destination" - if (Test-Path -Path "$Destination.old") { + if (Test-Path -path "$Destination.old") { Remove-Item "$Destination.old" -Recurse -Force } if ($IsWinEnv -and ($Destination -eq $PSHOME)) { + Write-Host "⏳ (3/4) Removing old installation at $Destination... " # handle the case where the updated folder is currently in use Get-ChildItem -Recurse -File -Path $PSHOME | ForEach-Object { if ($_.extension -eq ".old") { @@ -247,8 +251,9 @@ function Remove-Destination([string] $Destination) { } } } else { + Write-Host "⏳ (3/4) Moving old installation to $($Destination).old... " # Unix systems don't keep open file handles so you can just move files/folders even if in use - Move-Item "$Destination" "$Destination.old" + sudo mv "$Destination" "$($Destination).old" } } } @@ -466,7 +471,7 @@ try { tar zxf $packagePath -C $contentPath } } else { - Write-Host "⏳ (1/4) Loading metadata from https://raw.githubusercontent.com ..." + Write-Host "⏳ (1/4) Querying infos from https://raw.githubusercontent.com ..." $metadata = Invoke-RestMethod https://raw.githubusercontent.com/PowerShell/PowerShell/master/tools/metadata.json if ($Preview) { $release = $metadata.PreviewReleaseTag -replace '^v' @@ -489,10 +494,10 @@ try { } elseif ($IsMacOSEnv) { $packageName = "powershell-${release}-osx-${architecture}.tar.gz" } - Write-Host "⏳ (2/4) Latest release is $release for $architecture, package name is $packageName ..." + Write-Host " Latest release is $release for $architecture, package name is: $packageName" $downloadURL = "https://github.com/PowerShell/PowerShell/releases/download/v${release}/${packageName}" - Write-Host "⏳ (3/4) Loading $downloadURL" + Write-Host "⏳ (2/4) Loading $downloadURL" $packagePath = Join-Path -Path $tempDir -ChildPath $packageName if (!$PSVersionTable.ContainsKey('PSEdition') -or $PSVersionTable.PSEdition -eq "Desktop") { @@ -535,23 +540,34 @@ try { Expand-ArchiveInternal -Path $packagePath -DestinationPath $contentPath } } else { + Write-Host "⏳ (3/4) Extracting package to: $contentPath..." tar zxf $packagePath -C $contentPath } } if (-not $UseMSI) { - Remove-Destination $Destination + Write-Host "⏳ (4/5) Removing current installation at: $Destination ..." + if ($IsLinuxEnv) { + & sudo rm -rf "$Destination" + } else { + Remove-Destination "$Destination" + } + if (Test-Path $Destination) { - Write-Verbose "Copying files" -Verbose + Write-Host "⏳ (4/4) Copying files to $Destination... " # only copy files as folders will already exist at $Destination Get-ChildItem -Recurse -Path "$contentPath" -File | ForEach-Object { $DestinationFilePath = Join-Path $Destination $_.fullname.replace($contentPath, "") Copy-Item $_.fullname -Destination $DestinationFilePath } - } else { + } elseif ($IsWinEnv) { + Write-Host "⏳ (4/4) Moving new installation to $Destination... " $null = New-Item -Path (Split-Path -Path $Destination -Parent) -ItemType Directory -ErrorAction SilentlyContinue Move-Item -Path $contentPath -Destination $Destination - } + } else { + Write-Host "⏳ (4/4) Moving new installation to $Destination... " + & sudo mv "$contentPath" "$Destination" + } } ## Change the mode of 'pwsh' to 'rwxr-xr-x' to allow execution @@ -586,7 +602,7 @@ try { if ($IsLinuxEnv) { $symlink = "/usr/bin/pwsh" } elseif ($IsMacOSEnv) { $symlink = "/usr/local/bin/pwsh" } $needNewSymlink = $true - if (Test-Path -Path $symlink) { + if (Test-Path -path $symlink) { $linkItem = Get-Item -Path $symlink if ($linkItem.LinkType -ne "SymbolicLink") { Write-Warning "'$symlink' already exists but it's not a symbolic link. Abort adding to PATH." @@ -635,4 +651,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of install-powershell.ps1 as of 08/15/2024 09:50:48)* +*(generated by convert-ps2md.ps1 using the comment-based help of install-powershell.ps1 as of 11/08/2024 12:34:49)* diff --git a/docs/install-rufus.md b/docs/install-rufus.md index 8f3c65cb..2244888f 100644 --- a/docs/install-rufus.md +++ b/docs/install-rufus.md @@ -6,7 +6,7 @@ This PowerShell script installs Rufus from the Microsoft Store. Parameters ---------- ```powershell -PS> ./install-rufus.ps1 [] +/home/markus/Repos/PowerShell/scripts/install-rufus.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -58,4 +58,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of install-rufus.ps1 as of 08/15/2024 09:50:48)* +*(generated by convert-ps2md.ps1 using the comment-based help of install-rufus.ps1 as of 11/08/2024 12:34:49)* diff --git a/docs/install-salesforce-cli.md b/docs/install-salesforce-cli.md index bbe3dda4..ed6bf34d 100644 --- a/docs/install-salesforce-cli.md +++ b/docs/install-salesforce-cli.md @@ -6,7 +6,7 @@ This PowerShell script downloads and installs the Salesforce CLI on Windows. Parameters ---------- ```powershell -PS> ./install-salesforce-cli.ps1 [] +/home/markus/Repos/PowerShell/scripts/install-salesforce-cli.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -70,4 +70,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of install-salesforce-cli.ps1 as of 08/15/2024 09:50:48)* +*(generated by convert-ps2md.ps1 using the comment-based help of install-salesforce-cli.ps1 as of 11/08/2024 12:34:49)* diff --git a/docs/install-signal-cli.md b/docs/install-signal-cli.md index c8c519ef..a2cac615 100644 --- a/docs/install-signal-cli.md +++ b/docs/install-signal-cli.md @@ -7,7 +7,7 @@ See the Web page for the correct version number. Parameters ---------- ```powershell -PS> ./install-signal-cli.ps1 [[-Version] ] [] +/home/markus/Repos/PowerShell/scripts/install-signal-cli.ps1 [[-Version] ] [] -Version Specifies the version to install @@ -82,7 +82,7 @@ try { if ($lastExitCode -ne "0") { throw "'rm' failed" } [int]$Elapsed = $StopWatch.Elapsed.TotalSeconds - "βœ”οΈ 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 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -90,4 +90,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of install-signal-cli.ps1 as of 08/15/2024 09:50:48)* +*(generated by convert-ps2md.ps1 using the comment-based help of install-signal-cli.ps1 as of 11/08/2024 12:34:49)* diff --git a/docs/install-skype.md b/docs/install-skype.md index ec369bb8..585b0c3e 100644 --- a/docs/install-skype.md +++ b/docs/install-skype.md @@ -6,7 +6,7 @@ This PowerShell script installs Skype from the Microsoft Store. Parameters ---------- ```powershell -PS> ./install-skype.ps1 [] +/home/markus/Repos/PowerShell/scripts/install-skype.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -58,4 +58,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of install-skype.ps1 as of 08/15/2024 09:50:48)* +*(generated by convert-ps2md.ps1 using the comment-based help of install-skype.ps1 as of 11/08/2024 12:34:49)* diff --git a/docs/install-spotify.md b/docs/install-spotify.md index eaaa7718..f0ef0455 100644 --- a/docs/install-spotify.md +++ b/docs/install-spotify.md @@ -6,7 +6,7 @@ This PowerShell script installs Spotify from the Microsoft Store. Parameters ---------- ```powershell -PS> ./install-spotify.ps1 [] +/home/markus/Repos/PowerShell/scripts/install-spotify.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -58,4 +58,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of install-spotify.ps1 as of 08/15/2024 09:50:48)* +*(generated by convert-ps2md.ps1 using the comment-based help of install-spotify.ps1 as of 11/08/2024 12:34:49)* diff --git a/docs/install-ssh-client.md b/docs/install-ssh-client.md index dcaa55df..ae8b2bc8 100644 --- a/docs/install-ssh-client.md +++ b/docs/install-ssh-client.md @@ -6,7 +6,7 @@ This PowerShell script installs a SSH client (needs admin rights). Parameters ---------- ```powershell -PS> ./install-ssh-client.ps1 [] +/home/markus/Repos/PowerShell/scripts/install-ssh-client.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -56,7 +56,7 @@ try { } [int]$Elapsed = $StopWatch.Elapsed.TotalSeconds - "βœ”οΈ installed SSH client in $Elapsed sec" + "βœ… installed SSH client in $Elapsed sec" exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -64,4 +64,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of install-ssh-client.ps1 as of 08/15/2024 09:50:48)* +*(generated by convert-ps2md.ps1 using the comment-based help of install-ssh-client.ps1 as of 11/08/2024 12:34:49)* diff --git a/docs/install-ssh-server.md b/docs/install-ssh-server.md index 876a5732..deb01b53 100644 --- a/docs/install-ssh-server.md +++ b/docs/install-ssh-server.md @@ -6,7 +6,7 @@ This PowerShell script installs a SSH server (needs admin rights). Parameters ---------- ```powershell -PS> ./install-ssh-server.ps1 [] +/home/markus/Repos/PowerShell/scripts/install-ssh-server.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -70,7 +70,7 @@ try { } [int]$Elapsed = $StopWatch.Elapsed.TotalSeconds - "βœ”οΈ installed and started SSH server in $Elapsed sec" + "βœ… installed and started SSH server in $Elapsed sec" exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -78,4 +78,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of install-ssh-server.ps1 as of 08/15/2024 09:50:48)* +*(generated by convert-ps2md.ps1 using the comment-based help of install-ssh-server.ps1 as of 11/08/2024 12:34:49)* diff --git a/docs/install-thunderbird.md b/docs/install-thunderbird.md index e25e2088..176f8ac6 100644 --- a/docs/install-thunderbird.md +++ b/docs/install-thunderbird.md @@ -6,7 +6,7 @@ This PowerShell script installs Mozilla Thunderbird. Parameters ---------- ```powershell -PS> ./install-thunderbird.ps1 [] +/home/markus/Repos/PowerShell/scripts/install-thunderbird.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -58,4 +58,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of install-thunderbird.ps1 as of 08/15/2024 09:50:48)* +*(generated by convert-ps2md.ps1 using the comment-based help of install-thunderbird.ps1 as of 11/08/2024 12:34:49)* diff --git a/docs/install-twitter.md b/docs/install-twitter.md index 7cf40a97..2cfa18eb 100644 --- a/docs/install-twitter.md +++ b/docs/install-twitter.md @@ -6,7 +6,7 @@ This PowerShell script installs Twitter from the Microsoft Store. Parameters ---------- ```powershell -PS> ./install-twitter.ps1 [] +/home/markus/Repos/PowerShell/scripts/install-twitter.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -58,4 +58,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of install-twitter.ps1 as of 08/15/2024 09:50:48)* +*(generated by convert-ps2md.ps1 using the comment-based help of install-twitter.ps1 as of 11/08/2024 12:34:49)* diff --git a/docs/install-unbound-server.md b/docs/install-unbound-server.md index f8f9e7f3..57bb2280 100644 --- a/docs/install-unbound-server.md +++ b/docs/install-unbound-server.md @@ -6,7 +6,7 @@ This PowerShell script installs Unbound, a validating, recursive, caching DNS re Parameters ---------- ```powershell -PS> ./install-unbound-server.ps1 [] +/home/markus/Repos/PowerShell/scripts/install-unbound-server.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -91,7 +91,7 @@ try { if ($lastExitCode -ne "0") { throw "'unbound-control status' failed" } [int]$Elapsed = $StopWatch.Elapsed.TotalSeconds - "βœ”οΈ Installed Unbound in $Elapsed sec" + "βœ… Installed Unbound in $Elapsed sec" exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -99,4 +99,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of install-unbound-server.ps1 as of 08/15/2024 09:50:48)* +*(generated by convert-ps2md.ps1 using the comment-based help of install-unbound-server.ps1 as of 11/08/2024 12:34:49)* diff --git a/docs/install-updates.md b/docs/install-updates.md index 760b116d..b1f8cb64 100644 --- a/docs/install-updates.md +++ b/docs/install-updates.md @@ -7,7 +7,7 @@ NOTE: Use the script 'list-updates.ps1' to list the latest software updates befo Parameters ---------- ```powershell -PS> ./install-updates.ps1 [] +/home/markus/Repos/PowerShell/scripts/install-updates.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -110,4 +110,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of install-updates.ps1 as of 08/15/2024 09:50:48)* +*(generated by convert-ps2md.ps1 using the comment-based help of install-updates.ps1 as of 11/08/2024 12:34:49)* diff --git a/docs/install-visual-studio-code.md b/docs/install-visual-studio-code.md index 00f286e2..7af8820a 100644 --- a/docs/install-visual-studio-code.md +++ b/docs/install-visual-studio-code.md @@ -6,7 +6,7 @@ This PowerShell script installs Visual Studio Code. Parameters ---------- ```powershell -PS> ./install-visual-studio-code.ps1 [] +/home/markus/Repos/PowerShell/scripts/install-visual-studio-code.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -58,4 +58,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of install-visual-studio-code.ps1 as of 08/15/2024 09:50:48)* +*(generated by convert-ps2md.ps1 using the comment-based help of install-visual-studio-code.ps1 as of 11/08/2024 12:34:49)* diff --git a/docs/install-vivaldi.md b/docs/install-vivaldi.md index e55c4629..c4c85858 100644 --- a/docs/install-vivaldi.md +++ b/docs/install-vivaldi.md @@ -6,7 +6,7 @@ This PowerShell script installs the Vivaldi browser. Parameters ---------- ```powershell -PS> ./install-vivaldi.ps1 [] +/home/markus/Repos/PowerShell/scripts/install-vivaldi.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -58,4 +58,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of install-vivaldi.ps1 as of 08/15/2024 09:50:48)* +*(generated by convert-ps2md.ps1 using the comment-based help of install-vivaldi.ps1 as of 11/08/2024 12:34:49)* diff --git a/docs/install-vlc.md b/docs/install-vlc.md index fcb38cf2..e2832ca4 100644 --- a/docs/install-vlc.md +++ b/docs/install-vlc.md @@ -6,7 +6,7 @@ This PowerShell script installs the VLC media player. Parameters ---------- ```powershell -PS> ./install-vlc.ps1 [] +/home/markus/Repos/PowerShell/scripts/install-vlc.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -18,7 +18,7 @@ Example ```powershell PS> ./install-vlc.ps1 ⏳ Installing VLC media player... -βœ”οΈ Installation of VLC media player took 25 sec +βœ… Installation of VLC media player took 25 sec ``` @@ -41,7 +41,7 @@ Script Content .EXAMPLE PS> ./install-vlc.ps1 ⏳ Installing VLC media player... - βœ”οΈ Installation of VLC media player took 25 sec + βœ… Installation of VLC media player took 25 sec .LINK https://github.com/fleschutz/PowerShell .NOTES @@ -56,7 +56,7 @@ try { if ($lastExitCode -ne "0") { throw "Can't install VLC media player, is it already installed?" } [int]$Elapsed = $StopWatch.Elapsed.TotalSeconds - "βœ”οΈ Installation of VLC media player took $Elapsed sec" + "βœ… Installation of VLC media player took $Elapsed sec" exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -64,4 +64,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of install-vlc.ps1 as of 08/15/2024 09:50:48)* +*(generated by convert-ps2md.ps1 using the comment-based help of install-vlc.ps1 as of 11/08/2024 12:34:49)* diff --git a/docs/install-windows-terminal.md b/docs/install-windows-terminal.md index 0fdbe7ea..9496aa92 100644 --- a/docs/install-windows-terminal.md +++ b/docs/install-windows-terminal.md @@ -6,7 +6,7 @@ This PowerShell script installs Windows Terminal from the Microsoft Store. Parameters ---------- ```powershell -PS> ./install-windows-terminal.ps1 [] +/home/markus/Repos/PowerShell/scripts/install-windows-terminal.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -58,4 +58,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of install-windows-terminal.ps1 as of 08/15/2024 09:50:48)* +*(generated by convert-ps2md.ps1 using the comment-based help of install-windows-terminal.ps1 as of 11/08/2024 12:34:49)* diff --git a/docs/install-wsl.md b/docs/install-wsl.md index 8f223a92..615bc8f0 100644 --- a/docs/install-wsl.md +++ b/docs/install-wsl.md @@ -6,7 +6,7 @@ This PowerShell script installs Windows Subsystem for Linux. It needs admin righ Parameters ---------- ```powershell -PS> ./install-wsl.ps1 [] +/home/markus/Repos/PowerShell/scripts/install-wsl.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -65,7 +65,7 @@ try { } [int]$Elapsed = $StopWatch.Elapsed.TotalSeconds - "βœ”οΈ installed Windows Subsystem for Linux (WSL) in $Elapsed sec" + "βœ… 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 # success } catch { @@ -74,4 +74,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of install-wsl.ps1 as of 08/15/2024 09:50:48)* +*(generated by convert-ps2md.ps1 using the comment-based help of install-wsl.ps1 as of 11/08/2024 12:34:49)* diff --git a/docs/install-zoom.md b/docs/install-zoom.md index d7f48c7e..b2da8b24 100644 --- a/docs/install-zoom.md +++ b/docs/install-zoom.md @@ -6,7 +6,7 @@ This PowerShell script installs Zoom. Parameters ---------- ```powershell -PS> ./install-zoom.ps1 [] +/home/markus/Repos/PowerShell/scripts/install-zoom.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -58,4 +58,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of install-zoom.ps1 as of 08/15/2024 09:50:48)* +*(generated by convert-ps2md.ps1 using the comment-based help of install-zoom.ps1 as of 11/08/2024 12:34:49)* diff --git a/docs/introduce-powershell.md b/docs/introduce-powershell.md index 95a7dc23..a2263bcf 100644 --- a/docs/introduce-powershell.md +++ b/docs/introduce-powershell.md @@ -6,7 +6,7 @@ This PowerShell script introduces PowerShell to new users and gives an overview Parameters ---------- ```powershell -PS> ./introduce-powershell.ps1 [] +/home/markus/Repos/PowerShell/scripts/introduce-powershell.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -92,4 +92,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of introduce-powershell.ps1 as of 08/15/2024 09:50:48)* +*(generated by convert-ps2md.ps1 using the comment-based help of introduce-powershell.ps1 as of 11/08/2024 12:34:49)* diff --git a/docs/list-aliases.md b/docs/list-aliases.md index ec223c6c..32781bc3 100644 --- a/docs/list-aliases.md +++ b/docs/list-aliases.md @@ -6,7 +6,7 @@ This PowerShell scripts lists all PowerShell aliases. Parameters ---------- ```powershell -PS> ./list-aliases.ps1 [] +/home/markus/Repos/PowerShell/scripts/list-aliases.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -65,4 +65,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-aliases.ps1 as of 08/15/2024 09:50:48)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-aliases.ps1 as of 11/08/2024 12:34:49)* diff --git a/docs/list-anagrams.md b/docs/list-anagrams.md index 9dfe5f2e..94000a09 100644 --- a/docs/list-anagrams.md +++ b/docs/list-anagrams.md @@ -6,7 +6,7 @@ This PowerShell script lists all anagrams of the given word. Parameters ---------- ```powershell -PS> ./list-anagrams.ps1 [[-Word] ] [[-Columns] ] [] +/home/markus/Repos/PowerShell/scripts/list-anagrams.ps1 [[-Word] ] [[-Columns] ] [] -Word Specifies the word to use @@ -120,4 +120,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-anagrams.ps1 as of 08/15/2024 09:50:48)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-anagrams.ps1 as of 11/08/2024 12:34:49)* diff --git a/docs/list-apps.md b/docs/list-apps.md index 67cea4c3..4f96cd39 100644 --- a/docs/list-apps.md +++ b/docs/list-apps.md @@ -6,7 +6,7 @@ This PowerShell script lists the installed applications (from Windows Store, or Parameters ---------- ```powershell -PS> ./list-apps.ps1 [] +/home/markus/Repos/PowerShell/scripts/list-apps.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -57,4 +57,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-apps.ps1 as of 08/15/2024 09:50:48)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-apps.ps1 as of 11/08/2024 12:34:49)* diff --git a/docs/list-ascii-table.md b/docs/list-ascii-table.md index d5a31f7d..e8298c04 100644 --- a/docs/list-ascii-table.md +++ b/docs/list-ascii-table.md @@ -6,7 +6,7 @@ This PowerShell script lists the ASCII table on the console. Parameters ---------- ```powershell -PS> ./list-ascii-table.ps1 [] +/home/markus/Repos/PowerShell/scripts/list-ascii-table.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -120,4 +120,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-ascii-table.ps1 as of 08/15/2024 09:50:48)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-ascii-table.ps1 as of 11/08/2024 12:34:49)* diff --git a/docs/list-automatic-variables.md b/docs/list-automatic-variables.md index 2cd44a6a..3a75e08a 100644 --- a/docs/list-automatic-variables.md +++ b/docs/list-automatic-variables.md @@ -100,4 +100,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-automatic-variables.ps1 as of 08/15/2024 09:50:48)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-automatic-variables.ps1 as of 11/08/2024 12:34:50)* diff --git a/docs/list-battery-status.md b/docs/list-battery-status.md index 7418d619..237ae8cd 100644 --- a/docs/list-battery-status.md +++ b/docs/list-battery-status.md @@ -6,7 +6,7 @@ This PowerShell script lists the battery status. Parameters ---------- ```powershell -PS> ./list-battery-status.ps1 [] +/home/markus/Repos/PowerShell/scripts/list-battery-status.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -64,4 +64,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-battery-status.ps1 as of 08/15/2024 09:50:48)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-battery-status.ps1 as of 11/08/2024 12:34:50)* diff --git a/docs/list-bios.md b/docs/list-bios.md index be8a96d7..93ba6a7f 100644 --- a/docs/list-bios.md +++ b/docs/list-bios.md @@ -6,7 +6,7 @@ This PowerShell script lists the BIOS details. Parameters ---------- ```powershell -PS> ./list-bios.ps1 [] +/home/markus/Repos/PowerShell/scripts/list-bios.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -63,4 +63,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-bios.ps1 as of 08/15/2024 09:50:48)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-bios.ps1 as of 11/08/2024 12:34:50)* diff --git a/docs/list-bluetooth-devices.md b/docs/list-bluetooth-devices.md index 2ceaf0ba..1587fa92 100644 --- a/docs/list-bluetooth-devices.md +++ b/docs/list-bluetooth-devices.md @@ -6,7 +6,7 @@ This PowerShell script lists all Bluetooth devices connected to the local comput Parameters ---------- ```powershell -PS> ./list-bluetooth-devices.ps1 [] +/home/markus/Repos/PowerShell/scripts/list-bluetooth-devices.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -65,4 +65,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-bluetooth-devices.ps1 as of 08/15/2024 09:50:48)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-bluetooth-devices.ps1 as of 11/08/2024 12:34:50)* diff --git a/docs/list-branches.md b/docs/list-branches.md index f0dc7c4a..bf9290c0 100644 --- a/docs/list-branches.md +++ b/docs/list-branches.md @@ -6,7 +6,7 @@ This PowerShell script lists branches in a Git repository - either all (default) Parameters ---------- ```powershell -PS> ./list-branches.ps1 [[-pathToRepo] ] [[-searchPattern] ] [] +/home/markus/Repos/PowerShell/scripts/list-branches.ps1 [[-pathToRepo] ] [[-searchPattern] ] [] -pathToRepo Specifies the path to the Git repository (current working directory by default) @@ -107,4 +107,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-branches.ps1 as of 08/15/2024 09:50:48)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-branches.ps1 as of 11/08/2024 12:34:50)* diff --git a/docs/list-calendar.md b/docs/list-calendar.md index 4ff44ead..08c7001d 100644 --- a/docs/list-calendar.md +++ b/docs/list-calendar.md @@ -6,7 +6,7 @@ Lists calendar elements, either a single month or an entire year. Parameters ---------- ```powershell -PS> ./list-calendar.ps1 [[-Month] ] [[-Year] ] [] +/home/markus/Repos/PowerShell/scripts/list-calendar.ps1 [[-Month] ] [[-Year] ] [] -Month If specified, will limit output to a single month with this numeral value. @@ -109,16 +109,17 @@ function Print-Month ($month, $year) { $header = (Get-Date $firstDayOfMonth -Format MMMM) + " " + $firstDayOfMonth.Year Write-Host - Write-Host ((" " * (($daysLine.Length - $header.Length) / 2)) + $header) + Write-Host $header.ToUpper() + Write-Host "__________________________" Write-Host $daysLine for ($day = $firstDayOfMonth; $day -le $lastDayOfMonth; $day = $day.AddDays(1)) { if ($day.day -eq 1) { - Write-Host (" " * 3 * [int](Get-Date $day -uformat %u)) -NoNewLine + Write-Host (" " * 4 * [int](Get-Date $day -uformat %u)) -NoNewLine } Write-Host ((Get-Date $day -Format dd).ToString()) -NoNewLine - Write-Host " " -NoNewLine + Write-Host " " -NoNewLine if ($day.DayOfWeek -eq "Saturday") { Write-Host @@ -141,7 +142,7 @@ function Print-Year($year) { for ($i = $month; $i -lt $month + 3; $i++) { $tempHeader = (Get-Date -month $i -Format MMMM) + " " + $year.ToString() - $header += ((" " * (($daysLine.Length - $tempHeader.Length) / 2)) + $tempHeader + (" " * (($daysLine.Length - $tempHeader.Length) / 2))) + $header += ((" " * (($daysLine.Length - $tempHeader.Length) / 2)) + $tempHeader.toUpper() + (" " * (($daysLine.Length - $tempHeader.Length) / 2))) $header += " " } @@ -160,14 +161,14 @@ function Print-Year($year) { $dayOffset = [int](Get-Date -day 1 -month ($month + $i) -year $year -uformat %u) if ($dayOfMonth -eq 1) { - Write-Host (" " * 3 * $dayOffSet) -NoNewLine + Write-Host (" " * 4 * $dayOffSet) -NoNewLine } if ($dayOfMonth -le (Get-Date -day 1 -month ((($i + $month) % 12) + 1) -year $year).AddDays(-1).day) { $currentDay = (Get-Date -day $dayOfMonth -month ((($i + $month - 1) % 12) + 1) -year $year) Write-Host ((Get-Date -month ($i + $month) -day $dayOfMonth -year $year -Format dd).ToString()) -NoNewLine - Write-Host " " -NoNewLine + Write-Host " " -NoNewLine } else { Write-Host " " -NoNewLine @@ -221,21 +222,21 @@ function Find-LastWeekDay ($year, $month, $dayOfWeek) { } try { - Set-Variable -name daysLine -option Constant -value "Su Mo Tu We Th Fr Sa " + Set-Variable -name daysLine -option Constant -value "Su Mo Tu We Th Fr Sa " if ($year -lt 0) { throw "Year parameter must be greater than 0" } if ($month -lt 0) { throw "Month parameter must be between 1 and 12" } if (($month -gt 12) -and ($year -eq (Get-Date).Year)) { - $year = $month - $month = 0 + $year = $month + $month = 0 } elseif (($month -gt 12) -and ($year -ne (Get-Date).Year)) { - throw "Month parameter must be between 1 and 12" + throw "Month parameter must be between 1 and 12" } if ($month -ne 0) { - Print-Month $month $year + Print-Month $month $year } else { - Print-Year $year + Print-Year $year } exit 0 # success } catch { @@ -244,4 +245,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-calendar.ps1 as of 08/15/2024 09:50:49)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-calendar.ps1 as of 11/08/2024 12:34:50)* diff --git a/docs/list-cheat-sheet.md b/docs/list-cheat-sheet.md index b56b2c62..c47bde5f 100644 --- a/docs/list-cheat-sheet.md +++ b/docs/list-cheat-sheet.md @@ -6,7 +6,7 @@ This PowerShell script lists the PowerShell cheat sheet. Parameters ---------- ```powershell -PS> ./list-cheat-sheet.ps1 [] +/home/markus/Repos/PowerShell/scripts/list-cheat-sheet.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -75,4 +75,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-cheat-sheet.ps1 as of 08/15/2024 09:50:49)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-cheat-sheet.ps1 as of 11/08/2024 12:34:50)* diff --git a/docs/list-city-weather.md b/docs/list-city-weather.md index fabf7bfa..4efbf10c 100644 --- a/docs/list-city-weather.md +++ b/docs/list-city-weather.md @@ -51,4 +51,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-city-weather.ps1 as of 08/15/2024 09:50:49)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-city-weather.ps1 as of 11/08/2024 12:34:50)* diff --git a/docs/list-cli-tools.md b/docs/list-cli-tools.md index 84d52379..5f0d1656 100644 --- a/docs/list-cli-tools.md +++ b/docs/list-cli-tools.md @@ -358,4 +358,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-cli-tools.ps1 as of 08/15/2024 09:50:49)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-cli-tools.ps1 as of 11/08/2024 12:34:50)* diff --git a/docs/list-clipboard.md b/docs/list-clipboard.md index f12230e7..4e45a966 100644 --- a/docs/list-clipboard.md +++ b/docs/list-clipboard.md @@ -6,7 +6,7 @@ This PowerShell script lists the contents of the clipboard. Parameters ---------- ```powershell -PS> ./list-clipboard.ps1 [] +/home/markus/Repos/PowerShell/scripts/list-clipboard.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -56,4 +56,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-clipboard.ps1 as of 08/15/2024 09:50:49)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-clipboard.ps1 as of 11/08/2024 12:34:50)* diff --git a/docs/list-cmdlets.md b/docs/list-cmdlets.md index 03747d2b..69ab7752 100644 --- a/docs/list-cmdlets.md +++ b/docs/list-cmdlets.md @@ -6,7 +6,7 @@ This PowerShell script lists all PowerShell cmdlets. Parameters ---------- ```powershell -PS> ./list-cmdlets.ps1 [] +/home/markus/Repos/PowerShell/scripts/list-cmdlets.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -67,4 +67,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-cmdlets.ps1 as of 08/15/2024 09:50:49)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-cmdlets.ps1 as of 11/08/2024 12:34:50)* diff --git a/docs/list-coffee-prices.md b/docs/list-coffee-prices.md index 2f6e0c64..1d620612 100644 --- a/docs/list-coffee-prices.md +++ b/docs/list-coffee-prices.md @@ -28,6 +28,7 @@ Script Content Monthly Global Price of Coffee (by alphavantage.co, in cents per pound) ----------------------------------------------------------------------- 2024-04-01 β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Œ 240 + ... .LINK https://github.com/fleschutz/PowerShell .NOTES @@ -77,4 +78,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-coffee-prices.ps1 as of 08/15/2024 09:50:49)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-coffee-prices.ps1 as of 11/08/2024 12:34:50)* diff --git a/docs/list-commit-stats.md b/docs/list-commit-stats.md index 4b915591..8b1b5f55 100644 --- a/docs/list-commit-stats.md +++ b/docs/list-commit-stats.md @@ -6,7 +6,7 @@ This PowerShell script lists the commit statistics of a Git repository. Parameters ---------- ```powershell -PS> ./list-commit-stats.ps1 [[-path] ] [] +/home/markus/Repos/PowerShell/scripts/list-commit-stats.ps1 [[-path] ] [] -path Specifies the path to the local Git repository (default is current working dir) @@ -93,4 +93,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-commit-stats.ps1 as of 08/15/2024 09:50:49)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-commit-stats.ps1 as of 11/08/2024 12:34:50)* diff --git a/docs/list-commits.md b/docs/list-commits.md index ab37b3f4..d3158865 100644 --- a/docs/list-commits.md +++ b/docs/list-commits.md @@ -6,7 +6,7 @@ This PowerShell script lists all commits in a Git repository. Supported output f Parameters ---------- ```powershell -PS> ./list-commits.ps1 [[-RepoDir] ] [[-Format] ] [] +/home/markus/Repos/PowerShell/scripts/list-commits.ps1 [[-RepoDir] ] [[-Format] ] [] -RepoDir Specifies the path to the Git repository. @@ -121,4 +121,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-commits.ps1 as of 08/15/2024 09:50:49)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-commits.ps1 as of 11/08/2024 12:34:50)* diff --git a/docs/list-console-colors.md b/docs/list-console-colors.md index 8932d81e..0538240a 100644 --- a/docs/list-console-colors.md +++ b/docs/list-console-colors.md @@ -6,7 +6,7 @@ This PowerShell script lists all available console colors. Parameters ---------- ```powershell -PS> ./list-console-colors.ps1 [] +/home/markus/Repos/PowerShell/scripts/list-console-colors.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -74,4 +74,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-console-colors.ps1 as of 08/15/2024 09:50:49)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-console-colors.ps1 as of 11/08/2024 12:34:50)* diff --git a/docs/list-countries.md b/docs/list-countries.md index f6663b63..5343b059 100644 --- a/docs/list-countries.md +++ b/docs/list-countries.md @@ -52,4 +52,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-countries.ps1 as of 08/15/2024 09:50:49)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-countries.ps1 as of 11/08/2024 12:34:50)* diff --git a/docs/list-cpu.md b/docs/list-cpu.md index 7a9daa05..68910dfd 100644 --- a/docs/list-cpu.md +++ b/docs/list-cpu.md @@ -6,7 +6,7 @@ This PowerShell script lists the CPU details. Parameters ---------- ```powershell -PS> ./list-cpu.ps1 [] +/home/markus/Repos/PowerShell/scripts/list-cpu.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -63,4 +63,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-cpu.ps1 as of 08/15/2024 09:50:49)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-cpu.ps1 as of 11/08/2024 12:34:50)* diff --git a/docs/list-crypto-rates.md b/docs/list-crypto-rates.md index ef0cb53e..7a1b5e89 100644 --- a/docs/list-crypto-rates.md +++ b/docs/list-crypto-rates.md @@ -76,4 +76,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-crypto-rates.ps1 as of 08/15/2024 09:50:49)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-crypto-rates.ps1 as of 11/08/2024 12:34:50)* diff --git a/docs/list-defender-settings.md b/docs/list-defender-settings.md index c1993445..41c873c6 100644 --- a/docs/list-defender-settings.md +++ b/docs/list-defender-settings.md @@ -7,7 +7,7 @@ NOTE: use 'Set-MpPreference' to change settings (e.g. DisableScanningNetworkFile Parameters ---------- ```powershell -PS> ./list-defender-settings.ps1 [] +/home/markus/Repos/PowerShell/scripts/list-defender-settings.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -69,4 +69,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-defender-settings.ps1 as of 08/15/2024 09:50:49)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-defender-settings.ps1 as of 11/08/2024 12:34:50)* diff --git a/docs/list-dir-tree.md b/docs/list-dir-tree.md index cf82393e..974afafd 100644 --- a/docs/list-dir-tree.md +++ b/docs/list-dir-tree.md @@ -6,9 +6,9 @@ This PowerShell script lists all files and folders in a neat directory tree (inc Parameters ---------- ```powershell -PS> ./list-dir-tree.ps1 [[-Path] ] [] +/home/markus/Repos/PowerShell/scripts/list-dir-tree.ps1 [[-path] ] [] --Path +-path Specifies the path to the directory tree Required? false @@ -45,10 +45,10 @@ Script Content ```powershell <# .SYNOPSIS - Lists a directory tree + Lists a dir tree .DESCRIPTION This PowerShell script lists all files and folders in a neat directory tree (including icon and size). -.PARAMETER Path +.PARAMETER path Specifies the path to the directory tree .EXAMPLE PS> ./list-dir-tree.ps1 C:\MyFolder @@ -61,7 +61,7 @@ Script Content Author: Markus Fleschutz | License: CC0 #> -param([string]$Path = "$PWD") +param([string]$path = "$PWD") function GetFileIcon([string]$suffix) { switch ($suffix) { @@ -73,6 +73,9 @@ function GetFileIcon([string]$suffix) { ".jpg" {return "πŸ“Έ"} ".mp3" {return "🎡"} ".mkv" {return "🎬"} + ".png" {return "πŸ“Έ"} + ".rar" {return "🎁"} + ".tar" {return "🎁"} ".zip" {return "🎁"} default {return "πŸ“„"} } @@ -90,7 +93,7 @@ function Bytes2String([int64]$bytes) { return "$($Bytes)TB" } -function ListDirectory([string]$path, [int]$depth) { +function ListDir([string]$path, [int]$depth) { $depth++ $items = Get-ChildItem -path $path foreach($item in $items) { @@ -98,8 +101,7 @@ function ListDirectory([string]$path, [int]$depth) { for ($i = 1; $i -lt $depth; $i++) { Write-Host "β”‚ " -noNewline } if ($item.Mode -like "d*") { Write-Output "β”œπŸ“‚$Filename" - ListDirectory "$path\$filename" $depth - $global:folders++ + ListDir "$path\$filename" $depth } else { $icon = GetFileIcon $item.Extension Write-Output "β”œ$($icon)$filename ($(Bytes2String $item.Length))" @@ -107,14 +109,15 @@ function ListDirectory([string]$path, [int]$depth) { $global:bytes += $item.Length } } + $global:folders++ } try { - [int64]$global:folders = 1 + [int64]$global:folders = 0 [int64]$global:files = 0 [int64]$global:bytes = 0 - ListDirectory $Path 0 - Write-Output " ($($global:folders) folders, $($global:files) files, $(Bytes2String $global:bytes) file size in total)" + ListDir $path 0 + Write-Output " ($($global:folders) folders, $($global:files) files, $(Bytes2String $global:bytes) total)" exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -122,4 +125,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-dir-tree.ps1 as of 08/15/2024 09:50:49)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-dir-tree.ps1 as of 11/08/2024 12:34:50)* diff --git a/docs/list-dns-servers.md b/docs/list-dns-servers.md index 06ca55d8..3e0455f7 100644 --- a/docs/list-dns-servers.md +++ b/docs/list-dns-servers.md @@ -60,4 +60,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-dns-servers.ps1 as of 08/15/2024 09:50:49)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-dns-servers.ps1 as of 11/08/2024 12:34:50)* diff --git a/docs/list-drives.md b/docs/list-drives.md index 8b96ca36..40af9b8b 100644 --- a/docs/list-drives.md +++ b/docs/list-drives.md @@ -6,7 +6,7 @@ This PowerShell script lists all local drives as a table. Parameters ---------- ```powershell -PS> ./list-drives.ps1 [] +/home/markus/Repos/PowerShell/scripts/list-drives.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -63,4 +63,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-drives.ps1 as of 08/15/2024 09:50:49)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-drives.ps1 as of 11/08/2024 12:34:50)* diff --git a/docs/list-earthquakes.md b/docs/list-earthquakes.md index d9776ca8..d823c30e 100644 --- a/docs/list-earthquakes.md +++ b/docs/list-earthquakes.md @@ -6,7 +6,7 @@ This PowerShell script lists major earthquakes for the last 30 days. Parameters ---------- ```powershell -PS> ./list-earthquakes.ps1 [[-minMagnitude] ] [] +/home/markus/Repos/PowerShell/scripts/list-earthquakes.ps1 [[-minMagnitude] ] [] -minMagnitude Specifies the minimum magnitude to list (5.5 by default) @@ -93,4 +93,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-earthquakes.ps1 as of 08/15/2024 09:50:49)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-earthquakes.ps1 as of 11/08/2024 12:34:50)* diff --git a/docs/list-emojis.md b/docs/list-emojis.md index cdc9bd52..393bfe21 100644 --- a/docs/list-emojis.md +++ b/docs/list-emojis.md @@ -6,7 +6,7 @@ This PowerShell script lists the emojis of Unicode 13.0 sorted by category. Parameters ---------- ```powershell -PS> ./list-emojis.ps1 [] +/home/markus/Repos/PowerShell/scripts/list-emojis.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -72,4 +72,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-emojis.ps1 as of 08/15/2024 09:50:49)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-emojis.ps1 as of 11/08/2024 12:34:50)* diff --git a/docs/list-empty-dirs.md b/docs/list-empty-dirs.md index 60f38634..a8049fbb 100644 --- a/docs/list-empty-dirs.md +++ b/docs/list-empty-dirs.md @@ -6,7 +6,7 @@ This PowerShell script scans a directory tree and lists all empty directories. Parameters ---------- ```powershell -PS> ./list-empty-dirs.ps1 [[-path] ] [] +/home/markus/Repos/PowerShell/scripts/list-empty-dirs.ps1 [[-path] ] [] -path Specifies the path to the directory tree (current working directory by default) @@ -27,7 +27,7 @@ Example ```powershell PS> ./list-empty-dirs.ps1 C:\Windows ... -βœ”οΈ Found 39972 empty directories within πŸ“‚C:\Windows in 222 sec +βœ… Found 39972 empty directories within πŸ“‚C:\Windows in 222 sec ``` @@ -52,7 +52,7 @@ Script Content .EXAMPLE PS> ./list-empty-dirs.ps1 C:\Windows ... - βœ”οΈ Found 39972 empty directories within πŸ“‚C:\Windows in 222 sec + βœ… Found 39972 empty directories within πŸ“‚C:\Windows in 222 sec .LINK https://github.com/fleschutz/PowerShell .NOTES @@ -73,7 +73,7 @@ try { } Write-Progress -completed " " [int]$Elapsed = $stopWatch.Elapsed.TotalSeconds - "βœ”οΈ Found $count empty directories within πŸ“‚$path in $elapsed sec" + "βœ… Found $count empty directories within πŸ“‚$path in $elapsed sec" exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -81,4 +81,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-empty-dirs.ps1 as of 08/15/2024 09:50:49)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-empty-dirs.ps1 as of 11/08/2024 12:34:50)* diff --git a/docs/list-empty-files.md b/docs/list-empty-files.md index bc609adb..be001300 100644 --- a/docs/list-empty-files.md +++ b/docs/list-empty-files.md @@ -6,7 +6,7 @@ This PowerShell script scans a directory tree and lists all empty files. Parameters ---------- ```powershell -PS> ./list-empty-files.ps1 [[-path] ] [] +/home/markus/Repos/PowerShell/scripts/list-empty-files.ps1 [[-path] ] [] -path Specifies the path to the directory tree (default is current working dir) @@ -27,7 +27,7 @@ Example ```powershell PS> ./list-empty-files.ps1 C:\Windows ... -βœ”οΈ Found 6 empty files within C:\Windows in 54 sec +βœ… Found 6 empty files within C:\Windows in 54 sec ``` @@ -52,7 +52,7 @@ Script Content .EXAMPLE PS> ./list-empty-files.ps1 C:\Windows ... - βœ”οΈ Found 6 empty files within C:\Windows in 54 sec + βœ… Found 6 empty files within C:\Windows in 54 sec .LINK https://github.com/fleschutz/PowerShell .NOTES @@ -73,7 +73,7 @@ try { } Write-Progress -completed " " [int]$elapsed = $stopWatch.Elapsed.TotalSeconds - "βœ”οΈ Found $count empty files within $path in $elapsed sec" + "βœ… Found $count empty files within $path in $elapsed sec" exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -81,4 +81,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-empty-files.ps1 as of 08/15/2024 09:50:49)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-empty-files.ps1 as of 11/08/2024 12:34:50)* diff --git a/docs/list-encrypted-files.md b/docs/list-encrypted-files.md index 88b20597..a6e3ae5f 100644 --- a/docs/list-encrypted-files.md +++ b/docs/list-encrypted-files.md @@ -6,7 +6,7 @@ This PowerShell script scans a directory tree and lists all encrypted files. Parameters ---------- ```powershell -PS> ./list-encrypted-files.ps1 [[-path] ] [] +/home/markus/Repos/PowerShell/scripts/list-encrypted-files.ps1 [[-path] ] [] -path Specifies the path to the directory tree (default is current working dir) @@ -27,7 +27,7 @@ Example ```powershell PS> ./list-encrypted-files.ps1 C:\Windows ... -βœ”οΈ Found 0 encrypted files within πŸ“‚C:\Windows in 41 sec +βœ… Found 0 encrypted files within πŸ“‚C:\Windows in 41 sec ``` @@ -52,7 +52,7 @@ Script Content .EXAMPLE PS> ./list-encrypted-files.ps1 C:\Windows ... - βœ”οΈ Found 0 encrypted files within πŸ“‚C:\Windows in 41 sec + βœ… Found 0 encrypted files within πŸ“‚C:\Windows in 41 sec .LINK https://github.com/fleschutz/PowerShell .NOTES @@ -73,7 +73,7 @@ try { } Write-Progress -completed " " [int]$elapsed = $stopWatch.Elapsed.TotalSeconds - "βœ”οΈ Found $count encrypted files within πŸ“‚$path in $elapsed sec" + "βœ… Found $count encrypted files within πŸ“‚$path in $elapsed sec" exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -81,4 +81,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-encrypted-files.ps1 as of 08/15/2024 09:50:49)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-encrypted-files.ps1 as of 11/08/2024 12:34:50)* diff --git a/docs/list-environment-variables.md b/docs/list-environment-variables.md index 67c4052f..67fe8cb1 100644 --- a/docs/list-environment-variables.md +++ b/docs/list-environment-variables.md @@ -6,7 +6,7 @@ This PowerShell script lists all environment variables. Parameters ---------- ```powershell -PS> ./list-environment-variables.ps1 [] +/home/markus/Repos/PowerShell/scripts/list-environment-variables.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -65,4 +65,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-environment-variables.ps1 as of 08/15/2024 09:50:49)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-environment-variables.ps1 as of 11/08/2024 12:34:50)* diff --git a/docs/list-error-types.md b/docs/list-error-types.md index 70a77289..e1a4d53c 100644 --- a/docs/list-error-types.md +++ b/docs/list-error-types.md @@ -26,4 +26,4 @@ Script Content } | Select BaseType,Name,FullName ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-error-types.ps1 as of 08/15/2024 09:50:49)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-error-types.ps1 as of 11/08/2024 12:34:50)* diff --git a/docs/list-exchange-rates.md b/docs/list-exchange-rates.md index 29f784a2..250dbc33 100644 --- a/docs/list-exchange-rates.md +++ b/docs/list-exchange-rates.md @@ -6,7 +6,7 @@ This PowerShell script lists the current exchange rates for the given currency ( Parameters ---------- ```powershell -PS> ./list-exchange-rates.ps1 [[-currency] ] [] +/home/markus/Repos/PowerShell/scripts/list-exchange-rates.ps1 [[-currency] ] [] -currency Specifies the base currency @@ -95,4 +95,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-exchange-rates.ps1 as of 08/15/2024 09:50:49)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-exchange-rates.ps1 as of 11/08/2024 12:34:50)* diff --git a/docs/list-executables.md b/docs/list-executables.md index 2a121f37..4a5d3623 100644 --- a/docs/list-executables.md +++ b/docs/list-executables.md @@ -6,7 +6,7 @@ This PowerShell script scans a given directory tree and lists all executables wi Parameters ---------- ```powershell -PS> ./list-executables.ps1 [[-path] ] [] +/home/markus/Repos/PowerShell/scripts/list-executables.ps1 [[-path] ] [] -path Specifies the path to the directory tree (current working directory by default) @@ -28,7 +28,7 @@ Example PS> ./list-executables.ps1 C:\Windows C:\Windows\bfsvc.exe ... -βœ”οΈ Found 7967 executables within πŸ“‚C:\Windows in 168 sec. +βœ… Found 7967 executables within πŸ“‚C:\Windows in 168 sec. ``` @@ -54,7 +54,7 @@ Script Content PS> ./list-executables.ps1 C:\Windows C:\Windows\bfsvc.exe ... - βœ”οΈ Found 7967 executables within πŸ“‚C:\Windows in 168 sec. + βœ… Found 7967 executables within πŸ“‚C:\Windows in 168 sec. .LINK https://github.com/fleschutz/PowerShell .NOTES @@ -75,7 +75,7 @@ try { } Write-Progress -completed " " [int]$elapsed = $stopWatch.Elapsed.TotalSeconds - "βœ”οΈ Found $count executables within πŸ“‚$path in $elapsed sec." + "βœ… Found $count executables within πŸ“‚$path in $elapsed sec." exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -83,4 +83,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-executables.ps1 as of 08/15/2024 09:50:49)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-executables.ps1 as of 11/08/2024 12:34:50)* diff --git a/docs/list-fibonacci.md b/docs/list-fibonacci.md index da9ee2bf..9a5bbcb5 100644 --- a/docs/list-fibonacci.md +++ b/docs/list-fibonacci.md @@ -31,16 +31,16 @@ Script Content Author: Markus Fleschutz | License: CC0 #> -function fibonacci($n) { +function fibo([int]$n) { if ($n -lt 2) { return 1 } - return (fibonacci($n - 1)) + (fibonacci($n - 2)) + return (fibo($n - 1)) + (fibo($n - 2)) } foreach ($i in 0..100) { - Write-Host "$(fibonacci $i), " -noNewline + Write-Host "$(fibo $i), " -noNewline } exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-fibonacci.ps1 as of 08/15/2024 09:50:49)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-fibonacci.ps1 as of 11/08/2024 12:34:50)* diff --git a/docs/list-files.md b/docs/list-files.md index b79d3dd6..5a32d280 100644 --- a/docs/list-files.md +++ b/docs/list-files.md @@ -6,7 +6,7 @@ This PowerShell script lists all files within the given directory tree. Parameters ---------- ```powershell -PS> ./list-files.ps1 [[-DirTree] ] [] +/home/markus/Repos/PowerShell/scripts/list-files.ps1 [[-DirTree] ] [] -DirTree Specifies the path to the directory tree @@ -68,4 +68,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-files.ps1 as of 08/15/2024 09:50:49)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-files.ps1 as of 11/08/2024 12:34:50)* diff --git a/docs/list-folder.md b/docs/list-folder.md index 7cb60fa2..4d194c77 100644 --- a/docs/list-folder.md +++ b/docs/list-folder.md @@ -6,7 +6,7 @@ This PowerShell script lists the content of a directory (alphabetically formatte Parameters ---------- ```powershell -PS> ./list-folder.ps1 [[-searchPattern] ] [] +/home/markus/Repos/PowerShell/scripts/list-folder.ps1 [[-searchPattern] ] [] -searchPattern Specifies the search pattern ("*" by default which means anything) @@ -91,4 +91,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-folder.ps1 as of 08/15/2024 09:50:49)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-folder.ps1 as of 11/08/2024 12:34:50)* diff --git a/docs/list-fritzbox-calls.md b/docs/list-fritzbox-calls.md index 88d88c9a..8879e485 100644 --- a/docs/list-fritzbox-calls.md +++ b/docs/list-fritzbox-calls.md @@ -6,7 +6,7 @@ This PowerShell script lists the phone calls of the FRITZ!Box device. Parameters ---------- ```powershell -PS> ./list-fritzbox-calls.ps1 [[-Username] ] [[-Password] ] [] +/home/markus/Repos/PowerShell/scripts/list-fritzbox-calls.ps1 [[-Username] ] [[-Password] ] [] -Username Specifies the user name for FRITZ!Box @@ -153,4 +153,4 @@ echo $Result exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-fritzbox-calls.ps1 as of 08/15/2024 09:50:49)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-fritzbox-calls.ps1 as of 11/08/2024 12:34:50)* diff --git a/docs/list-fritzbox-devices.md b/docs/list-fritzbox-devices.md index c5de803c..ae47e310 100644 --- a/docs/list-fritzbox-devices.md +++ b/docs/list-fritzbox-devices.md @@ -6,7 +6,7 @@ This PowerShell script lists FRITZ!Box's known devices. Parameters ---------- ```powershell -PS> ./list-fritzbox-devices.ps1 [[-Username] ] [[-Password] ] [] +/home/markus/Repos/PowerShell/scripts/list-fritzbox-devices.ps1 [[-Username] ] [[-Password] ] [] -Username Specifies the user name to FRITZ!Box @@ -105,4 +105,4 @@ $HostTable | format-table -property Active,IPAddress,MACAddress,HostName,Interfa exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-fritzbox-devices.ps1 as of 08/15/2024 09:50:49)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-fritzbox-devices.ps1 as of 11/08/2024 12:34:50)* diff --git a/docs/list-headlines.md b/docs/list-headlines.md index cb4b77d4..e449b9cf 100644 --- a/docs/list-headlines.md +++ b/docs/list-headlines.md @@ -6,7 +6,7 @@ This PowerShell script lists the latest headlines by using a RSS (Really Simple Parameters ---------- ```powershell -PS> ./list-headlines.ps1 [[-RSS_URL] ] [[-maxLines] ] [] +/home/markus/Repos/PowerShell/scripts/list-headlines.ps1 [[-RSS_URL] ] [[-maxLines] ] [] -RSS_URL Specifies the URL to the RSS feed (Yahoo World News by default) @@ -89,4 +89,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-headlines.ps1 as of 08/15/2024 09:50:49)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-headlines.ps1 as of 11/08/2024 12:34:50)* diff --git a/docs/list-hidden-files.md b/docs/list-hidden-files.md index b3e4d9ac..43eeff74 100644 --- a/docs/list-hidden-files.md +++ b/docs/list-hidden-files.md @@ -6,7 +6,7 @@ This PowerShell script scans a directory tree and lists all hidden files. Parameters ---------- ```powershell -PS> ./list-hidden-files.ps1 [[-path] ] [] +/home/markus/Repos/PowerShell/scripts/list-hidden-files.ps1 [[-path] ] [] -path Specifies the path to the directory tree (default is current working dir) @@ -27,7 +27,7 @@ Example ```powershell PS> ./list-hidden-files.ps1 C:\Windows ... -βœ”οΈ Found 256 hidden files within πŸ“‚C:\Windows in 40 sec +βœ… Found 256 hidden files within πŸ“‚C:\Windows in 40 sec ``` @@ -52,7 +52,7 @@ Script Content .EXAMPLE PS> ./list-hidden-files.ps1 C:\Windows ... - βœ”οΈ Found 256 hidden files within πŸ“‚C:\Windows in 40 sec + βœ… Found 256 hidden files within πŸ“‚C:\Windows in 40 sec .LINK https://github.com/fleschutz/PowerShell .NOTES @@ -73,7 +73,7 @@ try { } Write-Progress -completed " " [int]$elapsed = $stopWatch.Elapsed.TotalSeconds - "βœ”οΈ Found $count hidden files within πŸ“‚$path in $elapsed sec" + "βœ… Found $count hidden files within πŸ“‚$path in $elapsed sec" exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -81,4 +81,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-hidden-files.ps1 as of 08/15/2024 09:50:49)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-hidden-files.ps1 as of 11/08/2024 12:34:50)* diff --git a/docs/list-installed-languages.md b/docs/list-installed-languages.md index 3fbc2e16..eb882bbd 100644 --- a/docs/list-installed-languages.md +++ b/docs/list-installed-languages.md @@ -50,4 +50,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-installed-languages.ps1 as of 08/15/2024 09:50:49)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-installed-languages.ps1 as of 11/08/2024 12:34:50)* diff --git a/docs/list-installed-scripts.md b/docs/list-installed-scripts.md index b3d62302..5c8841a7 100644 --- a/docs/list-installed-scripts.md +++ b/docs/list-installed-scripts.md @@ -6,7 +6,7 @@ This PowerShell script lists all installed PowerShell scripts. Parameters ---------- ```powershell -PS> ./list-installed-scripts.ps1 [] +/home/markus/Repos/PowerShell/scripts/list-installed-scripts.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -48,4 +48,4 @@ Get-InstalledScript exit # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-installed-scripts.ps1 as of 08/15/2024 09:50:49)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-installed-scripts.ps1 as of 11/08/2024 12:34:50)* diff --git a/docs/list-installed-software.md b/docs/list-installed-software.md index 5b18e39b..a8ec4ab1 100644 --- a/docs/list-installed-software.md +++ b/docs/list-installed-software.md @@ -6,7 +6,7 @@ This PowerShell script lists the installed software (except Windows Store apps). Parameters ---------- ```powershell -PS> ./list-installed-software.ps1 [] +/home/markus/Repos/PowerShell/scripts/list-installed-software.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -65,4 +65,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-installed-software.ps1 as of 08/15/2024 09:50:49)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-installed-software.ps1 as of 11/08/2024 12:34:50)* diff --git a/docs/list-internet-ip.md b/docs/list-internet-ip.md new file mode 100644 index 00000000..e230e941 --- /dev/null +++ b/docs/list-internet-ip.md @@ -0,0 +1,73 @@ +Script: *list-internet-ip.ps1* +======================== + +This PowerShell script queries all public IP address information and prints it. + +Parameters +---------- +```powershell +/home/markus/Repos/PowerShell/scripts/list-internet-ip.ps1 [] + +[] + This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, + WarningVariable, OutBuffer, PipelineVariable, and OutVariable. +``` + +Example +------- +```powershell +PS> ./list-internet-ip.ps1 +βœ… Internet IP 185.72.229.161, 2003:f2:6128:fd01:e543:601:30c2:a028 near Munich, Germany + +``` + +Notes +----- +Author: Markus Fleschutz | License: CC0 + +Related Links +------------- +https://github.com/fleschutz/PowerShell + +Script Content +-------------- +```powershell +<# +.SYNOPSIS + Lists the Internet IP address +.DESCRIPTION + This PowerShell script queries all public IP address information and prints it. +.EXAMPLE + PS> ./list-internet-ip.ps1 + βœ… Internet IP 185.72.229.161, 2003:f2:6128:fd01:e543:601:30c2:a028 near Munich, Germany +.LINK + https://github.com/fleschutz/PowerShell +.NOTES + Author: Markus Fleschutz | License: CC0 +#> + +try { + if ($IsLinux) { + [string]$publicIPv4 = (curl -4 --silent ifconfig.co) + [string]$publicIPv6 = (curl -6 --silent ifconfig.co) + [string]$city = (curl --silent ifconfig.co/city) + [string]$country = (curl --silent ifconfig.co/country) + } else { + [string]$publicIPv4 = (curl.exe -4 --silent ifconfig.co) + [string]$publicIPv6 = (curl.exe -6 --silent ifconfig.co) + [string]$city = (curl.exe --silent ifconfig.co/city) + [string]$country = (curl.exe --silent ifconfig.co/country) + } + if ("$publicIPv4" -eq "") { $publicIPv4 = "no IPv4" } + if ("$publicIPv6" -eq "") { $publicIPv6 = "no IPv6" } + if ("$city" -eq "") { $city = "unknown city" } + if ("$country" -eq "") { $country = "unknown country" } + "βœ… Internet IP $publicIPv4, $publicIPv6 near $city, $country" + exit 0 # success +} catch { + "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" + exit 1 +} +``` + +*(generated by convert-ps2md.ps1 using the comment-based help of list-internet-ip.ps1 as of 11/08/2024 12:34:50)* diff --git a/docs/list-ipv6.md b/docs/list-ipv6.md index bb818f9b..2f516818 100644 --- a/docs/list-ipv6.md +++ b/docs/list-ipv6.md @@ -6,7 +6,7 @@ This PowerShell script lists the state of IPv6 on all network interfaces of the Parameters ---------- ```powershell -PS> ./list-ipv6.ps1 [] +/home/markus/Repos/PowerShell/scripts/list-ipv6.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -63,4 +63,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-ipv6.ps1 as of 08/15/2024 09:50:49)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-ipv6.ps1 as of 11/08/2024 12:34:51)* diff --git a/docs/list-latest-tag.md b/docs/list-latest-tag.md index 706e4b7a..2fb6d24b 100644 --- a/docs/list-latest-tag.md +++ b/docs/list-latest-tag.md @@ -6,7 +6,7 @@ This PowerShell script lists the latest tag in a local Git repository. Parameters ---------- ```powershell -PS> ./list-latest-tag.ps1 [[-RepoDir] ] [] +/home/markus/Repos/PowerShell/scripts/list-latest-tag.ps1 [[-RepoDir] ] [] -RepoDir Specifies the path to the local repository (current working dir by default) @@ -77,4 +77,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-latest-tag.ps1 as of 08/15/2024 09:50:49)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-latest-tag.ps1 as of 11/08/2024 12:34:51)* diff --git a/docs/list-latest-tags.md b/docs/list-latest-tags.md index e6d738e9..fcd53b8f 100644 --- a/docs/list-latest-tags.md +++ b/docs/list-latest-tags.md @@ -6,7 +6,7 @@ This PowerShell script lists the latest tags in all Git repositories in the spec Parameters ---------- ```powershell -PS> ./list-latest-tags.ps1 [[-ParentDir] ] [] +/home/markus/Repos/PowerShell/scripts/list-latest-tags.ps1 [[-ParentDir] ] [] -ParentDir Specifies the path to the parent folder @@ -85,4 +85,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-latest-tags.ps1 as of 08/15/2024 09:50:49)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-latest-tags.ps1 as of 11/08/2024 12:34:51)* diff --git a/docs/list-local-ip.md b/docs/list-local-ip.md new file mode 100644 index 00000000..e6aa2c63 --- /dev/null +++ b/docs/list-local-ip.md @@ -0,0 +1,65 @@ +Script: *list-local-ip.ps1* +======================== + +list-local-ip.ps1 + + +Parameters +---------- +```powershell + + +[] + This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, + WarningVariable, OutBuffer, PipelineVariable, and OutVariable. +``` + +Script Content +-------------- +```powershell +<# +.SYNOPSIS + List local IP addresses +.DESCRIPTION + This PowerShell script queries all local IP address information and prints it. +.EXAMPLE + PS> ./list-local-ip.ps1 + βœ… Local Ethernet IP 192.168.178.21/24, 2003:f2:670b:e700:31e5:de86:b7cd:4e45 +.LINK + https://github.com/fleschutz/PowerShell +.NOTES + Author: Markus Fleschutz | License: CC0 +#> + +function WriteLocalInterface($interface) { + $IPv4 = $IPv6 = $prefixLen = "" + $addresses = Get-NetIPAddress + foreach ($addr in $addresses) { + if ($addr.InterfaceAlias -like "$($interface)*") { + if ($addr.AddressFamily -eq "IPv4") { + $IPv4 = $addr.IPAddress + $prefixLen = $addr.PrefixLength + } else { + $IPv6 = $addr.IPAddress + } + } + } + if ($IPv4 -ne "" -or $IPv6 -ne "") { + "βœ… Local $interface IP $IPv4/$prefixLen, $IPv6" + } +} + +try { + if ($IsLinux) { exit 0 } + + WriteLocalInterface "Ethernet" + WriteLocalInterface "WLAN" + WriteLocalInterface "Bluetooth" + exit 0 # success +} catch { + "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" + exit 1 +} +``` + +*(generated by convert-ps2md.ps1 using the comment-based help of list-local-ip.ps1 as of 11/08/2024 12:34:51)* diff --git a/docs/list-mDNS.md b/docs/list-mDNS.md index 2f36e9d8..a3763e36 100644 --- a/docs/list-mDNS.md +++ b/docs/list-mDNS.md @@ -21,4 +21,4 @@ Get-NetUDPEndpoint -localPort 5353 | Select-Object LocalAddress,LocalPort,Owning exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-mDNS.ps1 as of 08/15/2024 09:50:49)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-mDNS.ps1 as of 11/08/2024 12:34:51)* diff --git a/docs/list-memos.md b/docs/list-memos.md index 524294ef..5831b7dd 100644 --- a/docs/list-memos.md +++ b/docs/list-memos.md @@ -6,7 +6,7 @@ This PowerShell script lists all entries in 'Remember.csv' in your home folder. Parameters ---------- ```powershell -PS> ./list-memos.ps1 [] +/home/markus/Repos/PowerShell/scripts/list-memos.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -68,4 +68,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-memos.ps1 as of 08/15/2024 09:50:49)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-memos.ps1 as of 11/08/2024 12:34:51)* diff --git a/docs/list-mysql-tables.md b/docs/list-mysql-tables.md index 67577b17..788e8540 100644 --- a/docs/list-mysql-tables.md +++ b/docs/list-mysql-tables.md @@ -6,7 +6,7 @@ This PowerShell script lists all tables of the given MySQL database. Parameters ---------- ```powershell -PS> ./list-mysql-tables.ps1 [-server] [-database] [-dbuser] [-dbpass] [] +/home/markus/Repos/PowerShell/scripts/list-mysql-tables.ps1 [-server] [-database] [-dbuser] [-dbpass] [] -server @@ -90,4 +90,4 @@ $result = Invoke-MySqlQuery -ConnectionString "server=$server; database=$databa $result | Export-Csv $csvfilepath -NoTypeInformation ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-mysql-tables.ps1 as of 08/15/2024 09:50:49)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-mysql-tables.ps1 as of 11/08/2024 12:34:51)* diff --git a/docs/list-network-connections.md b/docs/list-network-connections.md index c1aa11ab..cebcdcbc 100644 --- a/docs/list-network-connections.md +++ b/docs/list-network-connections.md @@ -6,7 +6,7 @@ This PowerShell script lists all active network connections on the local compute Parameters ---------- ```powershell -PS> ./list-network-connections.ps1 [] +/home/markus/Repos/PowerShell/scripts/list-network-connections.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -53,4 +53,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-network-connections.ps1 as of 08/15/2024 09:50:49)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-network-connections.ps1 as of 11/08/2024 12:34:51)* diff --git a/docs/list-network-neighbors.md b/docs/list-network-neighbors.md index 70be7cfa..6db62899 100644 --- a/docs/list-network-neighbors.md +++ b/docs/list-network-neighbors.md @@ -6,7 +6,7 @@ This PowerShell script lists all network neighbors of the local computer (using Parameters ---------- ```powershell -PS> ./list-network-neighbors.ps1 [] +/home/markus/Repos/PowerShell/scripts/list-network-neighbors.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -71,4 +71,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-network-neighbors.ps1 as of 08/15/2024 09:50:50)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-network-neighbors.ps1 as of 11/08/2024 12:34:51)* diff --git a/docs/list-network-routes.md b/docs/list-network-routes.md index 2746660c..ae5fce7d 100644 --- a/docs/list-network-routes.md +++ b/docs/list-network-routes.md @@ -6,7 +6,7 @@ This PowerShell script lists the network routes on the local computer. Parameters ---------- ```powershell -PS> ./list-network-routes.ps1 [] +/home/markus/Repos/PowerShell/scripts/list-network-routes.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -53,4 +53,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-network-routes.ps1 as of 08/15/2024 09:50:50)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-network-routes.ps1 as of 11/08/2024 12:34:51)* diff --git a/docs/list-network-shares.md b/docs/list-network-shares.md index 830ddbcf..ccebc963 100644 --- a/docs/list-network-shares.md +++ b/docs/list-network-shares.md @@ -1,12 +1,12 @@ Script: *list-network-shares.ps1* ======================== -This PowerShell script lists all network shares of the local computer. +This PowerShell script lists all network shares (aka "shared folders") of the local computer. Parameters ---------- ```powershell -PS> ./list-network-shares.ps1 [] +/home/markus/Repos/PowerShell/scripts/list-network-shares.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -17,12 +17,7 @@ Example ------- ```powershell PS> ./list-network-shares.ps1 - - - -Name Path Description ----- ---- ----------- -Public C:\Public Public folder for file transfer +βœ… Network share \\LAPTOP\Public ("Public folder for file transfer") mapped to: πŸ“‚D:\Public ``` @@ -39,15 +34,12 @@ Script Content ```powershell <# .SYNOPSIS - Lists the local network shares + Lists the network shares .DESCRIPTION - This PowerShell script lists all network shares of the local computer. + This PowerShell script lists all network shares (aka "shared folders") of the local computer. .EXAMPLE PS> ./list-network-shares.ps1 - - Name Path Description - ---- ---- ----------- - Public C:\Public Public folder for file transfer + βœ… Network share \\LAPTOP\Public ("Public folder for file transfer") mapped to: πŸ“‚D:\Public .LINK https://github.com/fleschutz/PowerShell .NOTES @@ -55,7 +47,14 @@ Script Content #> try { - Get-WmiObject win32_share | where {$_.name -NotLike "*$"} + if ($IsLinux) { + # TODO + } else { + $shares = Get-WmiObject win32_share | where {$_.name -NotLike "*$"} + foreach ($share in $shares) { + Write-Output "βœ… Network share \\$(hostname)\$($share.Name) (`"$($share.Description)`") mapped to: πŸ“‚$($share.Path)" + } + } exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -63,4 +62,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-network-shares.ps1 as of 08/15/2024 09:50:50)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-network-shares.ps1 as of 11/08/2024 12:34:51)* diff --git a/docs/list-news.md b/docs/list-news.md index 0a247102..8e16a9d9 100644 --- a/docs/list-news.md +++ b/docs/list-news.md @@ -6,7 +6,7 @@ This PowerShell script lists the latest news by using a RSS (Really Simple Syndi Parameters ---------- ```powershell -PS> ./list-news.ps1 [[-RSS_URL] ] [[-maxLines] ] [[-speed] ] [] +/home/markus/Repos/PowerShell/scripts/list-news.ps1 [[-RSS_URL] ] [[-maxLines] ] [[-speed] ] [] -RSS_URL Specifies the URL to the RSS feed (Yahoo World News by default) @@ -112,4 +112,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-news.ps1 as of 08/15/2024 09:50:50)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-news.ps1 as of 11/08/2024 12:34:51)* diff --git a/docs/list-nic.md b/docs/list-nic.md index 1c959973..4880d640 100644 --- a/docs/list-nic.md +++ b/docs/list-nic.md @@ -6,7 +6,7 @@ This PowerShell script lists the details of the installed network interfaces. Parameters ---------- ```powershell -PS> ./list-nic.ps1 [] +/home/markus/Repos/PowerShell/scripts/list-nic.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -53,4 +53,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-nic.ps1 as of 08/15/2024 09:50:50)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-nic.ps1 as of 11/08/2024 12:34:51)* diff --git a/docs/list-nina-warnings.md b/docs/list-nina-warnings.md index 4840fdbc..4f29aa25 100644 --- a/docs/list-nina-warnings.md +++ b/docs/list-nina-warnings.md @@ -6,7 +6,7 @@ This PowerShell script queries the current NINA warnings and lists it. Parameters ---------- ```powershell -PS> ./list-nina-warnings.ps1 [[-ARS] ] [] +/home/markus/Repos/PowerShell/scripts/list-nina-warnings.ps1 [[-ARS] ] [] -ARS Specifies the official regional key in Germany ("Amtlicher RegionalschlΓΌssel", e.g. 09777, none by default) @@ -104,4 +104,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-nina-warnings.ps1 as of 08/15/2024 09:50:50)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-nina-warnings.ps1 as of 11/08/2024 12:34:51)* diff --git a/docs/list-old-branches.md b/docs/list-old-branches.md new file mode 100644 index 00000000..c4ee984f --- /dev/null +++ b/docs/list-old-branches.md @@ -0,0 +1,87 @@ +Script: *list-old-branches.ps1* +======================== + +This PowerShell script lists branches in a Git repository matching: (1) search pattern, (2) already merged, (3) older than 2024 + +Parameters +---------- +```powershell +/home/markus/Repos/PowerShell/scripts/list-old-branches.ps1 [[-pathToRepo] ] [[-searchPattern] ] [] + +-pathToRepo + Specifies the path to the Git repository (current working directory by default) + + Required? false + Position? 1 + Default value "$PWD" + Accept pipeline input? false + Accept wildcard characters? false + +-searchPattern + + Required? false + Position? 2 + Default value origin/dev/* + Accept pipeline input? false + Accept wildcard characters? false + +[] + This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, + WarningVariable, OutBuffer, PipelineVariable, and OutVariable. +``` + +Example +------- +```powershell +PS> ./list-old-branches.ps1 C:\Repos\UFA +q + +``` + +Script Content +-------------- +```powershell +<# +.SYNOPSIS + Lists old Git branches +.DESCRIPTION + This PowerShell script lists branches in a Git repository matching: (1) search pattern, (2) already merged, (3) older than 2024 +.PARAMETER pathToRepo + Specifies the path to the Git repository (current working directory by default) +.EXAMPLE + PS> ./list-old-branches.ps1 C:\Repos\UFA +q#> + +param([string]$pathToRepo = "$PWD", [string]$searchPattern = "origin/dev/*") + +try { + "(1/3) Searching for Git executable... " + & git --version + if ($lastExitCode -ne "0") { throw "Can't execute 'git' - make sure Git is installed and available" } + + "(2/3) Checking local repository..." + if (!(Test-Path "$pathToRepo" -pathType container)) { throw "Can't access repo folder: $pathToRepo" } + + "(3/3) Querying already merged branches with name '$searchPattern'..." + $branches = $(git -C "$pathToRepo" branch --list --remotes --no-color --no-column --merged HEAD "$searchPattern") + if ($lastExitCode -ne "0") { throw "'git branch --list' failed" } + + "" + "LAST COMMIT DATE BRANCH NAME" + "---------------- -----------" + foreach($branch in $branches) { + $branchName = $branch.Trim() # remove leading spaces + + $dateOfLastCommit = (git -C "$pathToRepo" log -1 --format=%cs $branchName) + if ($dateOfLastCommit -like "2024-*") { continue} # too young + + "$dateOfLastCommit $branchName" + } + exit 0 # success +} catch { + Write-Error "Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" + exit 1 +} +``` + +*(generated by convert-ps2md.ps1 using the comment-based help of list-old-branches.ps1 as of 11/08/2024 12:34:51)* diff --git a/docs/list-os-releases.md b/docs/list-os-releases.md index dcc66f73..3341f43e 100644 --- a/docs/list-os-releases.md +++ b/docs/list-os-releases.md @@ -6,7 +6,7 @@ This PowerShell script lists OS releases and download URL. Parameters ---------- ```powershell -PS> ./list-os-releases.ps1 [] +/home/markus/Repos/PowerShell/scripts/list-os-releases.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -66,4 +66,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-os-releases.ps1 as of 08/15/2024 09:50:50)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-os-releases.ps1 as of 11/08/2024 12:34:51)* diff --git a/docs/list-os-updates.md b/docs/list-os-updates.md index e611a7e2..203aefbe 100644 --- a/docs/list-os-updates.md +++ b/docs/list-os-updates.md @@ -6,7 +6,7 @@ This PowerShell script lists the latest updates for operating systems. Parameters ---------- ```powershell -PS> ./list-os-updates.ps1 [[-RSS_URL] ] [[-MaxCount] ] [] +/home/markus/Repos/PowerShell/scripts/list-os-updates.ps1 [[-RSS_URL] ] [[-MaxCount] ] [] -RSS_URL Specifies the URL to the RSS feed @@ -89,4 +89,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-os-updates.ps1 as of 08/15/2024 09:50:50)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-os-updates.ps1 as of 11/08/2024 12:34:51)* diff --git a/docs/list-os.md b/docs/list-os.md index 7227660b..730c225a 100644 --- a/docs/list-os.md +++ b/docs/list-os.md @@ -6,7 +6,7 @@ This PowerShell script lists the exact operating system version. Parameters ---------- ```powershell -PS> ./list-os.ps1 [] +/home/markus/Repos/PowerShell/scripts/list-os.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -61,4 +61,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-os.ps1 as of 08/15/2024 09:50:50)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-os.ps1 as of 11/08/2024 12:34:51)* diff --git a/docs/list-outlook-inbox.md b/docs/list-outlook-inbox.md index 4acfc051..85eb78a0 100644 --- a/docs/list-outlook-inbox.md +++ b/docs/list-outlook-inbox.md @@ -6,7 +6,7 @@ This PowerShell script lists the emails in the inbox of Outlook. Parameters ---------- ```powershell -PS> ./list-outlook-inbox.ps1 [] +/home/markus/Repos/PowerShell/scripts/list-outlook-inbox.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -56,4 +56,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-outlook-inbox.ps1 as of 08/15/2024 09:50:50)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-outlook-inbox.ps1 as of 11/08/2024 12:34:51)* diff --git a/docs/list-outlook-sent.md b/docs/list-outlook-sent.md index c82ef9cf..58fabc05 100644 --- a/docs/list-outlook-sent.md +++ b/docs/list-outlook-sent.md @@ -6,7 +6,7 @@ This PowerShell script lists the mails in the Sent Mail folder of Outlook. Parameters ---------- ```powershell -PS> ./list-outlook-sent.ps1 [] +/home/markus/Repos/PowerShell/scripts/list-outlook-sent.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -56,4 +56,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-outlook-sent.ps1 as of 08/15/2024 09:50:50)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-outlook-sent.ps1 as of 11/08/2024 12:34:51)* diff --git a/docs/list-passwords.md b/docs/list-passwords.md index b4b1f0d0..d4aad70a 100644 --- a/docs/list-passwords.md +++ b/docs/list-passwords.md @@ -6,7 +6,7 @@ This PowerShell script lists random passwords. Parameters ---------- ```powershell -PS> ./list-passwords.ps1 [[-PasswordLength] ] [[-Columns] ] [[-Rows] ] [] +/home/markus/Repos/PowerShell/scripts/list-passwords.ps1 [[-PasswordLength] ] [[-Columns] ] [[-Rows] ] [] -PasswordLength Specifies the length of the password @@ -111,4 +111,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-passwords.ps1 as of 08/15/2024 09:50:50)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-passwords.ps1 as of 11/08/2024 12:34:51)* diff --git a/docs/list-pins.md b/docs/list-pins.md index 24cb6d59..e3be02f7 100644 --- a/docs/list-pins.md +++ b/docs/list-pins.md @@ -6,7 +6,7 @@ This PowerShell script lists random PIN's. Parameters ---------- ```powershell -PS> ./list-pins.ps1 [[-PinLength] ] [[-Columns] ] [[-Rows] ] [] +/home/markus/Repos/PowerShell/scripts/list-pins.ps1 [[-PinLength] ] [[-Columns] ] [[-Rows] ] [] -PinLength Specifies the PIN length @@ -100,4 +100,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-pins.ps1 as of 08/15/2024 09:50:50)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-pins.ps1 as of 11/08/2024 12:34:51)* diff --git a/docs/list-power-schemes.md b/docs/list-power-schemes.md index f8322acd..463c764c 100644 --- a/docs/list-power-schemes.md +++ b/docs/list-power-schemes.md @@ -21,4 +21,4 @@ powercfg /list exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-power-schemes.ps1 as of 08/15/2024 09:50:50)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-power-schemes.ps1 as of 11/08/2024 12:34:51)* diff --git a/docs/list-powershell-modules.md b/docs/list-powershell-modules.md index f9a59e45..69f94553 100644 --- a/docs/list-powershell-modules.md +++ b/docs/list-powershell-modules.md @@ -6,7 +6,7 @@ This PowerShell script lists the installed PowerShell modules. Parameters ---------- ```powershell -PS> ./list-powershell-modules.ps1 [] +/home/markus/Repos/PowerShell/scripts/list-powershell-modules.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -65,4 +65,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-powershell-modules.ps1 as of 08/15/2024 09:50:50)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-powershell-modules.ps1 as of 11/08/2024 12:34:51)* diff --git a/docs/list-powershell-profiles.md b/docs/list-powershell-profiles.md index 1459fe4f..847a0d2e 100644 --- a/docs/list-powershell-profiles.md +++ b/docs/list-powershell-profiles.md @@ -58,4 +58,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-powershell-profiles.ps1 as of 08/15/2024 09:50:50)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-powershell-profiles.ps1 as of 11/08/2024 12:34:51)* diff --git a/docs/list-powershell-verbs.md b/docs/list-powershell-verbs.md index b0be17fc..361a960e 100644 --- a/docs/list-powershell-verbs.md +++ b/docs/list-powershell-verbs.md @@ -6,7 +6,7 @@ This PowerShell script lists all allowed/recommended verbs in PowerShell. Parameters ---------- ```powershell -PS> ./list-powershell-verbs.ps1 [] +/home/markus/Repos/PowerShell/scripts/list-powershell-verbs.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -65,4 +65,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-powershell-verbs.ps1 as of 08/15/2024 09:50:50)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-powershell-verbs.ps1 as of 11/08/2024 12:34:51)* diff --git a/docs/list-print-jobs.md b/docs/list-print-jobs.md index 78b2145f..088c137d 100644 --- a/docs/list-print-jobs.md +++ b/docs/list-print-jobs.md @@ -6,7 +6,7 @@ This PowerShell script lists all print jobs of all printer devices. Parameters ---------- ```powershell -PS> ./list-print-jobs.ps1 [] +/home/markus/Repos/PowerShell/scripts/list-print-jobs.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -87,4 +87,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-print-jobs.ps1 as of 08/15/2024 09:50:50)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-print-jobs.ps1 as of 11/08/2024 12:34:51)* diff --git a/docs/list-printers.md b/docs/list-printers.md index 6c7aff1c..3f67a17a 100644 --- a/docs/list-printers.md +++ b/docs/list-printers.md @@ -6,7 +6,7 @@ This PowerShell script lists all printers known to the local computer. Parameters ---------- ```powershell -PS> ./list-printers.ps1 [] +/home/markus/Repos/PowerShell/scripts/list-printers.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -59,4 +59,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-printers.ps1 as of 08/15/2024 09:50:50)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-printers.ps1 as of 11/08/2024 12:34:51)* diff --git a/docs/list-processes.md b/docs/list-processes.md index 1a5fcfc8..86ea3888 100644 --- a/docs/list-processes.md +++ b/docs/list-processes.md @@ -6,7 +6,7 @@ This PowerShell script lists all local computer processes. Parameters ---------- ```powershell -PS> ./list-processes.ps1 [] +/home/markus/Repos/PowerShell/scripts/list-processes.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -65,4 +65,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-processes.ps1 as of 08/15/2024 09:50:50)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-processes.ps1 as of 11/08/2024 12:34:51)* diff --git a/docs/list-pull-requests.md b/docs/list-pull-requests.md index b5c2313b..c6f68187 100644 --- a/docs/list-pull-requests.md +++ b/docs/list-pull-requests.md @@ -6,7 +6,7 @@ This PowerShell script lists all pull requests for a Git repository. Parameters ---------- ```powershell -PS> ./list-pull-requests.ps1 [[-RepoDir] ] [] +/home/markus/Repos/PowerShell/scripts/list-pull-requests.ps1 [[-RepoDir] ] [] -RepoDir Specifies the file path to the local Git repository (default is working directory). @@ -83,4 +83,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-pull-requests.ps1 as of 08/15/2024 09:50:50)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-pull-requests.ps1 as of 11/08/2024 12:34:51)* diff --git a/docs/list-ram.md b/docs/list-ram.md index 9293594c..b5f0c304 100644 --- a/docs/list-ram.md +++ b/docs/list-ram.md @@ -6,7 +6,7 @@ This PowerShell script lists the details of the installed RAM. Parameters ---------- ```powershell -PS> ./list-ram.ps1 [] +/home/markus/Repos/PowerShell/scripts/list-ram.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -63,4 +63,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-ram.ps1 as of 08/15/2024 09:50:50)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-ram.ps1 as of 11/08/2024 12:34:51)* diff --git a/docs/list-read-only-files.md b/docs/list-read-only-files.md index 7ca6599c..51e79254 100644 --- a/docs/list-read-only-files.md +++ b/docs/list-read-only-files.md @@ -6,7 +6,7 @@ This PowerShell script scans a directory tree and lists all read-only files. Parameters ---------- ```powershell -PS> ./list-read-only-files.ps1 [[-path] ] [] +/home/markus/Repos/PowerShell/scripts/list-read-only-files.ps1 [[-path] ] [] -path Specifies the path to the directory tree (current working dir by default) @@ -27,7 +27,7 @@ Example ```powershell PS> ./list-read-only-files.ps1 C:\Windows ... -βœ”οΈ Found 107 read-only files within πŸ“‚C:\Windows in 50 sec +βœ… Found 107 read-only files within πŸ“‚C:\Windows in 50 sec ``` @@ -52,7 +52,7 @@ Script Content .EXAMPLE PS> ./list-read-only-files.ps1 C:\Windows ... - βœ”οΈ Found 107 read-only files within πŸ“‚C:\Windows in 50 sec + βœ… Found 107 read-only files within πŸ“‚C:\Windows in 50 sec .LINK https://github.com/fleschutz/PowerShell .NOTES @@ -73,7 +73,7 @@ try { } Write-Progress -completed " " [int]$elapsed = $stopWatch.Elapsed.TotalSeconds - "βœ”οΈ Found $count read-only files within πŸ“‚$path in $elapsed sec" + "βœ… Found $count read-only files within πŸ“‚$path in $elapsed sec" exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -81,4 +81,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-read-only-files.ps1 as of 08/15/2024 09:50:50)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-read-only-files.ps1 as of 11/08/2024 12:34:51)* diff --git a/docs/list-recycle-bin.md b/docs/list-recycle-bin.md index 83b7b903..4a46522b 100644 --- a/docs/list-recycle-bin.md +++ b/docs/list-recycle-bin.md @@ -6,7 +6,7 @@ This PowerShell script lists the content of the recycle bin folder. Parameters ---------- ```powershell -PS> ./list-recycle-bin.ps1 [] +/home/markus/Repos/PowerShell/scripts/list-recycle-bin.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -53,4 +53,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-recycle-bin.ps1 as of 08/15/2024 09:50:50)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-recycle-bin.ps1 as of 11/08/2024 12:34:51)* diff --git a/docs/list-repos.md b/docs/list-repos.md index d23b304e..15d4bf22 100644 --- a/docs/list-repos.md +++ b/docs/list-repos.md @@ -1,12 +1,12 @@ Script: *list-repos.ps1* ======================== -This PowerShell script lists all Git repositories in a folder with details such as latest tag/branch/status/URL. +This PowerShell script lists all Git repositories under a folder with details such as latest tag, branch, remote URL, and status. Parameters ---------- ```powershell -PS> ./list-repos.ps1 [[-parentDir] ] [] +/home/markus/Repos/PowerShell/scripts/list-repos.ps1 [[-parentDir] ] [] -parentDir Specifies the path to the parent directory (current working directory by default) @@ -25,13 +25,13 @@ PS> ./list-repos.ps1 [[-parentDir] ] [] Example ------- ```powershell -PS> ./list-repos.ps1 C:\Repos +PS> ./list-repos.ps1 C:\MyRepos -Local Repo Latest Tag Branch Status Remote Repo ----------- ---------- ------ ------ ----------- -πŸ“‚cmake v3.23.0 main βœ”οΈclean ↓0 git@github.com:Kitware/CMake +REPOSITORY LATEST TAG BRANCH REMOTE URL STATUS +---------- ---------- ------ ---------- ------ +πŸ“‚cmake v3.30.2 master https://github.com/Kitware/CMake βœ…clean ↓0 ... ``` @@ -51,15 +51,15 @@ Script Content .SYNOPSIS Lists Git repositories .DESCRIPTION - This PowerShell script lists all Git repositories in a folder with details such as latest tag/branch/status/URL. + This PowerShell script lists all Git repositories under a folder with details such as latest tag, branch, remote URL, and status. .PARAMETER parentDir Specifies the path to the parent directory (current working directory by default) .EXAMPLE - PS> ./list-repos.ps1 C:\Repos + PS> ./list-repos.ps1 C:\MyRepos - Local Repo Latest Tag Branch Status Remote Repo - ---------- ---------- ------ ------ ----------- - πŸ“‚cmake v3.23.0 main βœ”οΈclean ↓0 git@github.com:Kitware/CMake + REPOSITORY LATEST TAG BRANCH REMOTE URL STATUS + ---------- ---------- ------ ---------- ------ + πŸ“‚cmake v3.30.2 master https://github.com/Kitware/CMake βœ…clean ↓0 ... .LINK https://github.com/fleschutz/PowerShell @@ -70,32 +70,32 @@ Script Content param([string]$parentDir = "$PWD") function ListRepos { - $folders = (Get-ChildItem "$parentDir" -attributes Directory) - foreach($folder in $folders) { - $folderName = (Get-Item "$folder").Name - $latestTagCommitID = (git -C "$folder" rev-list --tags --max-count=1) - if ($latestTagCommitID -ne "") { - $latestTag = (git -C "$folder" describe --tags $latestTagCommitID) + $dirs = (Get-ChildItem "$parentDir" -attributes Directory) + foreach($dir in $dirs) { + $dirName = (Get-Item "$dir").Name + $latestTagCommitID = (git -C "$dir" rev-list --tags --max-count=1) + if ("$latestTagCommitID" -ne "") { + $latestTag = (git -C "$dir" describe --tags $latestTagCommitID) } else { $latestTag = "" } - $branch = (git -C "$folder" branch --show-current) - $remoteURL = (git -C "$folder" remote get-url origin) - $numCommits = (git -C "$folder" rev-list HEAD...origin/$branch --count) - $status = (git -C "$folder" status --short) - if ("$status" -eq "") { $status = "βœ”οΈclean" } + $branch = (git -C "$dir" branch --show-current) + $remoteURL = (git -C "$dir" remote get-url origin) + $numCommits = (git -C "$dir" rev-list HEAD...origin/$branch --count) + $status = (git -C "$dir" status --short) + if ("$status" -eq "") { $status = "βœ…clean" } elseif ("$status" -like " M *") { $status = "⚠️changed" } - New-Object PSObject -property @{'Local Repo'="πŸ“‚$folderName";'Latest Tag'="$latestTag";'Branch'="$branch";'Status'="$status";'Remote Repo'="↓$numCommits $remoteURL"} + New-Object PSObject -property @{'REPOSITORY'="πŸ“‚$dirName";'LATEST TAG'="$latestTag";'BRANCH'="$branch";'REMOTE URL'="$remoteURL";'STATUS'="$status ↓$numCommits"} } } try { - if (-not(Test-Path "$parentDir" -pathType container)) { throw "Can't access directory: $parentDir" } + if (-not(Test-Path "$parentDir" -pathType container)) { throw "Can't access parent directory at: $parentDir" } $null = (git --version) if ($lastExitCode -ne "0") { throw "Can't execute 'git' - make sure Git is installed and available" } - ListRepos | Format-Table -property @{e='Local Repo';width=19},@{e='Latest Tag';width=16},@{e='Branch';width=19},@{e='Status';width=10},'Remote Repo' + ListRepos | Format-Table -property @{e='REPOSITORY';width=19},@{e='LATEST TAG';width=16},@{e='BRANCH';width=19},@{e='REMOTE URL';width=47},@{e='STATUS';width=12} exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -103,4 +103,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-repos.ps1 as of 08/15/2024 09:50:50)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-repos.ps1 as of 11/08/2024 12:34:51)* diff --git a/docs/list-scripts.md b/docs/list-scripts.md index 4788948e..8e633d51 100644 --- a/docs/list-scripts.md +++ b/docs/list-scripts.md @@ -70,4 +70,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-scripts.ps1 as of 08/15/2024 09:50:50)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-scripts.ps1 as of 11/08/2024 12:34:51)* diff --git a/docs/list-scsi-devices.md b/docs/list-scsi-devices.md index 5de653a8..96a63421 100644 --- a/docs/list-scsi-devices.md +++ b/docs/list-scsi-devices.md @@ -6,7 +6,7 @@ This PowerShell script lists all SCSI devices connected to the local computer. Parameters ---------- ```powershell -PS> ./list-scsi-devices.ps1 [] +/home/markus/Repos/PowerShell/scripts/list-scsi-devices.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -65,4 +65,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-scsi-devices.ps1 as of 08/15/2024 09:50:50)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-scsi-devices.ps1 as of 11/08/2024 12:34:51)* diff --git a/docs/list-services.md b/docs/list-services.md index 80ccec40..7653ec75 100644 --- a/docs/list-services.md +++ b/docs/list-services.md @@ -6,7 +6,7 @@ This PowerShell script lists all services installed on the local computer. Parameters ---------- ```powershell -PS> ./list-services.ps1 [] +/home/markus/Repos/PowerShell/scripts/list-services.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -65,4 +65,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-services.ps1 as of 08/15/2024 09:50:50)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-services.ps1 as of 11/08/2024 12:34:51)* diff --git a/docs/list-special-folders.md b/docs/list-special-folders.md index 8c593326..4b8f1788 100644 --- a/docs/list-special-folders.md +++ b/docs/list-special-folders.md @@ -105,4 +105,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-special-folders.ps1 as of 08/15/2024 09:50:50)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-special-folders.ps1 as of 11/08/2024 12:34:51)* diff --git a/docs/list-sql-tables.md b/docs/list-sql-tables.md index fa49def6..28d31b20 100644 --- a/docs/list-sql-tables.md +++ b/docs/list-sql-tables.md @@ -8,7 +8,7 @@ Run the above command if you do not have this module. Parameters ---------- ```powershell -PS> ./list-sql-tables.ps1 [-server] [-database] [-username] [-password] [] +/home/markus/Repos/PowerShell/scripts/list-sql-tables.ps1 [-server] [-database] [-username] [-password] [] -server @@ -93,4 +93,4 @@ $result = Invoke-SqlServerQuery -Credential $creds -ConnectionTimeout 10000 -Dat $result | Export-Csv $csvfilepath -NoTypeInformation ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-sql-tables.ps1 as of 08/15/2024 09:50:50)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-sql-tables.ps1 as of 11/08/2024 12:34:51)* diff --git a/docs/list-ssh-key.md b/docs/list-ssh-key.md new file mode 100644 index 00000000..32e97bfc --- /dev/null +++ b/docs/list-ssh-key.md @@ -0,0 +1,64 @@ +Script: *list-ssh-key.ps1* +======================== + +This PowerShell script lists the user's public SSH key. + +Parameters +---------- +```powershell +/home/markus/Repos/PowerShell/scripts/list-ssh-key.ps1 [] + +[] + This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, + WarningVariable, OutBuffer, PipelineVariable, and OutVariable. +``` + +Example +------- +```powershell +PS> ./list-ssh-key.ps1 + +``` + +Notes +----- +Author: Markus Fleschutz | License: CC0 + +Related Links +------------- +https://github.com/fleschutz/PowerShell + +Script Content +-------------- +```powershell +<# +.SYNOPSIS + Lists the public SSH key +.DESCRIPTION + This PowerShell script lists the user's public SSH key. +.EXAMPLE + PS> ./list-ssh-key.ps1 +.LINK + https://github.com/fleschutz/PowerShell +.NOTES + Author: Markus Fleschutz | License: CC0 +#> + +try { + if (Test-Path "~/.ssh/id_ed25519.pub") { + $key = Get-Content "~/.ssh/id_ed25519.pub" + } elseif (Test-Path "~/.ssh/id_rsa.pub") { + $key = Get-Content "~/.ssh/id_rsa.pub" + } else { + "⚠️ No SSH key found - execute 'new-ssh-key.ps1' to create one" + exit 1 + } + "βœ… Public SSH key: $key" + exit 0 # success +} catch { + "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" + exit 1 +} +``` + +*(generated by convert-ps2md.ps1 using the comment-based help of list-ssh-key.ps1 as of 11/08/2024 12:34:51)* diff --git a/docs/list-submodules.md b/docs/list-submodules.md index 5b0942d6..0a0bad9b 100644 --- a/docs/list-submodules.md +++ b/docs/list-submodules.md @@ -6,7 +6,7 @@ This PowerShell script lists the submodules in the given Git repository. Parameters ---------- ```powershell -PS> ./list-submodules.ps1 [[-RepoDir] ] [] +/home/markus/Repos/PowerShell/scripts/list-submodules.ps1 [[-RepoDir] ] [] -RepoDir Specifies the path to the repository (current working directory by default) @@ -81,4 +81,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-submodules.ps1 as of 08/15/2024 09:50:50)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-submodules.ps1 as of 11/08/2024 12:34:51)* diff --git a/docs/list-suggestions.md b/docs/list-suggestions.md index ee3283c2..08d27ac2 100644 --- a/docs/list-suggestions.md +++ b/docs/list-suggestions.md @@ -6,7 +6,7 @@ This PowerShell script lists "Did you mean?" suggestions from Google. Parameters ---------- ```powershell -PS> ./list-suggestions.ps1 [[-text] ] [] +/home/markus/Repos/PowerShell/scripts/list-suggestions.ps1 [[-text] ] [] -text Specifies the word or sentence to get suggestions for. @@ -75,4 +75,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-suggestions.ps1 as of 08/15/2024 09:50:50)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-suggestions.ps1 as of 11/08/2024 12:34:51)* diff --git a/docs/list-system-devices.md b/docs/list-system-devices.md index b1fa3481..82627c17 100644 --- a/docs/list-system-devices.md +++ b/docs/list-system-devices.md @@ -6,7 +6,7 @@ This PowerShell script lists all system devices connected to the local computer. Parameters ---------- ```powershell -PS> ./list-system-devices.ps1 [] +/home/markus/Repos/PowerShell/scripts/list-system-devices.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -65,4 +65,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-system-devices.ps1 as of 08/15/2024 09:50:50)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-system-devices.ps1 as of 11/08/2024 12:34:51)* diff --git a/docs/list-system-files.md b/docs/list-system-files.md index f8a89c7f..f4301718 100644 --- a/docs/list-system-files.md +++ b/docs/list-system-files.md @@ -6,7 +6,7 @@ This PowerShell script scans a directory tree and lists all system files. Parameters ---------- ```powershell -PS> ./list-system-files.ps1 [[-path] ] [] +/home/markus/Repos/PowerShell/scripts/list-system-files.ps1 [[-path] ] [] -path Specifies the path to the directory tree (default is current working dir) @@ -27,7 +27,7 @@ Example ```powershell PS> ./list-system-files.ps1 C:\Windows ... -βœ”οΈ Found 764 system files within πŸ“‚C:\windows in 50 sec +βœ… Found 764 system files within πŸ“‚C:\windows in 50 sec ``` @@ -52,7 +52,7 @@ Script Content .EXAMPLE PS> ./list-system-files.ps1 C:\Windows ... - βœ”οΈ Found 764 system files within πŸ“‚C:\windows in 50 sec + βœ… Found 764 system files within πŸ“‚C:\windows in 50 sec .LINK https://github.com/fleschutz/PowerShell .NOTES @@ -73,7 +73,7 @@ try { } Write-Progress -completed " " [int]$elapsed = $stopWatch.Elapsed.TotalSeconds - "βœ”οΈ Found $count system files within πŸ“‚$path in $elapsed sec" + "βœ… Found $count system files within πŸ“‚$path in $elapsed sec" exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -81,4 +81,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-system-files.ps1 as of 08/15/2024 09:50:50)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-system-files.ps1 as of 11/08/2024 12:34:51)* diff --git a/docs/list-system-info.md b/docs/list-system-info.md index aa04abb7..f0d555fe 100644 --- a/docs/list-system-info.md +++ b/docs/list-system-info.md @@ -6,7 +6,7 @@ This PowerShell script lists system information of the local computer. Parameters ---------- ```powershell -PS> ./list-system-info.ps1 [] +/home/markus/Repos/PowerShell/scripts/list-system-info.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -141,4 +141,4 @@ $info exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-system-info.ps1 as of 08/15/2024 09:50:50)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-system-info.ps1 as of 11/08/2024 12:34:51)* diff --git a/docs/list-tags.md b/docs/list-tags.md index c72f8e3d..9b26c832 100644 --- a/docs/list-tags.md +++ b/docs/list-tags.md @@ -6,7 +6,7 @@ This PowerShell script fetches all tags in a local Git repository and lists it ( Parameters ---------- ```powershell -PS> ./list-tags.ps1 [[-repoDir] ] [[-searchPattern] ] [] +/home/markus/Repos/PowerShell/scripts/list-tags.ps1 [[-repoDir] ] [[-searchPattern] ] [] -repoDir Specifies the path to the Git repository (current working directory by default) @@ -110,4 +110,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-tags.ps1 as of 08/15/2024 09:50:50)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-tags.ps1 as of 11/08/2024 12:34:51)* diff --git a/docs/list-tasks.md b/docs/list-tasks.md index 771c2d65..2edde02b 100644 --- a/docs/list-tasks.md +++ b/docs/list-tasks.md @@ -25,18 +25,18 @@ Script Content .EXAMPLE PS> ./list-tasks.ps1 - TaskName State TaskPath - -------- ----- -------- - .NET Framework NGEN v4.0.30319 Ready \Microsoft\Windows\.NET Framework\ + TASKNAME TASKPATH STATE + -------- -------- ----- + .NET Framework NGEN v4.0.30319 \Microsoft\Windows\.NET Framework\ Ready ... .LINK - https://github.com/fleschutz/PowerShell + https://github.com/fleschutz/PowerShell0 .NOTES Author: Markus Fleschutz | License: CC0 #> try { - Get-ScheduledTask | Format-Table -property TaskName,State,TaskPath + Get-ScheduledTask | Format-Table -property @{e='TASKNAME';width=40},@{e='TASKPATH';width=55},@{e='STATE';width=10} exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -44,4 +44,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-tasks.ps1 as of 08/15/2024 09:50:50)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-tasks.ps1 as of 11/08/2024 12:34:51)* diff --git a/docs/list-timezone.md b/docs/list-timezone.md index 699433cb..bdb4ab69 100644 --- a/docs/list-timezone.md +++ b/docs/list-timezone.md @@ -6,7 +6,7 @@ This PowerShell script lists the details of the current time zone. Parameters ---------- ```powershell -PS> ./list-timezone.ps1 [] +/home/markus/Repos/PowerShell/scripts/list-timezone.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -64,4 +64,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-timezone.ps1 as of 08/15/2024 09:50:50)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-timezone.ps1 as of 11/08/2024 12:34:51)* diff --git a/docs/list-timezones.md b/docs/list-timezones.md index 456e14e2..7ea053bf 100644 --- a/docs/list-timezones.md +++ b/docs/list-timezones.md @@ -6,7 +6,7 @@ This PowerShell script lists all available time zones. Parameters ---------- ```powershell -PS> ./list-timezones.ps1 [] +/home/markus/Repos/PowerShell/scripts/list-timezones.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -67,4 +67,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-timezones.ps1 as of 08/15/2024 09:50:50)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-timezones.ps1 as of 11/08/2024 12:34:51)* diff --git a/docs/list-tiobe-index.md b/docs/list-tiobe-index.md index 6df49d40..143b63ae 100644 --- a/docs/list-tiobe-index.md +++ b/docs/list-tiobe-index.md @@ -78,4 +78,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-tiobe-index.ps1 as of 08/15/2024 09:50:50)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-tiobe-index.ps1 as of 11/08/2024 12:34:51)* diff --git a/docs/list-unused-files.md b/docs/list-unused-files.md index e4318e46..2f33b402 100644 --- a/docs/list-unused-files.md +++ b/docs/list-unused-files.md @@ -6,7 +6,7 @@ This PowerShell script scans a directory tree and lists unused files (no read/wr Parameters ---------- ```powershell -PS> ./list-unused-files.ps1 [[-path] ] [[-days] ] [] +/home/markus/Repos/PowerShell/scripts/list-unused-files.ps1 [[-path] ] [[-days] ] [] -path Specifies the path to the directory tree (current working dir by default) @@ -36,7 +36,7 @@ Example ```powershell PS> ./list-unused-files.ps1 C:\Windows ... -βœ”οΈ Found 43729 unused files (no access for 100 days) within πŸ“‚C:\Windows in 113 sec +βœ… Found 43729 unused files (no access for 100 days) within πŸ“‚C:\Windows in 113 sec ``` @@ -63,7 +63,7 @@ Script Content .EXAMPLE PS> ./list-unused-files.ps1 C:\Windows ... - βœ”οΈ Found 43729 unused files (no access for 100 days) within πŸ“‚C:\Windows in 113 sec + βœ… Found 43729 unused files (no access for 100 days) within πŸ“‚C:\Windows in 113 sec .LINK https://github.com/fleschutz/PowerShell .NOTES @@ -87,7 +87,7 @@ try { Write-Progress -completed " " [int]$elapsed = $stopWatch.Elapsed.TotalSeconds - "βœ”οΈ Found $count unused files (no access for $days days) within πŸ“‚$path in $elapsed sec" + "βœ… Found $count unused files (no access for $days days) within πŸ“‚$path in $elapsed sec" exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -95,4 +95,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-unused-files.ps1 as of 08/15/2024 09:50:50)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-unused-files.ps1 as of 11/08/2024 12:34:51)* diff --git a/docs/list-updates.md b/docs/list-updates.md index d0440e92..c1f96251 100644 --- a/docs/list-updates.md +++ b/docs/list-updates.md @@ -8,7 +8,7 @@ NOTE: Use the script 'install-updates.ps1' to install the listed updates. Parameters ---------- ```powershell -PS> ./list-updates.ps1 [] +/home/markus/Repos/PowerShell/scripts/list-updates.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -76,7 +76,7 @@ try { Write-Progress -completed "Done." } " " - "NOTE: Use the script 'install-updates.ps1' to install the listed updates." + "NOTE: Execute script 'install-updates.ps1' to install the listed updates." exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -84,4 +84,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-updates.ps1 as of 08/15/2024 09:50:50)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-updates.ps1 as of 11/08/2024 12:34:51)* diff --git a/docs/list-usb-devices.md b/docs/list-usb-devices.md index b48b4818..c016453d 100644 --- a/docs/list-usb-devices.md +++ b/docs/list-usb-devices.md @@ -6,7 +6,7 @@ This PowerShell script lists all USB devices connected to the local computer. Parameters ---------- ```powershell -PS> ./list-usb-devices.ps1 [] +/home/markus/Repos/PowerShell/scripts/list-usb-devices.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -65,4 +65,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-usb-devices.ps1 as of 08/15/2024 09:50:50)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-usb-devices.ps1 as of 11/08/2024 12:34:51)* diff --git a/docs/list-user-accounts.md b/docs/list-user-accounts.md index 9e86408a..0a7feab7 100644 --- a/docs/list-user-accounts.md +++ b/docs/list-user-accounts.md @@ -6,7 +6,7 @@ This PowerShell script lists the user accounts on the local computer. Parameters ---------- ```powershell -PS> ./list-user-accounts.ps1 [] +/home/markus/Repos/PowerShell/scripts/list-user-accounts.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -45,7 +45,11 @@ Script Content #> try { - & net user + if ($IsLinux) { + & getent passwd + } else { + & net user + } exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -53,4 +57,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-user-accounts.ps1 as of 08/15/2024 09:50:50)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-user-accounts.ps1 as of 11/08/2024 12:34:51)* diff --git a/docs/list-user-groups.md b/docs/list-user-groups.md index fc487dac..fa939051 100644 --- a/docs/list-user-groups.md +++ b/docs/list-user-groups.md @@ -6,7 +6,7 @@ This PowerShell script lists the user groups of the local computer. Parameters ---------- ```powershell -PS> ./list-user-groups.ps1 [] +/home/markus/Repos/PowerShell/scripts/list-user-groups.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -65,4 +65,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-user-groups.ps1 as of 08/15/2024 09:50:50)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-user-groups.ps1 as of 11/08/2024 12:34:51)* diff --git a/docs/list-voices.md b/docs/list-voices.md index 0ecbf0d8..13a67248 100644 --- a/docs/list-voices.md +++ b/docs/list-voices.md @@ -6,7 +6,7 @@ This PowerShell script queries the installed text-to-speech (TTS) voices and pri Parameters ---------- ```powershell -PS> ./list-voices.ps1 [] +/home/markus/Repos/PowerShell/scripts/list-voices.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -71,4 +71,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-voices.ps1 as of 08/15/2024 09:50:50)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-voices.ps1 as of 11/08/2024 12:34:51)* diff --git a/docs/list-weather.md b/docs/list-weather.md index 255e73c8..5f3ecc5c 100644 --- a/docs/list-weather.md +++ b/docs/list-weather.md @@ -6,7 +6,7 @@ This PowerShell script queries the 48h weather report from wttr.in and lists it Parameters ---------- ```powershell -PS> ./list-weather.ps1 [[-location] ] [] +/home/markus/Repos/PowerShell/scripts/list-weather.ps1 [[-location] ] [] -location Specifies the location to use (determined automatically by default) @@ -172,9 +172,9 @@ try { } exit 0 # success } catch { - "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" + "⚠️ Sorry: $($Error[0]) in script line $($_.InvocationInfo.ScriptLineNumber)." exit 1 } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-weather.ps1 as of 08/15/2024 09:50:50)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-weather.ps1 as of 11/08/2024 12:34:51)* diff --git a/docs/list-wifi.md b/docs/list-wifi.md index 9dd4b8ea..bc4e4d7e 100644 --- a/docs/list-wifi.md +++ b/docs/list-wifi.md @@ -6,7 +6,7 @@ This PowerShell script lists the WIFI networks. Parameters ---------- ```powershell -PS> ./list-wifi.ps1 [] +/home/markus/Repos/PowerShell/scripts/list-wifi.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -53,4 +53,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-wifi.ps1 as of 08/15/2024 09:50:50)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-wifi.ps1 as of 11/08/2024 12:34:52)* diff --git a/docs/list-window-titles.md b/docs/list-window-titles.md index ca3421b0..57395b7d 100644 --- a/docs/list-window-titles.md +++ b/docs/list-window-titles.md @@ -6,7 +6,7 @@ This PowerShell script queries all main window titles and lists them as a table. Parameters ---------- ```powershell -PS> ./list-window-titles.ps1 [] +/home/markus/Repos/PowerShell/scripts/list-window-titles.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -65,4 +65,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-window-titles.ps1 as of 08/15/2024 09:50:50)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-window-titles.ps1 as of 11/08/2024 12:34:52)* diff --git a/docs/list-workdir.md b/docs/list-workdir.md index 97f98274..64cd0d62 100644 --- a/docs/list-workdir.md +++ b/docs/list-workdir.md @@ -6,7 +6,7 @@ This PowerShell script lists the path to current working directory (but not the Parameters ---------- ```powershell -PS> ./list-workdir.ps1 [] +/home/markus/Repos/PowerShell/scripts/list-workdir.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -56,4 +56,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-workdir.ps1 as of 08/15/2024 09:50:50)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-workdir.ps1 as of 11/08/2024 12:34:52)* diff --git a/docs/list-wsl-distros.md b/docs/list-wsl-distros.md index 094b2856..ff7bb09b 100644 --- a/docs/list-wsl-distros.md +++ b/docs/list-wsl-distros.md @@ -1,26 +1,68 @@ Script: *list-wsl-distros.ps1* ======================== -list-wsl-distros.ps1 - +This PowerShell script lists installed/available Linux distributions for Windows Subsystem for Linux (WSL). Parameters ---------- ```powershell - +/home/markus/Repos/PowerShell/scripts/list-wsl-distros.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, WarningVariable, OutBuffer, PipelineVariable, and OutVariable. ``` +Example +------- +```powershell +PS> ./list-wsl-distros.ps1 +NAME STATE VERSION +* Ubuntu-24.04 Stopped 2 +... + +``` + +Notes +----- +Author: Markus Fleschutz | License: CC0 + +Related Links +------------- +https://github.com/fleschutz/PowerShell + Script Content -------------- ```powershell -& wsl.exe --list --online -" " -& wsl.exe --status -exit 0 # success +<# +.SYNOPSIS + Lists distros for Windows Subsystem for Linux +.DESCRIPTION + This PowerShell script lists installed/available Linux distributions for Windows Subsystem for Linux (WSL). +.EXAMPLE + PS> ./list-wsl-distros.ps1 + NAME STATE VERSION + * Ubuntu-24.04 Stopped 2 + ... +.LINK + https://github.com/fleschutz/PowerShell +.NOTES + Author: Markus Fleschutz | License: CC0 +#> + +try { + if ($IsLinux -or $IsMacOS) { throw "Requires Windows Subsystem for Linux (WSL)" } + + & wsl.exe --list --verbose + " " + & wsl.exe --list --online + " " + & wsl.exe --status + exit 0 # success +} catch { + "⚠️ Error: $($Error[0]) in script line $($_.InvocationInfo.ScriptLineNumber)." + exit 1 +} ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-wsl-distros.ps1 as of 08/15/2024 09:50:50)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-wsl-distros.ps1 as of 11/08/2024 12:34:52)* diff --git a/docs/locate-city.md b/docs/locate-city.md index 4c344e8d..5c8cdf8a 100644 --- a/docs/locate-city.md +++ b/docs/locate-city.md @@ -6,7 +6,7 @@ This PowerShell script prints the geographic location of the given city. Parameters ---------- ```powershell -PS> ./locate-city.ps1 [[-city] ] [] +/home/markus/Repos/PowerShell/scripts/locate-city.ps1 [[-city] ] [] -city Specifies the name of the city to look for @@ -87,4 +87,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of locate-city.ps1 as of 08/15/2024 09:50:50)* +*(generated by convert-ps2md.ps1 using the comment-based help of locate-city.ps1 as of 11/08/2024 12:34:52)* diff --git a/docs/locate-ipaddress.md b/docs/locate-ipaddress.md index c200446a..b7df28c7 100644 --- a/docs/locate-ipaddress.md +++ b/docs/locate-ipaddress.md @@ -46,4 +46,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of locate-ipaddress.ps1 as of 08/15/2024 09:50:50)* +*(generated by convert-ps2md.ps1 using the comment-based help of locate-ipaddress.ps1 as of 11/08/2024 12:34:52)* diff --git a/docs/locate-my-phone.md b/docs/locate-my-phone.md index b4b71f4d..81882802 100644 --- a/docs/locate-my-phone.md +++ b/docs/locate-my-phone.md @@ -6,7 +6,7 @@ This PowerShell script launches the Web browser with the Google Find My Device w Parameters ---------- ```powershell -PS> ./locate-my-phone.ps1 [] +/home/markus/Repos/PowerShell/scripts/locate-my-phone.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of locate-my-phone.ps1 as of 08/15/2024 09:50:50)* +*(generated by convert-ps2md.ps1 using the comment-based help of locate-my-phone.ps1 as of 11/08/2024 12:34:52)* diff --git a/docs/locate-zip-code.md b/docs/locate-zip-code.md index c12df9d3..a13399af 100644 --- a/docs/locate-zip-code.md +++ b/docs/locate-zip-code.md @@ -6,7 +6,7 @@ This PowerShell script prints the geographic location of the given zip-code. Parameters ---------- ```powershell -PS> ./locate-zip-code.ps1 [[-CountryCode] ] [[-ZipCode] ] [] +/home/markus/Repos/PowerShell/scripts/locate-zip-code.ps1 [[-CountryCode] ] [[-ZipCode] ] [] -CountryCode Specifies the country code @@ -101,4 +101,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of locate-zip-code.ps1 as of 08/15/2024 09:50:51)* +*(generated by convert-ps2md.ps1 using the comment-based help of locate-zip-code.ps1 as of 11/08/2024 12:34:52)* diff --git a/docs/lock-desktop.md b/docs/lock-desktop.md index 9a63088a..7b6929d6 100644 --- a/docs/lock-desktop.md +++ b/docs/lock-desktop.md @@ -6,7 +6,7 @@ This PowerShell script locks the local computer desktop immediately. Parameters ---------- ```powershell -PS> ./lock-desktop.ps1 [] +/home/markus/Repos/PowerShell/scripts/lock-desktop.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -54,4 +54,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of lock-desktop.ps1 as of 08/15/2024 09:50:51)* +*(generated by convert-ps2md.ps1 using the comment-based help of lock-desktop.ps1 as of 11/08/2024 12:34:52)* diff --git a/docs/log-off.md b/docs/log-off.md index e7fe623b..40b80913 100644 --- a/docs/log-off.md +++ b/docs/log-off.md @@ -6,7 +6,7 @@ This PowerShell script logs off the current Windows user. Parameters ---------- ```powershell -PS> ./log-off.ps1 [] +/home/markus/Repos/PowerShell/scripts/log-off.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -53,4 +53,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of log-off.ps1 as of 08/15/2024 09:50:51)* +*(generated by convert-ps2md.ps1 using the comment-based help of log-off.ps1 as of 11/08/2024 12:34:52)* diff --git a/docs/make-install.md b/docs/make-install.md index 1f455d4a..e54ab355 100644 --- a/docs/make-install.md +++ b/docs/make-install.md @@ -6,7 +6,7 @@ This PowerShell script copies newer EXE's + DLL's from the build directory to th Parameters ---------- ```powershell -PS> ./make-install.ps1 [] +/home/markus/Repos/PowerShell/scripts/make-install.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -56,7 +56,7 @@ try { echo ------------------------------------------------------------------------------ echo. - "βœ”οΈ synced to %DST_DIR%" + "βœ… synced to %DST_DIR%" exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -64,4 +64,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of make-install.ps1 as of 08/15/2024 09:50:51)* +*(generated by convert-ps2md.ps1 using the comment-based help of make-install.ps1 as of 11/08/2024 12:34:52)* diff --git a/docs/measure-BubbleSort.md b/docs/measure-BubbleSort.md index 072693ac..f2a437d7 100644 --- a/docs/measure-BubbleSort.md +++ b/docs/measure-BubbleSort.md @@ -10,7 +10,7 @@ comparison sort, is named for the way smaller or larger elements "bubble" to the Parameters ---------- ```powershell -PS> ./measure-BubbleSort.ps1 [[-numIntegers] ] [] +/home/markus/Repos/PowerShell/scripts/measure-BubbleSort.ps1 [[-numIntegers] ] [] -numIntegers Specifies the number of integers to sort @@ -92,4 +92,4 @@ $elapsed3 = "{0:N3}" -f $elapsed # formatted to 3 decimal places exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of measure-BubbleSort.ps1 as of 08/15/2024 09:50:51)* +*(generated by convert-ps2md.ps1 using the comment-based help of measure-BubbleSort.ps1 as of 11/08/2024 12:34:52)* diff --git a/docs/measure-BucketSort.md b/docs/measure-BucketSort.md index f25377cc..f4251c92 100644 --- a/docs/measure-BucketSort.md +++ b/docs/measure-BucketSort.md @@ -15,7 +15,7 @@ to use, and whether the input is uniformly distributed. Parameters ---------- ```powershell -PS> ./measure-BucketSort.ps1 [[-numIntegers] ] [] +/home/markus/Repos/PowerShell/scripts/measure-BucketSort.ps1 [[-numIntegers] ] [] -numIntegers Specifies the number of integers to sort @@ -120,4 +120,4 @@ $elapsed3 = "{0:N3}" -f $elapsed # formatted to 3 decimal places exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of measure-BucketSort.ps1 as of 08/15/2024 09:50:51)* +*(generated by convert-ps2md.ps1 using the comment-based help of measure-BucketSort.ps1 as of 11/08/2024 12:34:52)* diff --git a/docs/measure-CountingSort.md b/docs/measure-CountingSort.md index 872f9fc5..238226c3 100644 --- a/docs/measure-CountingSort.md +++ b/docs/measure-CountingSort.md @@ -15,7 +15,7 @@ can handle larger keys more efficiently. Parameters ---------- ```powershell -PS> ./measure-CountingSort.ps1 [[-numIntegers] ] [] +/home/markus/Repos/PowerShell/scripts/measure-CountingSort.ps1 [[-numIntegers] ] [] -numIntegers Specifies the number of integers to sort @@ -111,4 +111,4 @@ $elapsed3 = "{0:N3}" -f $elapsed # formatted to 3 decimal places exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of measure-CountingSort.ps1 as of 08/15/2024 09:50:51)* +*(generated by convert-ps2md.ps1 using the comment-based help of measure-CountingSort.ps1 as of 11/08/2024 12:34:52)* diff --git a/docs/measure-HeapSort.md b/docs/measure-HeapSort.md index ce4c4870..fd35e1c0 100644 --- a/docs/measure-HeapSort.md +++ b/docs/measure-HeapSort.md @@ -13,7 +13,7 @@ find the largest element in each step. Parameters ---------- ```powershell -PS> ./measure-HeapSort.ps1 [[-numIntegers] ] [] +/home/markus/Repos/PowerShell/scripts/measure-HeapSort.ps1 [[-numIntegers] ] [] -numIntegers Specifies the number of integers to sort @@ -126,4 +126,4 @@ $elapsed3 = "{0:N3}" -f $elapsed # formatted to 3 decimal places exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of measure-HeapSort.ps1 as of 08/15/2024 09:50:51)* +*(generated by convert-ps2md.ps1 using the comment-based help of measure-HeapSort.ps1 as of 11/08/2024 12:34:52)* diff --git a/docs/measure-InsertionSort.md b/docs/measure-InsertionSort.md index 4fbe3eab..a655b410 100644 --- a/docs/measure-InsertionSort.md +++ b/docs/measure-InsertionSort.md @@ -9,7 +9,7 @@ such as quicksort, heapsort, or merge sort. Parameters ---------- ```powershell -PS> ./measure-InsertionSort.ps1 [[-numIntegers] ] [] +/home/markus/Repos/PowerShell/scripts/measure-InsertionSort.ps1 [[-numIntegers] ] [] -numIntegers Specifies the number of integers to sort @@ -53,14 +53,14 @@ Script Content one item at a time. It is much less efficient on large lists than more advanced algorithms such as quicksort, heapsort, or merge sort. .PARAMETER numIntegers - Specifies the number of integers to sort + Specifies the number of integers to sort .EXAMPLE - PS> ./measure-InsertionSort.ps1 + PS> ./measure-InsertionSort.ps1 🧭 0.423 sec to sort 1000 integers by InsertionSort .LINK - https://github.com/fleschutz/PowerShell + https://github.com/fleschutz/PowerShell .NOTES - Author: Markus Fleschutz | License: CC0 + Author: Markus Fleschutz | License: CC0 #> param([int]$numIntegers = 1000) @@ -95,4 +95,4 @@ $elapsed3 = "{0:N3}" -f $elapsed # formatted to 3 decimal places exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of measure-InsertionSort.ps1 as of 08/15/2024 09:50:51)* +*(generated by convert-ps2md.ps1 using the comment-based help of measure-InsertionSort.ps1 as of 11/08/2024 12:34:52)* diff --git a/docs/measure-MergeSort.md b/docs/measure-MergeSort.md index 57f0717a..63ba067c 100644 --- a/docs/measure-MergeSort.md +++ b/docs/measure-MergeSort.md @@ -11,7 +11,7 @@ merge sort appeared in a report by Goldstine and von Neumann as early as 1948. Parameters ---------- ```powershell -PS> ./measure-MergeSort.ps1 [[-numIntegers] ] [] +/home/markus/Repos/PowerShell/scripts/measure-MergeSort.ps1 [[-numIntegers] ] [] -numIntegers Specifies the number of integers to sort @@ -120,4 +120,4 @@ $elapsed3 = "{0:N3}" -f $elapsed # formatted to 3 decimal places exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of measure-MergeSort.ps1 as of 08/15/2024 09:50:51)* +*(generated by convert-ps2md.ps1 using the comment-based help of measure-MergeSort.ps1 as of 11/08/2024 12:34:52)* diff --git a/docs/measure-QuickSort.md b/docs/measure-QuickSort.md index 5f59d9e5..b6d66813 100644 --- a/docs/measure-QuickSort.md +++ b/docs/measure-QuickSort.md @@ -10,7 +10,7 @@ two or three times faster than heapsort. Parameters ---------- ```powershell -PS> ./measure-QuickSort.ps1 [[-numIntegers] ] [] +/home/markus/Repos/PowerShell/scripts/measure-QuickSort.ps1 [[-numIntegers] ] [] -numIntegers Specifies the number of integers to sort @@ -101,4 +101,4 @@ $elapsed3 = "{0:N3}" -f $elapsed # formatted to 3 decimal places exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of measure-QuickSort.ps1 as of 08/15/2024 09:50:51)* +*(generated by convert-ps2md.ps1 using the comment-based help of measure-QuickSort.ps1 as of 11/08/2024 12:34:52)* diff --git a/docs/measure-SelectionSort.md b/docs/measure-SelectionSort.md index 7f1174d3..3c47b7a9 100644 --- a/docs/measure-SelectionSort.md +++ b/docs/measure-SelectionSort.md @@ -11,7 +11,7 @@ is limited. Parameters ---------- ```powershell -PS> ./measure-SelectionSort.ps1 [[-numIntegers] ] [] +/home/markus/Repos/PowerShell/scripts/measure-SelectionSort.ps1 [[-numIntegers] ] [] -numIntegers Specifies the number of integers to sort @@ -94,4 +94,4 @@ $elapsed3 = "{0:N3}" -f $elapsed # formatted to 3 decimal places exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of measure-SelectionSort.ps1 as of 08/15/2024 09:50:51)* +*(generated by convert-ps2md.ps1 using the comment-based help of measure-SelectionSort.ps1 as of 11/08/2024 12:34:52)* diff --git a/docs/measure-sorting-algorithms.md b/docs/measure-sorting-algorithms.md index acc6eeac..19f268b5 100644 --- a/docs/measure-sorting-algorithms.md +++ b/docs/measure-sorting-algorithms.md @@ -6,7 +6,7 @@ This PowerShell script measures the speed of several sorting algorithms and prin Parameters ---------- ```powershell -PS> ./measure-sorting-algorithms.ps1 [[-numIntegers] ] [] +/home/markus/Repos/PowerShell/scripts/measure-sorting-algorithms.ps1 [[-numIntegers] ] [] -numIntegers Specifies the number of integers to sort (3000 by default) @@ -73,4 +73,4 @@ param([int]$numIntegers = 3000) exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of measure-sorting-algorithms.ps1 as of 08/15/2024 09:50:51)* +*(generated by convert-ps2md.ps1 using the comment-based help of measure-sorting-algorithms.ps1 as of 11/08/2024 12:34:52)* diff --git a/docs/merry-christmas.md b/docs/merry-christmas.md index 78d78af6..bb2b5eaa 100644 --- a/docs/merry-christmas.md +++ b/docs/merry-christmas.md @@ -6,7 +6,7 @@ This PowerShell script replies to 'Merry Christmas' by text-to-speech (TTS). Parameters ---------- ```powershell -PS> ./merry-christmas.ps1 [] +/home/markus/Repos/PowerShell/scripts/merry-christmas.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -50,4 +50,4 @@ $Reply = "Merry Christmas to you too!", "Happy Christmas to you too!" | Get-Rand exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of merry-christmas.ps1 as of 08/15/2024 09:50:51)* +*(generated by convert-ps2md.ps1 using the comment-based help of merry-christmas.ps1 as of 11/08/2024 12:34:52)* diff --git a/docs/minimize-all-windows.md b/docs/minimize-all-windows.md index b1798834..1040ea2a 100644 --- a/docs/minimize-all-windows.md +++ b/docs/minimize-all-windows.md @@ -6,7 +6,7 @@ This PowerShell script minimizes all open windows. Parameters ---------- ```powershell -PS> ./minimize-all-windows.ps1 [] +/home/markus/Repos/PowerShell/scripts/minimize-all-windows.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -54,4 +54,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of minimize-all-windows.ps1 as of 08/15/2024 09:50:51)* +*(generated by convert-ps2md.ps1 using the comment-based help of minimize-all-windows.ps1 as of 11/08/2024 12:34:52)* diff --git a/docs/move-mouse-pointer.md b/docs/move-mouse-pointer.md index 008e3fa5..53fe5f8c 100644 --- a/docs/move-mouse-pointer.md +++ b/docs/move-mouse-pointer.md @@ -6,7 +6,7 @@ This PowerShell script moves the mouse pointer either to the given x/y coordinat Parameters ---------- ```powershell -PS> ./move-mouse-pointer.ps1 [[-x] ] [[-y] ] [] +/home/markus/Repos/PowerShell/scripts/move-mouse-pointer.ps1 [[-x] ] [[-y] ] [] -x Specifies the x coordinate in pixels @@ -84,4 +84,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of move-mouse-pointer.ps1 as of 08/15/2024 09:50:51)* +*(generated by convert-ps2md.ps1 using the comment-based help of move-mouse-pointer.ps1 as of 11/08/2024 12:34:52)* diff --git a/docs/move-vm.md b/docs/move-vm.md index 6c4a059c..5a97566b 100644 --- a/docs/move-vm.md +++ b/docs/move-vm.md @@ -22,4 +22,4 @@ Move-VM $VMName HOST2 -IncludeStorage -DestinationStoragePath "D:\VirtualMachine exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of move-vm.ps1 as of 08/15/2024 09:50:51)* +*(generated by convert-ps2md.ps1 using the comment-based help of move-vm.ps1 as of 11/08/2024 12:34:52)* diff --git a/docs/my-profile.md b/docs/my-profile.md index 4f17f197..1a0a9c1e 100644 --- a/docs/my-profile.md +++ b/docs/my-profile.md @@ -17,25 +17,26 @@ Parameters Script Content -------------- ```powershell -# MY POWERSHELL PROFILE (defines the look & feel of PowerShell) +# MY POWERSHELL PROFILE - it defines the look & feel of PowerShell. # WINDOW TITLE if ($IsLinux) { $username = $(whoami) } else { $username = $env:USERNAME } $host.ui.RawUI.WindowTitle = "$username @ $(hostname)" # GREETING -Write-Host "πŸ‘‹ Welcome $username to $(hostname)'s PowerShell - type 'hlp' for help." -foregroundColor green +Write-Host "πŸ‘‹ Welcome $username to $(hostname)'s PowerShell - type 'hlp' if you need help." -foregroundColor green -# COMMAND PROMPT +# PROMPT function prompt { Write-Host "`n➀ " -noNewline -foregroundColor yellow; return " " } -# ALIAS NAMES -del alias:pwd -force -errorAction SilentlyContinue -set-alias -name hlp -value open-help.ps1 -set-alias -name pwd -value list-workdir.ps1 # pwd = print working directory -set-alias -name ll -value get-childitem # ll = list folder (long format) +# ALIASES +set-alias -name enter -value enter-host.ps1 +set-alias -name hlp -value write-help.ps1 +set-alias -name ll -value Get-ChildItem # ll = list folder (long format) del alias:ls -force -errorAction SilentlyContinue set-alias -name ls -value list-folder.ps1 # ls = list folder (short format) +del alias:pwd -force -errorAction SilentlyContinue +set-alias -name pwd -value list-workdir.ps1 # pwd = print working directory ``` -*(generated by convert-ps2md.ps1 using the comment-based help of my-profile.ps1 as of 08/15/2024 09:50:51)* +*(generated by convert-ps2md.ps1 using the comment-based help of my-profile.ps1 as of 11/08/2024 12:34:52)* diff --git a/docs/new-branch.md b/docs/new-branch.md index 80c3424e..c33f39db 100644 --- a/docs/new-branch.md +++ b/docs/new-branch.md @@ -6,7 +6,7 @@ This PowerShell script creates a new branch in a local Git repository and switch Parameters ---------- ```powershell -PS> ./new-branch.ps1 [[-newBranch] ] [[-pathToRepo] ] [] +/home/markus/Repos/PowerShell/scripts/new-branch.ps1 [[-newBranch] ] [[-pathToRepo] ] [] -newBranch Specifies the new Git branch name @@ -41,7 +41,7 @@ PS> ./new-branch.ps1 test123 ⏳ (4/6) Creating new branch... ⏳ (5/6) Pushing updates... ⏳ (6/6) Updating submodules... -βœ”οΈ Created branch 'test123' based on 'main' in πŸ“‚rust repo in 18s. +βœ… Created branch 'test123' based on 'main' in πŸ“‚rust repo in 18s. ``` @@ -73,7 +73,7 @@ Script Content ⏳ (4/6) Creating new branch... ⏳ (5/6) Pushing updates... ⏳ (6/6) Updating submodules... - βœ”οΈ Created branch 'test123' based on 'main' in πŸ“‚rust repo in 18s. + βœ… Created branch 'test123' based on 'main' in πŸ“‚rust repo in 18s. .LINK https://github.com/fleschutz/PowerShell .NOTES @@ -120,7 +120,7 @@ try { if ($lastExitCode -ne "0") { throw "'git submodule update' failed with exit code $lastExitCode" } [int]$elapsed = $stopWatch.Elapsed.TotalSeconds - "βœ”οΈ Created branch '$newBranch' based on '$currentBranch' in πŸ“‚$repoName repo in $($elapsed)s." + "βœ… Created branch '$newBranch' based on '$currentBranch' in πŸ“‚$repoName repo in $($elapsed)s." exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -128,4 +128,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of new-branch.ps1 as of 08/15/2024 09:50:51)* +*(generated by convert-ps2md.ps1 using the comment-based help of new-branch.ps1 as of 11/08/2024 12:34:52)* diff --git a/docs/new-dir.md b/docs/new-dir.md index 68d8c1e3..91c0b03e 100644 --- a/docs/new-dir.md +++ b/docs/new-dir.md @@ -6,7 +6,7 @@ This PowerShell script creates an empty new directory in the filesystem. Parameters ---------- ```powershell -PS> ./new-dir.ps1 [[-path] ] [] +/home/markus/Repos/PowerShell/scripts/new-dir.ps1 [[-path] ] [] -path Specifies the path and filename of the new directory @@ -26,7 +26,7 @@ Example ------- ```powershell PS> ./new-dir.ps1 MyCollection -βœ”οΈ New πŸ“‚C:\Temp\MyCollection created. +βœ… New πŸ“‚C:\Temp\MyCollection created. ``` @@ -50,7 +50,7 @@ Script Content Specifies the path and filename of the new directory .EXAMPLE PS> ./new-dir.ps1 MyCollection - βœ”οΈ New πŸ“‚C:\Temp\MyCollection created. + βœ… New πŸ“‚C:\Temp\MyCollection created. .LINK https://github.com/fleschutz/PowerShell .NOTES @@ -67,7 +67,7 @@ try { $null = (New-Item -itemType directory -path $path) $path = Resolve-Path $path - "βœ”οΈ New πŸ“‚$path created." + "βœ… New πŸ“‚$path created." exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -75,4 +75,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of new-dir.ps1 as of 08/15/2024 09:50:51)* +*(generated by convert-ps2md.ps1 using the comment-based help of new-dir.ps1 as of 11/08/2024 12:34:52)* diff --git a/docs/new-email.md b/docs/new-email.md index e1d40c42..0fc2764a 100644 --- a/docs/new-email.md +++ b/docs/new-email.md @@ -6,7 +6,7 @@ This PowerShell script opens the default email client to write a new email. Parameters ---------- ```powershell -PS> ./new-email.ps1 [[-EmailAddress] ] [] +/home/markus/Repos/PowerShell/scripts/new-email.ps1 [[-EmailAddress] ] [] -EmailAddress Specifies the email address fill in @@ -67,4 +67,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of new-email.ps1 as of 08/15/2024 09:50:51)* +*(generated by convert-ps2md.ps1 using the comment-based help of new-email.ps1 as of 11/08/2024 12:34:52)* diff --git a/docs/new-linux-vm.md b/docs/new-linux-vm.md index d044e10f..4b1d1ef0 100644 --- a/docs/new-linux-vm.md +++ b/docs/new-linux-vm.md @@ -38,4 +38,4 @@ $VMName = "linux" exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of new-linux-vm.ps1 as of 08/15/2024 09:50:51)* +*(generated by convert-ps2md.ps1 using the comment-based help of new-linux-vm.ps1 as of 11/08/2024 12:34:52)* diff --git a/docs/new-qrcode.md b/docs/new-qrcode.md index 4d5bac20..77eb1fec 100644 --- a/docs/new-qrcode.md +++ b/docs/new-qrcode.md @@ -6,9 +6,9 @@ This PowerShell script generates a new QR code image file. Parameters ---------- ```powershell -PS> ./new-qrcode.ps1 [[-Text] ] [[-ImageSize] ] [] +/home/markus/Repos/PowerShell/scripts/new-qrcode.ps1 [[-text] ] [[-imageSize] ] [[-fileFormat] ] [] --Text +-text Specifies the text to use Required? false @@ -17,7 +17,7 @@ PS> ./new-qrcode.ps1 [[-Text] ] [[-ImageSize] ] [ +-imageSize Specifies the image size (width x height) Required? false @@ -26,6 +26,15 @@ PS> ./new-qrcode.ps1 [[-Text] ] [[-ImageSize] ] [ + Specifies the image file format + + Required? false + Position? 3 + Default value + Accept pipeline input? false + Accept wildcard characters? false + [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, WarningVariable, OutBuffer, PipelineVariable, and OutVariable. @@ -34,7 +43,7 @@ PS> ./new-qrcode.ps1 [[-Text] ] [[-ImageSize] ] [ ./new-qrcode.ps1 "Fasten seatbelt" 500x500 +PS> ./new-qrcode.ps1 "Fasten seatbelt" 500x500 JPG ``` @@ -51,49 +60,49 @@ Script Content ```powershell <# .SYNOPSIS - Generates a QR code + Creates a QR code .DESCRIPTION This PowerShell script generates a new QR code image file. -.PARAMETER Text +.PARAMETER text Specifies the text to use -.PARAMETER ImageSize +.PARAMETER imageSize Specifies the image size (width x height) +.PARAMETER fileFormat + Specifies the image file format .EXAMPLE - PS> ./new-qrcode.ps1 "Fasten seatbelt" 500x500 + PS> ./new-qrcode.ps1 "Fasten seatbelt" 500x500 JPG .LINK https://github.com/fleschutz/PowerShell .NOTES Author: Markus Fleschutz | License: CC0 #> -param([string]$Text = "", [string]$ImageSize = "") +param([string]$text = "", [string]$imageSize = "", [string]$fileFormat = "") try { - if ($Text -eq "") { $Text = read-host "Enter text or URL" } - if ($ImageSize -eq "") { $ImageSize = read-host "Enter image size (e.g. 500x500)" } + if ($text -eq "") { $text = Read-Host "Enter text or URL" } + if ($imageSize -eq "") { $imageSize = Read-Host "Enter image size, e.g. 500x500" } + if ($fileFormat -eq "") { $fileFormat = Read-Host "Enter the image file format, e.g. JPG" } $ECC = "M" # can be L, M, Q, H $QuietZone = 1 $ForegroundColor = "000000" $BackgroundColor = "ffffff" - $FileFormat = "jpg" if ($IsLinux) { - $PathToPics = Resolve-Path "$HOME/Pictures" + $pathToPictures = Resolve-Path "$HOME/Pictures" } else { - $PathToPics = [Environment]::GetFolderPath('MyPictures') + $pathToPictures = [Environment]::GetFolderPath('MyPictures') } - if (-not(Test-Path "$PathToPics" -pathType container)) { - throw "Pictures folder at πŸ“‚$Path doesn't exist (yet)" - } - $NewFile = "$PathToPics/QR_code.jpg" + if (-not(Test-Path "$pathToPictures" -pathType container)) { throw "Pictures folder at πŸ“‚$Path doesn't exist (yet)" } + $newFile = "$pathToPictures/QR_code.$fileFormat" - $WebClient = new-object System.Net.WebClient - $WebClient.DownloadFile(("http://api.qrserver.com/v1/create-qr-code/?data=" + $Text + "&ecc=" + $ECC +` - "&size=" + $ImageSize + "&qzone=" + $QuietZone + ` + $WebClient = New-Object System.Net.WebClient + $WebClient.DownloadFile(("http://api.qrserver.com/v1/create-qr-code/?data=" + $text + "&ecc=" + $ECC +` + "&size=" + $imageSize + "&qzone=" + $QuietZone + ` "&color=" + $ForegroundColor + "&bgcolor=" + $BackgroundColor.Text + ` - "&format=" + $FileFormat), $NewFile) + "&format=" + $fileFormat), $newFile) - "βœ”οΈ saved new QR code image file to: $NewFile" + "βœ… New QR code saved as: $newFile" exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -101,4 +110,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of new-qrcode.ps1 as of 08/15/2024 09:50:51)* +*(generated by convert-ps2md.ps1 using the comment-based help of new-qrcode.ps1 as of 11/08/2024 12:34:52)* diff --git a/docs/new-reboot-task.md b/docs/new-reboot-task.md new file mode 100644 index 00000000..eb2260d8 --- /dev/null +++ b/docs/new-reboot-task.md @@ -0,0 +1,137 @@ +Script: *new-reboot-task.ps1* +======================== + +new-reboot-task.ps1 + + +Parameters +---------- +```powershell + + +[] + This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, + WarningVariable, OutBuffer, PipelineVariable, and OutVariable. +``` + +Script Content +-------------- +```powershell +# Skript zum erstellen bzw. Anpassen eine Neustarttasks +# Stannek GmbH - Version 1.3 - 15.06.2023 ES + +# Diese Skript muss als Administrator ausgefΓΌhrt werden, ansonsten wird es nicht gestartet +#Requires -RunAsAdministrator + +# Parameter +$TaskName = "einmaliger Neustart" + +# Assemblys laden +Add-Type -AssemblyName System.Windows.Forms + +## Abfrage Fenster ## + +# Erstellt das Hauptfenster +$font = New-Object System.Drawing.Font("Arial", 11) +$mainForm = New-Object System.Windows.Forms.Form +$mainForm.Text = "Neustart-Task planen" +$mainForm.Font = $font +$mainForm.ForeColor = "Black" +$mainForm.BackColor = "White" +$mainForm.Width = 300 +$mainForm.Height = 200 +$mainForm.StartPosition = "CenterScreen" +$mainForm.MaximizeBox = $False + +# Erzeugt das Description Label +$DescriptLabel = New-Object System.Windows.Forms.Label +$DescriptLabel.Text = "Wann soll der Computer neustarten?" +$DescriptLabel.Location = "15, 10" +$DescriptLabel.Height = 22 +$DescriptLabel.Width = 280 +# FΓΌgt Label zum Hauptfenster hinzu +$mainForm.Controls.Add($DescriptLabel) + + +# Rezeugt das DatePicker Label +$datePickerLabel = New-Object System.Windows.Forms.Label +$datePickerLabel.Text = "Datum" +$datePickerLabel.Location = "15, 45" +$datePickerLabel.Height = 22 +$datePickerLabel.Width = 90 +# FΓΌgt Label zum Hauptfenster hinzu +$mainForm.Controls.Add($datePickerLabel) + +# Erzeugt das TimePicker Label +$TimePickerLabel = New-Object System.Windows.Forms.Label +$TimePickerLabel.Text = "Uhrzeit" +$TimePickerLabel.Location = "15, 80" +$TimePickerLabel.Height = 22 +$TimePickerLabel.Width = 90 +# FΓΌgt Label zum Hauptfenster hinzu +$mainForm.Controls.Add($TimePickerLabel) + +# Erzeugt das DatePicker-Feld +$datePicker = New-Object System.Windows.Forms.DateTimePicker +$datePicker.Location = "110, 42" +$datePicker.Width = "150" +$datePicker.Format = [windows.forms.datetimepickerFormat]::custom +$datePicker.CustomFormat = "dd/MM/yyyy" +# FΓΌgt DatePicker-Feld zum Hauptfenster hinzu +$mainForm.Controls.Add($datePicker) + +# Erzeugt das TimePicker-Feld +$TimePicker = New-Object System.Windows.Forms.DateTimePicker +$TimePicker.Location = "110, 77" +$TimePicker.Width = "150" +$TimePicker.Format = [windows.forms.datetimepickerFormat]::custom +$TimePicker.CustomFormat = "HH:mm" +$TimePicker.ShowUpDown = $TRUE +# FΓΌgt TimePicker-Feld zum Hauptfenster hinzu +$mainForm.Controls.Add($TimePicker) + +# Erzeugt den OK Button +$okButton = New-Object System.Windows.Forms.Button +$okButton.Location = "15, 130" +$okButton.ForeColor = "Black" +$okButton.BackColor = "White" +$okButton.Text = "OK" +# Legt die Button Aktion fest (DialogResult auf OK und Eingabefenster schließen +$okButton.add_Click({$mainForm.DialogResult = "OK";$mainForm.close()}) +# FΓΌgt Button zum Hauptfenster hinzu +$mainForm.Controls.Add($okButton) + +# Fensterausgabe +[void] $mainForm.ShowDialog() + +## Ende Abfrage Fenster ## + +# Skript abbrechen, wenn Fenster geschlossen wird +If ($mainForm.DialogResult -eq "Cancel") {Break} + +# Datum und Uhrzeit aus Abfrage fΓΌr Task aufbereiten +$TaskDatetrigger = Get-Date -Date $datePicker.Value.Date -Hour $TimePicker.Value.TimeOfDay.Hours -Minute $TimePicker.Value.TimeOfDay.Minutes + +# Erstelle Task oder passe vorhanden Task an + +# TaskTrigger Zeit setzen +$TaskTrigger = New-ScheduledTaskTrigger -At $TaskDatetrigger -Once + +If ((Get-ScheduledTask -TaskName $Taskname -ErrorAction SilentlyContinue).TaskName -eq $TaskName) + {# Setzt den neue Tasktrigger + Set-ScheduledTask -TaskName $Taskname -Trigger $TaskTrigger + } +Else + {# Erstellt Neustart Task, da keiner vorhanden ist + $TaskAction = New-ScheduledTaskAction -Execute "shutdown.exe" -Argument "/r /f /t 5" + $TaskSettings = New-ScheduledTaskSettingsSet -AllowStartIfOnBatteries -DontStopIfGoingOnBatteries -StartWhenAvailable -ExecutionTimeLimit 00:15:00 + $TaskSettings.StartWhenAvailable = $false + $TaskPrincipal = New-ScheduledTaskPrincipal -UserId $(Get-WMIObject -class Win32_ComputerSystem | select UserName).username -RunLevel Highest -LogonType Interactive + Register-ScheduledTask -Action $TaskAction -Trigger $TaskTrigger -Settings $TaskSettings -Principal $TaskPrincipal -TaskName $TaskName -Description "FΓΌhrt einen Neustart des Computers zu einer festgelegten Zeit aus" + } + +# Pruefe Task ob dieser deaktiviert ist +If ((Get-ScheduledTask -TaskName $Taskname).State -eq "Disabled") {Enable-ScheduledTask -TaskName $TaskName} +``` + +*(generated by convert-ps2md.ps1 using the comment-based help of new-reboot-task.ps1 as of 11/08/2024 12:34:52)* diff --git a/docs/new-script.md b/docs/new-script.md index 076616b5..44e7208d 100644 --- a/docs/new-script.md +++ b/docs/new-script.md @@ -6,7 +6,7 @@ This PowerShell script creates a new PowerShell script file by using the templat Parameters ---------- ```powershell -PS> ./new-script.ps1 [[-filename] ] [] +/home/markus/Repos/PowerShell/scripts/new-script.ps1 [[-filename] ] [] -filename Specifies the path and filename to the new script @@ -26,7 +26,7 @@ Example ------- ```powershell PS> ./new-script myscript.ps1 -βœ”οΈ Created the new 'myscript.ps1' PowerShell script in 1 sec +βœ… Created the new 'myscript.ps1' PowerShell script in 1 sec ``` @@ -50,7 +50,7 @@ Script Content Specifies the path and filename to the new script .EXAMPLE PS> ./new-script myscript.ps1 - βœ”οΈ Created the new 'myscript.ps1' PowerShell script in 1 sec + βœ… Created the new 'myscript.ps1' PowerShell script in 1 sec .LINK https://github.com/fleschutz/PowerShell .NOTES @@ -66,7 +66,7 @@ try { Copy-Item "$PSScriptRoot/../data/template.ps1" "$filename" [int]$elapsed = $stopWatch.Elapsed.TotalSeconds - "βœ”οΈ Created the new '$filename' PowerShell script in $elapsed sec" + "βœ… Created the new '$filename' PowerShell script in $elapsed sec" exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -74,4 +74,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of new-script.ps1 as of 08/15/2024 09:50:51)* +*(generated by convert-ps2md.ps1 using the comment-based help of new-script.ps1 as of 11/08/2024 12:34:52)* diff --git a/docs/new-shortcut.md b/docs/new-shortcut.md index 572c75a1..d9f28b5f 100644 --- a/docs/new-shortcut.md +++ b/docs/new-shortcut.md @@ -6,7 +6,7 @@ This PowerShell script creates a new shortcut file. Parameters ---------- ```powershell -PS> ./new-shortcut.ps1 [[-shortcut] ] [[-target] ] [[-description] ] [] +/home/markus/Repos/PowerShell/scripts/new-shortcut.ps1 [[-shortcut] ] [[-target] ] [[-description] ] [] -shortcut Specifies the shortcut filename @@ -92,7 +92,7 @@ try { $sc.Description = "$description" $sc.save() - "βœ”οΈ created new shortcut $shortcut β­’ $target" + "βœ… created new shortcut $shortcut β­’ $target" exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -100,4 +100,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of new-shortcut.ps1 as of 08/15/2024 09:50:51)* +*(generated by convert-ps2md.ps1 using the comment-based help of new-shortcut.ps1 as of 11/08/2024 12:34:52)* diff --git a/docs/new-ssh-key.md b/docs/new-ssh-key.md new file mode 100644 index 00000000..9db8bc05 --- /dev/null +++ b/docs/new-ssh-key.md @@ -0,0 +1,73 @@ +Script: *new-ssh-key.ps1* +======================== + +This PowerShell script creates a new SSH key for the user. + +Parameters +---------- +```powershell +/home/markus/Repos/PowerShell/scripts/new-ssh-key.ps1 [] + +[] + This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, + WarningVariable, OutBuffer, PipelineVariable, and OutVariable. +``` + +Example +------- +```powershell +PS> ./new-ssh-key.ps1 +βœ… New SSH key of Ed25519 type saved to ~/.ssh - your public key is: +ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILb8s5zU9YDApGQ82H45fMKVPMr5cw9fzh3PEBjZZ+Rm markus@PI + +``` + +Notes +----- +Author: Markus Fleschutz | License: CC0 + +Related Links +------------- +https://github.com/fleschutz/PowerShell + +Script Content +-------------- +```powershell +<# +.SYNOPSIS + Creates a new SSH key +.DESCRIPTION + This PowerShell script creates a new SSH key for the user. +.EXAMPLE + PS> ./new-ssh-key.ps1 + βœ… New SSH key of Ed25519 type saved to ~/.ssh - your public key is: + ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILb8s5zU9YDApGQ82H45fMKVPMr5cw9fzh3PEBjZZ+Rm markus@PI +.LINK + https://github.com/fleschutz/PowerShell +.NOTES + Author: Markus Fleschutz | License: CC0 +#> + +try { + & ssh-keygen + if ($lastExitCode -ne "0") { throw "ssh-keygen failed" } + + if (Test-Path "~/.ssh/id_ed25519.pub") { + $publicKey = Get-Content "~/.ssh/id_ed25519.pub" + $enc = "Ed25519" + } elseif (Test-Path "~/.ssh/id_rsa.pub") { + $publicKey = Get-Content "~/.ssh/id_rsa.pub" + $enc = "RSA" + } else { + throw "No public key found." + } + "βœ… New SSH key of $enc type saved to ~/.ssh - your public key is:" + " $publicKey" + exit 0 # success +} catch { + "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" + exit 1 +} +``` + +*(generated by convert-ps2md.ps1 using the comment-based help of new-ssh-key.ps1 as of 11/08/2024 12:34:52)* diff --git a/docs/new-symlink.md b/docs/new-symlink.md index 3ca292cb..5492f248 100644 --- a/docs/new-symlink.md +++ b/docs/new-symlink.md @@ -1,15 +1,15 @@ Script: *new-symlink.ps1* ======================== -This PowerShell script creates a new symbolic link file. +This PowerShell script creates a new symbolic link file, linking to a target. Parameters ---------- ```powershell -PS> ./new-symlink.ps1 [[-symlink] ] [[-target] ] [] +/home/markus/Repos/PowerShell/scripts/new-symlink.ps1 [[-symlink] ] [[-target] ] [] -symlink - Specifies the new symlink filename + Specifies the path to the new symlink file Required? false Position? 1 @@ -18,7 +18,7 @@ PS> ./new-symlink.ps1 [[-symlink] ] [[-target] ] [ - Specifies the path to target + Specifies the path to the target Required? false Position? 2 @@ -34,7 +34,8 @@ PS> ./new-symlink.ps1 [[-symlink] ] [[-target] ] [ ./new-symlink.ps1 C:\Temp\HDD C:\ +PS> ./new-symlink.ps1 C:\User\Markus\Windows C:\Windows +βœ… New symlink file 'C:\User\Markus\Windows' created, linking to: C:\Windows ``` @@ -51,15 +52,16 @@ Script Content ```powershell <# .SYNOPSIS - Creates a new symbolic link file + Creates a new symlink .DESCRIPTION - This PowerShell script creates a new symbolic link file. + This PowerShell script creates a new symbolic link file, linking to a target. .PARAMETER symlink - Specifies the new symlink filename + Specifies the path to the new symlink file .PARAMETER target - Specifies the path to target + Specifies the path to the target .EXAMPLE - PS> ./new-symlink.ps1 C:\Temp\HDD C:\ + PS> ./new-symlink.ps1 C:\User\Markus\Windows C:\Windows + βœ… New symlink file 'C:\User\Markus\Windows' created, linking to: C:\Windows .LINK https://github.com/fleschutz/PowerShell .NOTES @@ -69,12 +71,12 @@ Script Content param([string]$symlink = "", [string]$target = "") try { - if ($symlink -eq "" ) { $symlink = read-host "Enter new symlink filename" } - if ($target -eq "" ) { $target = read-host "Enter path to target" } + if ($symlink -eq "" ) { $symlink = Read-Host "Enter new symlink filename" } + if ($target -eq "" ) { $target = Read-Host "Enter path to target" } - new-item -path "$symlink" -itemType SymbolicLink -Value "$target" + New-Item -path "$symlink" -itemType SymbolicLink -value "$target" - "βœ”οΈ created new symlink $symlink β­’ $target" + "βœ… New symlink file '$symlink' created, linking to: $target" exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -82,4 +84,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of new-symlink.ps1 as of 08/15/2024 09:50:51)* +*(generated by convert-ps2md.ps1 using the comment-based help of new-symlink.ps1 as of 11/08/2024 12:34:52)* diff --git a/docs/new-tag.md b/docs/new-tag.md index f1b5f037..a4c75868 100644 --- a/docs/new-tag.md +++ b/docs/new-tag.md @@ -6,7 +6,7 @@ This PowerShell script creates a new tag in a Git repository. Parameters ---------- ```powershell -PS> ./new-tag.ps1 [[-TagName] ] [[-RepoDir] ] [] +/home/markus/Repos/PowerShell/scripts/new-tag.ps1 [[-TagName] ] [[-RepoDir] ] [] -TagName Specifies the new tag name @@ -93,7 +93,7 @@ try { if ($lastExitCode -ne "0") { throw "Error: 'git push origin $TagName' failed!" } [int]$Elapsed = $StopWatch.Elapsed.TotalSeconds - "βœ”οΈ created new tag '$TagName' in $Elapsed sec" + "βœ… created new tag '$TagName' in $Elapsed sec" exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -101,4 +101,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of new-tag.ps1 as of 08/15/2024 09:50:51)* +*(generated by convert-ps2md.ps1 using the comment-based help of new-tag.ps1 as of 11/08/2024 12:34:52)* diff --git a/docs/new-user.md b/docs/new-user.md index d22c592e..5bcc04db 100644 --- a/docs/new-user.md +++ b/docs/new-user.md @@ -6,7 +6,7 @@ This PowerShell script creates a new user account with an encrypted home directo Parameters ---------- ```powershell -PS> ./new-user.ps1 [[-username] ] [] +/home/markus/Repos/PowerShell/scripts/new-user.ps1 [[-username] ] [] -username @@ -25,7 +25,7 @@ Example ------- ```powershell PS> ./new-user.ps1 Joe -βœ”οΈ Created new user 'Joe' with encrypted home directory in 11s. +βœ… Created user account 'Joe' with encrypted home directory in 11s. ``` @@ -42,12 +42,12 @@ Script Content ```powershell <# .SYNOPSIS - Creates a new user account + Create a new user .DESCRIPTION This PowerShell script creates a new user account with an encrypted home directory. .EXAMPLE PS> ./new-user.ps1 Joe - βœ”οΈ Created new user 'Joe' with encrypted home directory in 11s. + βœ… Created user account 'Joe' with encrypted home directory in 11s. .LINK https://github.com/fleschutz/PowerShell .NOTES @@ -61,13 +61,14 @@ try { $stopWatch = [system.diagnostics.stopwatch]::startNew() if ($IsLinux) { + & sudo apt install ecryptfs-utils & sudo adduser --encrypt-home $username } else { throw "Not supported yet" } [int]$elapsed = $stopWatch.Elapsed.TotalSeconds - "βœ”οΈ Created new user '$username' with encrypted home directory in $($elapsed)s." + "βœ… Created user account '$username' with encrypted home directory in $($elapsed)s." exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -75,4 +76,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of new-user.ps1 as of 08/15/2024 09:50:51)* +*(generated by convert-ps2md.ps1 using the comment-based help of new-user.ps1 as of 11/08/2024 12:34:52)* diff --git a/docs/new-windows-vm.md b/docs/new-windows-vm.md index 528a4e07..9c2b9ab1 100644 --- a/docs/new-windows-vm.md +++ b/docs/new-windows-vm.md @@ -37,4 +37,4 @@ $VMName = "windows" exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of new-windows-vm.ps1 as of 08/15/2024 09:50:51)* +*(generated by convert-ps2md.ps1 using the comment-based help of new-windows-vm.ps1 as of 11/08/2024 12:34:52)* diff --git a/docs/on-desktop-login.md b/docs/on-desktop-login.md index ae5d1f78..092af180 100644 --- a/docs/on-desktop-login.md +++ b/docs/on-desktop-login.md @@ -7,7 +7,7 @@ NOTE: for installation on Windows create and put a symbolic link to this script Parameters ---------- ```powershell -PS> ./on-desktop-login.ps1 [] +/home/markus/Repos/PowerShell/scripts/on-desktop-login.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -73,4 +73,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of on-desktop-login.ps1 as of 08/15/2024 09:50:51)* +*(generated by convert-ps2md.ps1 using the comment-based help of on-desktop-login.ps1 as of 11/08/2024 12:34:52)* diff --git a/docs/open-URL.md b/docs/open-URL.md index c5df4ab4..99be4362 100644 --- a/docs/open-URL.md +++ b/docs/open-URL.md @@ -6,7 +6,7 @@ This PowerShell script launches a new tab in the default Web browser with the gi Parameters ---------- ```powershell -PS> ./open-URL.ps1 [[-URL] ] [[-text] ] [] +/home/markus/Repos/PowerShell/scripts/open-URL.ps1 [[-URL] ] [[-text] ] [] -URL Specifies the URL @@ -75,8 +75,10 @@ try { Write-Host $text -noNewline Write-Host $URL -foregroundColor blue } - Start-Process $URL - + if ($IsLinux) { + } else { + Start-Process $URL + } exit 0 # success } catch { "⚠️ Error: $($Error[0]) (script line $($_.InvocationInfo.ScriptLineNumber))" @@ -84,4 +86,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-URL.ps1 as of 08/15/2024 09:50:52)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-URL.ps1 as of 11/08/2024 12:34:53)* diff --git a/docs/open-apps-folder.md b/docs/open-apps-folder.md index aa615c78..2beca779 100644 --- a/docs/open-apps-folder.md +++ b/docs/open-apps-folder.md @@ -6,7 +6,7 @@ This PowerShell script launches the File Explorer showing the UWP apps folder. Parameters ---------- ```powershell -PS> ./open-apps-folder.ps1 [] +/home/markus/Repos/PowerShell/scripts/open-apps-folder.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -49,4 +49,4 @@ exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-apps-folder.ps1 as of 08/15/2024 09:50:51)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-apps-folder.ps1 as of 11/08/2024 12:34:52)* diff --git a/docs/open-auto-start-folder.md b/docs/open-auto-start-folder.md index 584bd427..ae2726f0 100644 --- a/docs/open-auto-start-folder.md +++ b/docs/open-auto-start-folder.md @@ -6,7 +6,7 @@ This PowerShell script launches the File Explorer with the user's autostart fold Parameters ---------- ```powershell -PS> ./open-auto-start-folder.ps1 [] +/home/markus/Repos/PowerShell/scripts/open-auto-start-folder.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -57,4 +57,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-auto-start-folder.ps1 as of 08/15/2024 09:50:51)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-auto-start-folder.ps1 as of 11/08/2024 12:34:52)* diff --git a/docs/open-bing-maps.md b/docs/open-bing-maps.md index a3bd5904..70b01a0a 100644 --- a/docs/open-bing-maps.md +++ b/docs/open-bing-maps.md @@ -6,7 +6,7 @@ This PowerShell script launches the Bing Maps application. Parameters ---------- ```powershell -PS> ./open-bing-maps.ps1 [] +/home/markus/Repos/PowerShell/scripts/open-bing-maps.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -53,4 +53,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-bing-maps.ps1 as of 08/15/2024 09:50:51)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-bing-maps.ps1 as of 11/08/2024 12:34:52)* diff --git a/docs/open-booking-com.md b/docs/open-booking-com.md index d4094bdd..d8741d32 100644 --- a/docs/open-booking-com.md +++ b/docs/open-booking-com.md @@ -6,7 +6,7 @@ This PowerShell script launches the Web browser with the Booking.com website. Parameters ---------- ```powershell -PS> ./open-booking-com.ps1 [] +/home/markus/Repos/PowerShell/scripts/open-booking-com.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-booking-com.ps1 as of 08/15/2024 09:50:51)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-booking-com.ps1 as of 11/08/2024 12:34:52)* diff --git a/docs/open-c-drive.md b/docs/open-c-drive.md index 5503e31b..4e524fa6 100644 --- a/docs/open-c-drive.md +++ b/docs/open-c-drive.md @@ -6,7 +6,7 @@ This PowerShell script launches the File Explorer with the C: drive folder. Parameters ---------- ```powershell -PS> ./open-c-drive.ps1 [] +/home/markus/Repos/PowerShell/scripts/open-c-drive.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-c-drive.ps1 as of 08/15/2024 09:50:51)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-c-drive.ps1 as of 11/08/2024 12:34:52)* diff --git a/docs/open-calculator.md b/docs/open-calculator.md index 835d8ba1..4d9fcadf 100644 --- a/docs/open-calculator.md +++ b/docs/open-calculator.md @@ -6,7 +6,7 @@ This PowerShell script launches the calculator application. Parameters ---------- ```powershell -PS> ./open-calculator.ps1 [] +/home/markus/Repos/PowerShell/scripts/open-calculator.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -53,4 +53,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-calculator.ps1 as of 08/15/2024 09:50:51)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-calculator.ps1 as of 11/08/2024 12:34:52)* diff --git a/docs/open-chrome.md b/docs/open-chrome.md index 71e76b9d..e7ecf324 100644 --- a/docs/open-chrome.md +++ b/docs/open-chrome.md @@ -6,7 +6,7 @@ This PowerShell script launches the Google Chrome Web browser. Parameters ---------- ```powershell -PS> ./open-chrome.ps1 [[-URL] ] [] +/home/markus/Repos/PowerShell/scripts/open-chrome.ps1 [[-URL] ] [] -URL Specifies an optional URL @@ -66,4 +66,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-chrome.ps1 as of 08/15/2024 09:50:51)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-chrome.ps1 as of 11/08/2024 12:34:52)* diff --git a/docs/open-clock.md b/docs/open-clock.md index 047adb2b..7cb94781 100644 --- a/docs/open-clock.md +++ b/docs/open-clock.md @@ -6,7 +6,7 @@ This PowerShell script launches the Clock application. Parameters ---------- ```powershell -PS> ./open-clock.ps1 [] +/home/markus/Repos/PowerShell/scripts/open-clock.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -53,4 +53,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-clock.ps1 as of 08/15/2024 09:50:51)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-clock.ps1 as of 11/08/2024 12:34:52)* diff --git a/docs/open-cortana.md b/docs/open-cortana.md index 1ff8b174..26053acb 100644 --- a/docs/open-cortana.md +++ b/docs/open-cortana.md @@ -6,7 +6,7 @@ This PowerShell script launches the Cortana application. Parameters ---------- ```powershell -PS> ./open-cortana.ps1 [] +/home/markus/Repos/PowerShell/scripts/open-cortana.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -53,4 +53,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-cortana.ps1 as of 08/15/2024 09:50:51)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-cortana.ps1 as of 11/08/2024 12:34:52)* diff --git a/docs/open-d-drive.md b/docs/open-d-drive.md index 2698ed5b..d9613690 100644 --- a/docs/open-d-drive.md +++ b/docs/open-d-drive.md @@ -6,7 +6,7 @@ This PowerShell script launches the File Explorer with the D: drive folder. Parameters ---------- ```powershell -PS> ./open-d-drive.ps1 [] +/home/markus/Repos/PowerShell/scripts/open-d-drive.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -47,4 +47,4 @@ Script Content & "$PSScriptRoot/open-file-explorer.ps1" "D:" ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-d-drive.ps1 as of 08/15/2024 09:50:51)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-d-drive.ps1 as of 11/08/2024 12:34:52)* diff --git a/docs/open-dashboards.md b/docs/open-dashboards.md index f29f8eac..940d3695 100644 --- a/docs/open-dashboards.md +++ b/docs/open-dashboards.md @@ -6,14 +6,14 @@ This PowerShell script launches the Web browser with 20 tabs of popular dashboar Parameters ---------- ```powershell -PS> ./open-dashboards.ps1 [[-timeInterval] ] [] +/home/markus/Repos/PowerShell/scripts/open-dashboards.ps1 [[-timeInterval] ] [] -timeInterval Specifies the time interval between each tab (110ms per default) Required? false Position? 1 - Default value 110 + Default value 120 Accept pipeline input? false Accept wildcard characters? false @@ -26,7 +26,7 @@ Example ------- ```powershell PS> ./open-dashboards.ps1 -βœ… Launching Web browser with 20 tabs showing Toggl Trackβ€’Google Calendarβ€’Google Mail, ... +βœ… Launching Web browser with 20 tabs: Toggl Trackβ€’Google Calendarβ€’Google Mail, ... NOTE: Execute './switch-tabs.ps1' to switch from tab to tab automatically. ... @@ -45,14 +45,14 @@ Script Content ```powershell <# .SYNOPSIS - Open web dashboards + Open 20 web dashboards .DESCRIPTION This PowerShell script launches the Web browser with 20 tabs of popular dashboard websites. .PARAMETER timeInterval Specifies the time interval between each tab (110ms per default) .EXAMPLE PS> ./open-dashboards.ps1 - βœ… Launching Web browser with 20 tabs showing Toggl Trackβ€’Google Calendarβ€’Google Mail, ... + βœ… Launching Web browser with 20 tabs: Toggl Trackβ€’Google Calendarβ€’Google Mail, ... NOTE: Execute './switch-tabs.ps1' to switch from tab to tab automatically. ... .LINK @@ -61,15 +61,14 @@ Script Content Author: Markus Fleschutz | License: CC0 #> -param([int]$timeInterval = 110) # milliseconds +param([int]$timeInterval = 120) # milliseconds try { Write-Progress "Reading Data/popular-dashboards.csv..." $table = Import-CSV "$PSScriptRoot/../data/popular-dashboards.csv" Write-Progress -completed "Done." - Write-Host "βœ… Launching Web browser with 20 tabs showing " -noNewline - $numRows = $table.Length + Write-Host "βœ… Launching Web browser with 20 tabs: " -noNewline foreach($row in $table) { Write-Host "$($row.NAME)β€’" -noNewline & "$PSScriptRoot/open-default-browser.ps1" "$($row.URL)" @@ -84,4 +83,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-dashboards.ps1 as of 08/15/2024 09:50:51)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-dashboards.ps1 as of 11/08/2024 12:34:52)* diff --git a/docs/open-deep-l-translator.md b/docs/open-deep-l-translator.md index efb982bf..05f6f6f8 100644 --- a/docs/open-deep-l-translator.md +++ b/docs/open-deep-l-translator.md @@ -6,7 +6,7 @@ This PowerShell script launches the Web browser with the DeepL Translator websit Parameters ---------- ```powershell -PS> ./open-deep-l-translator.ps1 [] +/home/markus/Repos/PowerShell/scripts/open-deep-l-translator.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-deep-l-translator.ps1 as of 08/15/2024 09:50:51)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-deep-l-translator.ps1 as of 11/08/2024 12:34:52)* diff --git a/docs/open-default-browser.md b/docs/open-default-browser.md index a5891ab4..3996c945 100644 --- a/docs/open-default-browser.md +++ b/docs/open-default-browser.md @@ -6,7 +6,7 @@ This PowerShell script launches the default Web browser, optional with a given U Parameters ---------- ```powershell -PS> ./open-default-browser.ps1 [[-URL] ] [] +/home/markus/Repos/PowerShell/scripts/open-default-browser.ps1 [[-URL] ] [] -URL Specifies the URL @@ -66,4 +66,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-default-browser.ps1 as of 08/15/2024 09:50:51)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-default-browser.ps1 as of 11/08/2024 12:34:52)* diff --git a/docs/open-desktop-folder.md b/docs/open-desktop-folder.md index 82177443..222d6612 100644 --- a/docs/open-desktop-folder.md +++ b/docs/open-desktop-folder.md @@ -6,7 +6,7 @@ This PowerShell script launches the File Explorer with the user's desktop folder Parameters ---------- ```powershell -PS> ./open-desktop-folder.ps1 [] +/home/markus/Repos/PowerShell/scripts/open-desktop-folder.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -57,4 +57,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-desktop-folder.ps1 as of 08/15/2024 09:50:51)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-desktop-folder.ps1 as of 11/08/2024 12:34:52)* diff --git a/docs/open-documents-folder.md b/docs/open-documents-folder.md index 5a3721a3..a9980ae3 100644 --- a/docs/open-documents-folder.md +++ b/docs/open-documents-folder.md @@ -6,7 +6,7 @@ This PowerShell script launches the File Explorer with the user's documents fold Parameters ---------- ```powershell -PS> ./open-documents-folder.ps1 [] +/home/markus/Repos/PowerShell/scripts/open-documents-folder.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -57,4 +57,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-documents-folder.ps1 as of 08/15/2024 09:50:51)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-documents-folder.ps1 as of 11/08/2024 12:34:52)* diff --git a/docs/open-downloads-folder.md b/docs/open-downloads-folder.md index 9723eda8..5a61e3a4 100644 --- a/docs/open-downloads-folder.md +++ b/docs/open-downloads-folder.md @@ -6,7 +6,7 @@ This PowerShell script launches the File Explorer showing the user's downloads f Parameters ---------- ```powershell -PS> ./open-downloads-folder.ps1 [] +/home/markus/Repos/PowerShell/scripts/open-downloads-folder.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -61,4 +61,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-downloads-folder.ps1 as of 08/15/2024 09:50:51)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-downloads-folder.ps1 as of 11/08/2024 12:34:52)* diff --git a/docs/open-dropbox-folder.md b/docs/open-dropbox-folder.md index 4ea8e9f7..e061e78d 100644 --- a/docs/open-dropbox-folder.md +++ b/docs/open-dropbox-folder.md @@ -6,7 +6,7 @@ This PowerShell script launches the File Explorer with the user's Dropbox folder Parameters ---------- ```powershell -PS> ./open-dropbox-folder.ps1 [] +/home/markus/Repos/PowerShell/scripts/open-dropbox-folder.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -57,4 +57,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-dropbox-folder.ps1 as of 08/15/2024 09:50:51)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-dropbox-folder.ps1 as of 11/08/2024 12:34:53)* diff --git a/docs/open-duck-duck-go.md b/docs/open-duck-duck-go.md index fd7c1e70..ea355004 100644 --- a/docs/open-duck-duck-go.md +++ b/docs/open-duck-duck-go.md @@ -6,7 +6,7 @@ This PowerShell script launches the Web browser with the DuckDuckGo website. Parameters ---------- ```powershell -PS> ./open-duck-duck-go.ps1 [] +/home/markus/Repos/PowerShell/scripts/open-duck-duck-go.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-duck-duck-go.ps1 as of 08/15/2024 09:50:51)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-duck-duck-go.ps1 as of 11/08/2024 12:34:53)* diff --git a/docs/open-e-drive.md b/docs/open-e-drive.md index db7edb15..d31ce880 100644 --- a/docs/open-e-drive.md +++ b/docs/open-e-drive.md @@ -6,7 +6,7 @@ This PowerShell script launches the File Explorer with the E: drive folder. Parameters ---------- ```powershell -PS> ./open-e-drive.ps1 [] +/home/markus/Repos/PowerShell/scripts/open-e-drive.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -47,4 +47,4 @@ Script Content & "$PSScriptRoot/open-file-explorer.ps1" "E:" ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-e-drive.ps1 as of 08/15/2024 09:50:51)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-e-drive.ps1 as of 11/08/2024 12:34:53)* diff --git a/docs/open-edge.md b/docs/open-edge.md index d20e8fd2..11eb370c 100644 --- a/docs/open-edge.md +++ b/docs/open-edge.md @@ -6,7 +6,7 @@ This PowerShell script launches the Microsoft Edge Web browser. Parameters ---------- ```powershell -PS> ./open-edge.ps1 [] +/home/markus/Repos/PowerShell/scripts/open-edge.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -48,4 +48,4 @@ Start-Process microsoft-edge:// exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-edge.ps1 as of 08/15/2024 09:50:51)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-edge.ps1 as of 11/08/2024 12:34:53)* diff --git a/docs/open-egg-timer.md b/docs/open-egg-timer.md index 603f3799..c360bb00 100644 --- a/docs/open-egg-timer.md +++ b/docs/open-egg-timer.md @@ -6,7 +6,7 @@ This PowerShell script launches the Web browser with the eggtimer website. Parameters ---------- ```powershell -PS> ./open-egg-timer.ps1 [] +/home/markus/Repos/PowerShell/scripts/open-egg-timer.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-egg-timer.ps1 as of 08/15/2024 09:50:51)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-egg-timer.ps1 as of 11/08/2024 12:34:53)* diff --git a/docs/open-email-client.md b/docs/open-email-client.md index a8f243b3..d37dca12 100644 --- a/docs/open-email-client.md +++ b/docs/open-email-client.md @@ -6,7 +6,7 @@ This PowerShell script launches the default email client. Parameters ---------- ```powershell -PS> ./open-email-client.ps1 [] +/home/markus/Repos/PowerShell/scripts/open-email-client.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -53,4 +53,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-email-client.ps1 as of 08/15/2024 09:50:51)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-email-client.ps1 as of 11/08/2024 12:34:53)* diff --git a/docs/open-f-drive.md b/docs/open-f-drive.md index eeb84257..997edec4 100644 --- a/docs/open-f-drive.md +++ b/docs/open-f-drive.md @@ -6,7 +6,7 @@ This PowerShell script launches the File Explorer with the F: drive folder. Parameters ---------- ```powershell -PS> ./open-f-drive.ps1 [] +/home/markus/Repos/PowerShell/scripts/open-f-drive.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-f-drive.ps1 as of 08/15/2024 09:50:51)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-f-drive.ps1 as of 11/08/2024 12:34:53)* diff --git a/docs/open-file-explorer.md b/docs/open-file-explorer.md index da606f0b..cb4bb25c 100644 --- a/docs/open-file-explorer.md +++ b/docs/open-file-explorer.md @@ -6,7 +6,7 @@ This PowerShell script launches the File Explorer. Parameters ---------- ```powershell -PS> ./open-file-explorer.ps1 [[-Path] ] [] +/home/markus/Repos/PowerShell/scripts/open-file-explorer.ps1 [[-Path] ] [] -Path Specifies the path to the folder to display @@ -70,4 +70,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-file-explorer.ps1 as of 08/15/2024 09:50:51)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-file-explorer.ps1 as of 11/08/2024 12:34:53)* diff --git a/docs/open-fire-place.md b/docs/open-fire-place.md index 804225f2..0f429eb1 100644 --- a/docs/open-fire-place.md +++ b/docs/open-fire-place.md @@ -6,7 +6,7 @@ This PowerShell script launches the Web browser with a fire place website. Parameters ---------- ```powershell -PS> ./open-fire-place.ps1 [] +/home/markus/Repos/PowerShell/scripts/open-fire-place.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-fire-place.ps1 as of 08/15/2024 09:50:51)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-fire-place.ps1 as of 11/08/2024 12:34:53)* diff --git a/docs/open-firefox.md b/docs/open-firefox.md index 31107542..b80bc69f 100644 --- a/docs/open-firefox.md +++ b/docs/open-firefox.md @@ -6,7 +6,7 @@ This PowerShell script launches the Mozilla Firefox Web browser. Parameters ---------- ```powershell -PS> ./open-firefox.ps1 [[-URL] ] [] +/home/markus/Repos/PowerShell/scripts/open-firefox.ps1 [[-URL] ] [] -URL Specifies an URL @@ -73,4 +73,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-firefox.ps1 as of 08/15/2024 09:50:51)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-firefox.ps1 as of 11/08/2024 12:34:53)* diff --git a/docs/open-flight-radar.md b/docs/open-flight-radar.md index d6c3aee7..8aa9b78b 100644 --- a/docs/open-flight-radar.md +++ b/docs/open-flight-radar.md @@ -6,7 +6,7 @@ This PowerShell script launches the Web browser with the FlightRadar24 website. Parameters ---------- ```powershell -PS> ./open-flight-radar.ps1 [] +/home/markus/Repos/PowerShell/scripts/open-flight-radar.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-flight-radar.ps1 as of 08/15/2024 09:50:51)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-flight-radar.ps1 as of 11/08/2024 12:34:53)* diff --git a/docs/open-g-drive.md b/docs/open-g-drive.md index 19e22670..e0ba2959 100644 --- a/docs/open-g-drive.md +++ b/docs/open-g-drive.md @@ -6,7 +6,7 @@ This PowerShell script launches the File Explorer with the G: drive folder. Parameters ---------- ```powershell -PS> ./open-g-drive.ps1 [] +/home/markus/Repos/PowerShell/scripts/open-g-drive.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-g-drive.ps1 as of 08/15/2024 09:50:51)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-g-drive.ps1 as of 11/08/2024 12:34:53)* diff --git a/docs/open-git-extensions.md b/docs/open-git-extensions.md index c8b45470..d6bbb305 100644 --- a/docs/open-git-extensions.md +++ b/docs/open-git-extensions.md @@ -48,4 +48,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-git-extensions.ps1 as of 08/15/2024 09:50:51)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-git-extensions.ps1 as of 11/08/2024 12:34:53)* diff --git a/docs/open-google-books.md b/docs/open-google-books.md index bbcd43b6..b6bcdc4d 100644 --- a/docs/open-google-books.md +++ b/docs/open-google-books.md @@ -6,7 +6,7 @@ This PowerShell script launches the Web browser with the Google Books website. Parameters ---------- ```powershell -PS> ./open-google-books.ps1 [] +/home/markus/Repos/PowerShell/scripts/open-google-books.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-google-books.ps1 as of 08/15/2024 09:50:51)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-google-books.ps1 as of 11/08/2024 12:34:53)* diff --git a/docs/open-google-calendar.md b/docs/open-google-calendar.md index b6168710..e3fad45e 100644 --- a/docs/open-google-calendar.md +++ b/docs/open-google-calendar.md @@ -6,7 +6,7 @@ This PowerShell script launches the Web browser with the Google Calendar website Parameters ---------- ```powershell -PS> ./open-google-calendar.ps1 [] +/home/markus/Repos/PowerShell/scripts/open-google-calendar.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-google-calendar.ps1 as of 08/15/2024 09:50:51)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-google-calendar.ps1 as of 11/08/2024 12:34:53)* diff --git a/docs/open-google-contacts.md b/docs/open-google-contacts.md index 1b07cf50..8f768b90 100644 --- a/docs/open-google-contacts.md +++ b/docs/open-google-contacts.md @@ -6,7 +6,7 @@ This PowerShell script launches the Web browser with the Google Contacts website Parameters ---------- ```powershell -PS> ./open-google-contacts.ps1 [] +/home/markus/Repos/PowerShell/scripts/open-google-contacts.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-google-contacts.ps1 as of 08/15/2024 09:50:51)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-google-contacts.ps1 as of 11/08/2024 12:34:53)* diff --git a/docs/open-google-docs.md b/docs/open-google-docs.md index edba5426..c841e94a 100644 --- a/docs/open-google-docs.md +++ b/docs/open-google-docs.md @@ -6,7 +6,7 @@ This PowerShell script launches the Web browser with the Google Docs website. Parameters ---------- ```powershell -PS> ./open-google-docs.ps1 [] +/home/markus/Repos/PowerShell/scripts/open-google-docs.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-google-docs.ps1 as of 08/15/2024 09:50:51)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-google-docs.ps1 as of 11/08/2024 12:34:53)* diff --git a/docs/open-google-earth.md b/docs/open-google-earth.md index 4c757683..a492125f 100644 --- a/docs/open-google-earth.md +++ b/docs/open-google-earth.md @@ -6,7 +6,7 @@ This PowerShell script launches the Web browser with the Google Earth website. Parameters ---------- ```powershell -PS> ./open-google-earth.ps1 [] +/home/markus/Repos/PowerShell/scripts/open-google-earth.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-google-earth.ps1 as of 08/15/2024 09:50:51)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-google-earth.ps1 as of 11/08/2024 12:34:53)* diff --git a/docs/open-google-mail.md b/docs/open-google-mail.md index 35558b11..81e41cc0 100644 --- a/docs/open-google-mail.md +++ b/docs/open-google-mail.md @@ -6,7 +6,7 @@ This PowerShell script launches the Web browser with the Google Mail website. Parameters ---------- ```powershell -PS> ./open-google-mail.ps1 [] +/home/markus/Repos/PowerShell/scripts/open-google-mail.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-google-mail.ps1 as of 08/15/2024 09:50:52)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-google-mail.ps1 as of 11/08/2024 12:34:53)* diff --git a/docs/open-google-maps.md b/docs/open-google-maps.md index a8b3e63a..ef19ae67 100644 --- a/docs/open-google-maps.md +++ b/docs/open-google-maps.md @@ -6,7 +6,7 @@ This PowerShell script launches the Web browser with the Google Maps website. Parameters ---------- ```powershell -PS> ./open-google-maps.ps1 [] +/home/markus/Repos/PowerShell/scripts/open-google-maps.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-google-maps.ps1 as of 08/15/2024 09:50:52)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-google-maps.ps1 as of 11/08/2024 12:34:53)* diff --git a/docs/open-google-news.md b/docs/open-google-news.md index d982bd02..665712a0 100644 --- a/docs/open-google-news.md +++ b/docs/open-google-news.md @@ -6,7 +6,7 @@ This PowerShell script launches the Web browser with the Google News website. Parameters ---------- ```powershell -PS> ./open-google-news.ps1 [] +/home/markus/Repos/PowerShell/scripts/open-google-news.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-google-news.ps1 as of 08/15/2024 09:50:52)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-google-news.ps1 as of 11/08/2024 12:34:53)* diff --git a/docs/open-google-photos.md b/docs/open-google-photos.md index e6a4e9db..f2fc5e31 100644 --- a/docs/open-google-photos.md +++ b/docs/open-google-photos.md @@ -6,7 +6,7 @@ This PowerShell script launches the Web browser with the Google Photos website. Parameters ---------- ```powershell -PS> ./open-google-photos.ps1 [] +/home/markus/Repos/PowerShell/scripts/open-google-photos.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-google-photos.ps1 as of 08/15/2024 09:50:52)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-google-photos.ps1 as of 11/08/2024 12:34:53)* diff --git a/docs/open-google-play.md b/docs/open-google-play.md index cbf9503d..5184e747 100644 --- a/docs/open-google-play.md +++ b/docs/open-google-play.md @@ -6,7 +6,7 @@ This PowerShell script launches the Web browser with the Google Play website. Parameters ---------- ```powershell -PS> ./open-google-play.ps1 [] +/home/markus/Repos/PowerShell/scripts/open-google-play.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-google-play.ps1 as of 08/15/2024 09:50:52)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-google-play.ps1 as of 11/08/2024 12:34:53)* diff --git a/docs/open-google-search.md b/docs/open-google-search.md index c7cbc79f..5a6566bf 100644 --- a/docs/open-google-search.md +++ b/docs/open-google-search.md @@ -6,7 +6,7 @@ This PowerShell script launches the Web browser with the Google Search website. Parameters ---------- ```powershell -PS> ./open-google-search.ps1 [] +/home/markus/Repos/PowerShell/scripts/open-google-search.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-google-search.ps1 as of 08/15/2024 09:50:52)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-google-search.ps1 as of 11/08/2024 12:34:53)* diff --git a/docs/open-google-stadia.md b/docs/open-google-stadia.md index 26ff5850..617a719b 100644 --- a/docs/open-google-stadia.md +++ b/docs/open-google-stadia.md @@ -6,7 +6,7 @@ This PowerShell script launches the Web browser with the Google Stadia website. Parameters ---------- ```powershell -PS> ./open-google-stadia.ps1 [] +/home/markus/Repos/PowerShell/scripts/open-google-stadia.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-google-stadia.ps1 as of 08/15/2024 09:50:52)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-google-stadia.ps1 as of 11/08/2024 12:34:53)* diff --git a/docs/open-google-translate.md b/docs/open-google-translate.md index 05f8142d..9d603487 100644 --- a/docs/open-google-translate.md +++ b/docs/open-google-translate.md @@ -6,7 +6,7 @@ This PowerShell script launches the Web browser with the Google Translate websit Parameters ---------- ```powershell -PS> ./open-google-translate.ps1 [] +/home/markus/Repos/PowerShell/scripts/open-google-translate.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-google-translate.ps1 as of 08/15/2024 09:50:52)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-google-translate.ps1 as of 11/08/2024 12:34:53)* diff --git a/docs/open-home-folder.md b/docs/open-home-folder.md index 9582b319..bcf1349b 100644 --- a/docs/open-home-folder.md +++ b/docs/open-home-folder.md @@ -6,7 +6,7 @@ This script launches the File Explorer with the user's home folder. Parameters ---------- ```powershell -PS> ./open-home-folder.ps1 [] +/home/markus/Repos/PowerShell/scripts/open-home-folder.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -57,4 +57,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-home-folder.ps1 as of 08/15/2024 09:50:52)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-home-folder.ps1 as of 11/08/2024 12:34:53)* diff --git a/docs/open-internet-archive.md b/docs/open-internet-archive.md index 40250790..5b2c89bb 100644 --- a/docs/open-internet-archive.md +++ b/docs/open-internet-archive.md @@ -6,7 +6,7 @@ This script launches the Web browser with the Internet Archive website. Parameters ---------- ```powershell -PS> ./open-internet-archive.ps1 [] +/home/markus/Repos/PowerShell/scripts/open-internet-archive.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-internet-archive.ps1 as of 08/15/2024 09:50:52)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-internet-archive.ps1 as of 11/08/2024 12:34:53)* diff --git a/docs/open-jitsi-meet.md b/docs/open-jitsi-meet.md index 1c7e2f7b..dc28fcb6 100644 --- a/docs/open-jitsi-meet.md +++ b/docs/open-jitsi-meet.md @@ -6,7 +6,7 @@ This script launches the Web browser with the Jitsi Meet website. Parameters ---------- ```powershell -PS> ./open-jitsi-meet.ps1 [] +/home/markus/Repos/PowerShell/scripts/open-jitsi-meet.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-jitsi-meet.ps1 as of 08/15/2024 09:50:52)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-jitsi-meet.ps1 as of 11/08/2024 12:34:53)* diff --git a/docs/open-m-drive.md b/docs/open-m-drive.md index 45daad67..e3389120 100644 --- a/docs/open-m-drive.md +++ b/docs/open-m-drive.md @@ -6,7 +6,7 @@ This script launches the File Explorer with the M: drive folder. Parameters ---------- ```powershell -PS> ./open-m-drive.ps1 [] +/home/markus/Repos/PowerShell/scripts/open-m-drive.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-m-drive.ps1 as of 08/15/2024 09:50:52)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-m-drive.ps1 as of 11/08/2024 12:34:53)* diff --git a/docs/open-magnifier.md b/docs/open-magnifier.md index b1ab92cf..66e07cc6 100644 --- a/docs/open-magnifier.md +++ b/docs/open-magnifier.md @@ -6,7 +6,7 @@ This script launches the Windows Screen Magnifier application. Parameters ---------- ```powershell -PS> ./open-magnifier.ps1 [] +/home/markus/Repos/PowerShell/scripts/open-magnifier.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -53,4 +53,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-magnifier.ps1 as of 08/15/2024 09:50:52)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-magnifier.ps1 as of 11/08/2024 12:34:53)* diff --git a/docs/open-microsoft-paint.md b/docs/open-microsoft-paint.md index 90001c7a..ef878892 100644 --- a/docs/open-microsoft-paint.md +++ b/docs/open-microsoft-paint.md @@ -6,7 +6,7 @@ This script launches the Microsoft Paint application. Parameters ---------- ```powershell -PS> ./open-microsoft-paint.ps1 [] +/home/markus/Repos/PowerShell/scripts/open-microsoft-paint.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -53,4 +53,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-microsoft-paint.ps1 as of 08/15/2024 09:50:52)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-microsoft-paint.ps1 as of 11/08/2024 12:34:53)* diff --git a/docs/open-microsoft-solitaire.md b/docs/open-microsoft-solitaire.md index 84e52fa0..43731def 100644 --- a/docs/open-microsoft-solitaire.md +++ b/docs/open-microsoft-solitaire.md @@ -6,7 +6,7 @@ This script launches the Microsoft Solitaire application. Parameters ---------- ```powershell -PS> ./open-microsoft-solitaire.ps1 [] +/home/markus/Repos/PowerShell/scripts/open-microsoft-solitaire.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -48,4 +48,4 @@ Start-Process xboxliveapp-1297287741: exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-microsoft-solitaire.ps1 as of 08/15/2024 09:50:52)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-microsoft-solitaire.ps1 as of 11/08/2024 12:34:53)* diff --git a/docs/open-microsoft-store.md b/docs/open-microsoft-store.md index a1632aed..41c8016d 100644 --- a/docs/open-microsoft-store.md +++ b/docs/open-microsoft-store.md @@ -6,7 +6,7 @@ This script launches the Microsoft Store application. Parameters ---------- ```powershell -PS> ./open-microsoft-store.ps1 [] +/home/markus/Repos/PowerShell/scripts/open-microsoft-store.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -48,4 +48,4 @@ Start-Process ms-windows-store: exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-microsoft-store.ps1 as of 08/15/2024 09:50:52)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-microsoft-store.ps1 as of 11/08/2024 12:34:53)* diff --git a/docs/open-microsoft-teams.md b/docs/open-microsoft-teams.md index 10afa14d..dfe977a0 100644 --- a/docs/open-microsoft-teams.md +++ b/docs/open-microsoft-teams.md @@ -6,7 +6,7 @@ This script launches the Microsoft Teams application. Parameters ---------- ```powershell -PS> ./open-microsoft-teams.ps1 [] +/home/markus/Repos/PowerShell/scripts/open-microsoft-teams.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -53,4 +53,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-microsoft-teams.ps1 as of 08/15/2024 09:50:52)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-microsoft-teams.ps1 as of 11/08/2024 12:34:53)* diff --git a/docs/open-music-folder.md b/docs/open-music-folder.md index 2c3b91f5..e348872b 100644 --- a/docs/open-music-folder.md +++ b/docs/open-music-folder.md @@ -6,7 +6,7 @@ This script launches the File Explorer with the user's music folder. Parameters ---------- ```powershell -PS> ./open-music-folder.ps1 [] +/home/markus/Repos/PowerShell/scripts/open-music-folder.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -57,4 +57,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-music-folder.ps1 as of 08/15/2024 09:50:52)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-music-folder.ps1 as of 11/08/2024 12:34:53)* diff --git a/docs/open-netflix.md b/docs/open-netflix.md index bf3d42b4..d0ffddc9 100644 --- a/docs/open-netflix.md +++ b/docs/open-netflix.md @@ -6,7 +6,7 @@ This script launches the Netflix application. Parameters ---------- ```powershell -PS> ./open-netflix.ps1 [] +/home/markus/Repos/PowerShell/scripts/open-netflix.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -48,4 +48,4 @@ Start-Process netflix: exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-netflix.ps1 as of 08/15/2024 09:50:52)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-netflix.ps1 as of 11/08/2024 12:34:53)* diff --git a/docs/open-notepad.md b/docs/open-notepad.md index d9f58cdd..70cb920a 100644 --- a/docs/open-notepad.md +++ b/docs/open-notepad.md @@ -6,7 +6,7 @@ This PowerShell script launches the Notepad application. Parameters ---------- ```powershell -PS> ./open-notepad.ps1 [] +/home/markus/Repos/PowerShell/scripts/open-notepad.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -53,4 +53,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-notepad.ps1 as of 08/15/2024 09:50:52)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-notepad.ps1 as of 11/08/2024 12:34:53)* diff --git a/docs/open-obs-studio.md b/docs/open-obs-studio.md index ee3b422f..035784a9 100644 --- a/docs/open-obs-studio.md +++ b/docs/open-obs-studio.md @@ -47,4 +47,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-obs-studio.ps1 as of 08/15/2024 09:50:52)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-obs-studio.ps1 as of 11/08/2024 12:34:53)* diff --git a/docs/open-office-365.md b/docs/open-office-365.md index cc09d826..e16e55d6 100644 --- a/docs/open-office-365.md +++ b/docs/open-office-365.md @@ -6,7 +6,7 @@ This script launches the Web browser with the Microsoft Office 365 website. Parameters ---------- ```powershell -PS> ./open-office-365.ps1 [] +/home/markus/Repos/PowerShell/scripts/open-office-365.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-office-365.ps1 as of 08/15/2024 09:50:52)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-office-365.ps1 as of 11/08/2024 12:34:53)* diff --git a/docs/open-one-drive-folder.md b/docs/open-one-drive-folder.md index ada73c92..3f7d5d4c 100644 --- a/docs/open-one-drive-folder.md +++ b/docs/open-one-drive-folder.md @@ -6,7 +6,7 @@ This script launches the File Explorer with the user's OneDrive folder. Parameters ---------- ```powershell -PS> ./open-one-drive-folder.ps1 [] +/home/markus/Repos/PowerShell/scripts/open-one-drive-folder.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -57,4 +57,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-one-drive-folder.ps1 as of 08/15/2024 09:50:52)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-one-drive-folder.ps1 as of 11/08/2024 12:34:53)* diff --git a/docs/open-outlook.md b/docs/open-outlook.md index bbc5bb0f..5a787ac6 100644 --- a/docs/open-outlook.md +++ b/docs/open-outlook.md @@ -47,4 +47,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-outlook.ps1 as of 08/15/2024 09:50:52)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-outlook.ps1 as of 11/08/2024 12:34:53)* diff --git a/docs/open-paint-three-d.md b/docs/open-paint-three-d.md index 1489d83e..35dfdc9c 100644 --- a/docs/open-paint-three-d.md +++ b/docs/open-paint-three-d.md @@ -6,7 +6,7 @@ This script launches the Paint 3D application. Parameters ---------- ```powershell -PS> ./open-paint-three-d.ps1 [] +/home/markus/Repos/PowerShell/scripts/open-paint-three-d.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -53,4 +53,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-paint-three-d.ps1 as of 08/15/2024 09:50:52)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-paint-three-d.ps1 as of 11/08/2024 12:34:53)* diff --git a/docs/open-pictures-folder.md b/docs/open-pictures-folder.md index 1980b62c..7168b9ca 100644 --- a/docs/open-pictures-folder.md +++ b/docs/open-pictures-folder.md @@ -6,7 +6,7 @@ This script launches the File Explorer with the user's pictures folder. Parameters ---------- ```powershell -PS> ./open-pictures-folder.ps1 [] +/home/markus/Repos/PowerShell/scripts/open-pictures-folder.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -57,4 +57,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-pictures-folder.ps1 as of 08/15/2024 09:50:52)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-pictures-folder.ps1 as of 11/08/2024 12:34:53)* diff --git a/docs/open-rdp.md b/docs/open-rdp.md index aa570350..225adff2 100644 --- a/docs/open-rdp.md +++ b/docs/open-rdp.md @@ -7,7 +7,7 @@ NOTE: Documentation of mstsc at: https://learn.microsoft.com/en-us/windows-serve Parameters ---------- ```powershell -PS> ./open-rdp.ps1 [[-hostname] ] [] +/home/markus/Repos/PowerShell/scripts/open-rdp.ps1 [[-hostname] ] [] -hostname @@ -64,4 +64,4 @@ if ($hostname -eq "") { exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-rdp.ps1 as of 08/15/2024 09:50:52)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-rdp.ps1 as of 11/08/2024 12:34:53)* diff --git a/docs/open-recycle-bin-folder.md b/docs/open-recycle-bin-folder.md index f09e3ba5..ff41126f 100644 --- a/docs/open-recycle-bin-folder.md +++ b/docs/open-recycle-bin-folder.md @@ -6,7 +6,7 @@ This script launches the File Explorer with the user's recycle bin folder. Parameters ---------- ```powershell -PS> ./open-recycle-bin-folder.ps1 [] +/home/markus/Repos/PowerShell/scripts/open-recycle-bin-folder.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -53,4 +53,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-recycle-bin-folder.ps1 as of 08/15/2024 09:50:52)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-recycle-bin-folder.ps1 as of 11/08/2024 12:34:53)* diff --git a/docs/open-remote-desktop.md b/docs/open-remote-desktop.md index d20f63bf..1c7518e5 100644 --- a/docs/open-remote-desktop.md +++ b/docs/open-remote-desktop.md @@ -6,7 +6,7 @@ This script launches the Remote Desktop application. Parameters ---------- ```powershell -PS> ./open-remote-desktop.ps1 [] +/home/markus/Repos/PowerShell/scripts/open-remote-desktop.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -53,4 +53,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-remote-desktop.ps1 as of 08/15/2024 09:50:52)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-remote-desktop.ps1 as of 11/08/2024 12:34:53)* diff --git a/docs/open-repos-folder.md b/docs/open-repos-folder.md index 6703f871..91a91cef 100644 --- a/docs/open-repos-folder.md +++ b/docs/open-repos-folder.md @@ -6,7 +6,7 @@ This script launches the File Explorer with the user's Git repositories folder. Parameters ---------- ```powershell -PS> ./open-repos-folder.ps1 [] +/home/markus/Repos/PowerShell/scripts/open-repos-folder.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -57,4 +57,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-repos-folder.ps1 as of 08/15/2024 09:50:52)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-repos-folder.ps1 as of 11/08/2024 12:34:53)* diff --git a/docs/open-screen-clip.md b/docs/open-screen-clip.md index 98454c1b..736470bc 100644 --- a/docs/open-screen-clip.md +++ b/docs/open-screen-clip.md @@ -6,7 +6,7 @@ This script launches the Screen Clip application. Parameters ---------- ```powershell -PS> ./open-screen-clip.ps1 [] +/home/markus/Repos/PowerShell/scripts/open-screen-clip.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -53,4 +53,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-screen-clip.ps1 as of 08/15/2024 09:50:52)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-screen-clip.ps1 as of 11/08/2024 12:34:53)* diff --git a/docs/open-screen-sketch.md b/docs/open-screen-sketch.md index 20203789..37b1683d 100644 --- a/docs/open-screen-sketch.md +++ b/docs/open-screen-sketch.md @@ -6,7 +6,7 @@ This script launches the Screen Sketch application. Parameters ---------- ```powershell -PS> ./open-screen-sketch.ps1 [] +/home/markus/Repos/PowerShell/scripts/open-screen-sketch.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -53,4 +53,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-screen-sketch.ps1 as of 08/15/2024 09:50:52)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-screen-sketch.ps1 as of 11/08/2024 12:34:53)* diff --git a/docs/open-skype.md b/docs/open-skype.md index c3059d6a..0291a46a 100644 --- a/docs/open-skype.md +++ b/docs/open-skype.md @@ -6,7 +6,7 @@ This script launches the Skype application. Parameters ---------- ```powershell -PS> ./open-skype.ps1 [] +/home/markus/Repos/PowerShell/scripts/open-skype.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -53,4 +53,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-skype.ps1 as of 08/15/2024 09:50:52)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-skype.ps1 as of 11/08/2024 12:34:53)* diff --git a/docs/open-snipping-tool.md b/docs/open-snipping-tool.md index 7febb323..de745537 100644 --- a/docs/open-snipping-tool.md +++ b/docs/open-snipping-tool.md @@ -6,7 +6,7 @@ This script launches the Snipping Tool application. Parameters ---------- ```powershell -PS> ./open-snipping-tool.ps1 [] +/home/markus/Repos/PowerShell/scripts/open-snipping-tool.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -48,4 +48,4 @@ Start-Process SnippingTool.exe exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-snipping-tool.ps1 as of 08/15/2024 09:50:52)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-snipping-tool.ps1 as of 11/08/2024 12:34:53)* diff --git a/docs/open-speed-test.md b/docs/open-speed-test.md index 490ba5e5..0bd5c9af 100644 --- a/docs/open-speed-test.md +++ b/docs/open-speed-test.md @@ -6,7 +6,7 @@ This script launches the Web browser with Cloudflare's speed test website. Parameters ---------- ```powershell -PS> ./open-speed-test.ps1 [] +/home/markus/Repos/PowerShell/scripts/open-speed-test.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-speed-test.ps1 as of 08/15/2024 09:50:52)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-speed-test.ps1 as of 11/08/2024 12:34:53)* diff --git a/docs/open-spotify.md b/docs/open-spotify.md index a6b3db22..395e1d27 100644 --- a/docs/open-spotify.md +++ b/docs/open-spotify.md @@ -6,7 +6,7 @@ This script launches the Spotify application. Parameters ---------- ```powershell -PS> ./open-spotify.ps1 [] +/home/markus/Repos/PowerShell/scripts/open-spotify.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -48,4 +48,4 @@ Start-Process spotify: exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-spotify.ps1 as of 08/15/2024 09:50:52)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-spotify.ps1 as of 11/08/2024 12:34:53)* diff --git a/docs/open-stack-overflow.md b/docs/open-stack-overflow.md index cd43d25f..27c4660f 100644 --- a/docs/open-stack-overflow.md +++ b/docs/open-stack-overflow.md @@ -6,7 +6,7 @@ This script launches the Web browser with the Stack Overflow website. Parameters ---------- ```powershell -PS> ./open-stack-overflow.ps1 [] +/home/markus/Repos/PowerShell/scripts/open-stack-overflow.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-stack-overflow.ps1 as of 08/15/2024 09:50:52)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-stack-overflow.ps1 as of 11/08/2024 12:34:53)* diff --git a/docs/open-start-page.md b/docs/open-start-page.md index 2a356d7f..00e7f56e 100644 --- a/docs/open-start-page.md +++ b/docs/open-start-page.md @@ -6,7 +6,7 @@ This script launches the Web browser with the Startpage website. Parameters ---------- ```powershell -PS> ./open-start-page.ps1 [] +/home/markus/Repos/PowerShell/scripts/open-start-page.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-start-page.ps1 as of 08/15/2024 09:50:52)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-start-page.ps1 as of 11/08/2024 12:34:53)* diff --git a/docs/open-street-map.md b/docs/open-street-map.md index f81f7ab7..832d1d1b 100644 --- a/docs/open-street-map.md +++ b/docs/open-street-map.md @@ -6,7 +6,7 @@ This script launches the Web browser with the OpenStreetMap website. Parameters ---------- ```powershell -PS> ./open-street-map.ps1 [] +/home/markus/Repos/PowerShell/scripts/open-street-map.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-street-map.ps1 as of 08/15/2024 09:50:52)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-street-map.ps1 as of 11/08/2024 12:34:53)* diff --git a/docs/open-task-manager.md b/docs/open-task-manager.md index cc2b82a9..3a7faf45 100644 --- a/docs/open-task-manager.md +++ b/docs/open-task-manager.md @@ -6,7 +6,7 @@ This script launches the Windows Task Manager application. Parameters ---------- ```powershell -PS> ./open-task-manager.ps1 [] +/home/markus/Repos/PowerShell/scripts/open-task-manager.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -53,4 +53,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-task-manager.ps1 as of 08/15/2024 09:50:52)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-task-manager.ps1 as of 11/08/2024 12:34:53)* diff --git a/docs/open-temporary-folder.md b/docs/open-temporary-folder.md index 465cea1c..0da3f9cd 100644 --- a/docs/open-temporary-folder.md +++ b/docs/open-temporary-folder.md @@ -50,4 +50,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-temporary-folder.ps1 as of 08/15/2024 09:50:52)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-temporary-folder.ps1 as of 11/08/2024 12:34:53)* diff --git a/docs/open-three-d-viewer.md b/docs/open-three-d-viewer.md index 5503e1cf..922db8c7 100644 --- a/docs/open-three-d-viewer.md +++ b/docs/open-three-d-viewer.md @@ -6,7 +6,7 @@ This script launches the 3D-Viewer application. Parameters ---------- ```powershell -PS> ./open-three-d-viewer.ps1 [] +/home/markus/Repos/PowerShell/scripts/open-three-d-viewer.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -48,4 +48,4 @@ Start-Process com.microsoft.3dviewer: exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-three-d-viewer.ps1 as of 08/15/2024 09:50:52)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-three-d-viewer.ps1 as of 11/08/2024 12:34:53)* diff --git a/docs/open-thunderbird.md b/docs/open-thunderbird.md index 8db25954..82dcb71b 100644 --- a/docs/open-thunderbird.md +++ b/docs/open-thunderbird.md @@ -45,4 +45,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-thunderbird.ps1 as of 08/15/2024 09:50:52)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-thunderbird.ps1 as of 11/08/2024 12:34:53)* diff --git a/docs/open-videos-folders.md b/docs/open-videos-folders.md index 5942190f..2ad022be 100644 --- a/docs/open-videos-folders.md +++ b/docs/open-videos-folders.md @@ -6,7 +6,7 @@ This script launches the File Explorer with the user's videos folder. Parameters ---------- ```powershell -PS> ./open-videos-folders.ps1 [] +/home/markus/Repos/PowerShell/scripts/open-videos-folders.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -57,4 +57,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-videos-folders.ps1 as of 08/15/2024 09:50:52)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-videos-folders.ps1 as of 11/08/2024 12:34:53)* diff --git a/docs/open-visual-studio.md b/docs/open-visual-studio.md index e52afd17..2a3a527e 100644 --- a/docs/open-visual-studio.md +++ b/docs/open-visual-studio.md @@ -47,4 +47,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-visual-studio.ps1 as of 08/15/2024 09:50:52)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-visual-studio.ps1 as of 11/08/2024 12:34:53)* diff --git a/docs/open-voice-recorder.md b/docs/open-voice-recorder.md index f5c688b2..9b08af5f 100644 --- a/docs/open-voice-recorder.md +++ b/docs/open-voice-recorder.md @@ -6,7 +6,7 @@ This PowerShell script launches the Windows Voice Recorder application. Parameters ---------- ```powershell -PS> ./open-voice-recorder.ps1 [] +/home/markus/Repos/PowerShell/scripts/open-voice-recorder.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -53,4 +53,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-voice-recorder.ps1 as of 08/15/2024 09:50:52)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-voice-recorder.ps1 as of 11/08/2024 12:34:53)* diff --git a/docs/open-vpn-settings.md b/docs/open-vpn-settings.md index 65c85fb5..e9f9b014 100644 --- a/docs/open-vpn-settings.md +++ b/docs/open-vpn-settings.md @@ -6,7 +6,7 @@ This PowerShell script launches the VPN settings of Windows. Parameters ---------- ```powershell -PS> ./open-vpn-settings.ps1 [] +/home/markus/Repos/PowerShell/scripts/open-vpn-settings.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -48,4 +48,4 @@ Start-Process ms-settings:network-vpn exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-vpn-settings.ps1 as of 08/15/2024 09:50:52)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-vpn-settings.ps1 as of 11/08/2024 12:34:53)* diff --git a/docs/open-windows-defender.md b/docs/open-windows-defender.md index 39ee6287..97345931 100644 --- a/docs/open-windows-defender.md +++ b/docs/open-windows-defender.md @@ -6,7 +6,7 @@ This script launches the Windows Defender application. Parameters ---------- ```powershell -PS> ./open-windows-defender.ps1 [] +/home/markus/Repos/PowerShell/scripts/open-windows-defender.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -48,4 +48,4 @@ Start-Process windowsdefender: exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-windows-defender.ps1 as of 08/15/2024 09:50:52)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-windows-defender.ps1 as of 11/08/2024 12:34:53)* diff --git a/docs/open-windows-terminal.md b/docs/open-windows-terminal.md index b7df90ee..4363dfda 100644 --- a/docs/open-windows-terminal.md +++ b/docs/open-windows-terminal.md @@ -6,7 +6,7 @@ This script launches the Windows Terminal application. Parameters ---------- ```powershell -PS> ./open-windows-terminal.ps1 [] +/home/markus/Repos/PowerShell/scripts/open-windows-terminal.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -48,4 +48,4 @@ Start-Process wt.exe exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-windows-terminal.ps1 as of 08/15/2024 09:50:52)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-windows-terminal.ps1 as of 11/08/2024 12:34:53)* diff --git a/docs/open-xing.md b/docs/open-xing.md index 1ba064ab..df7cc08f 100644 --- a/docs/open-xing.md +++ b/docs/open-xing.md @@ -6,7 +6,7 @@ This script launches the XING application. Parameters ---------- ```powershell -PS> ./open-xing.ps1 [] +/home/markus/Repos/PowerShell/scripts/open-xing.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -48,4 +48,4 @@ Start-Process xing: exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-xing.ps1 as of 08/15/2024 09:50:52)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-xing.ps1 as of 11/08/2024 12:34:53)* diff --git a/docs/pick-commit.md b/docs/pick-commit.md index 89350be6..0e86da22 100644 --- a/docs/pick-commit.md +++ b/docs/pick-commit.md @@ -7,7 +7,7 @@ NOTE: in case of merge conflicts the script stops immediately! Parameters ---------- ```powershell -PS> ./pick-commit.ps1 [[-CommitID] ] [[-CommitMessage] ] [[-Branches] ] [[-RepoDir] ] [] +/home/markus/Repos/PowerShell/scripts/pick-commit.ps1 [[-CommitID] ] [[-CommitMessage] ] [[-Branches] ] [[-RepoDir] ] [] -CommitID Specifies the commit ID @@ -143,7 +143,7 @@ try { if ($lastExitCode -ne "0") { throw "'git push' failed" } } [int]$Elapsed = $StopWatch.Elapsed.TotalSeconds - "βœ”οΈ cherry picked $CommitID into $NumBranches branches in $Elapsed sec" + "βœ… cherry picked $CommitID into $NumBranches branches in $Elapsed sec" exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -151,4 +151,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of pick-commit.ps1 as of 08/15/2024 09:50:52)* +*(generated by convert-ps2md.ps1 using the comment-based help of pick-commit.ps1 as of 11/08/2024 12:34:53)* diff --git a/docs/ping-host.md b/docs/ping-host.md index 290ecbde..6059e4c9 100644 --- a/docs/ping-host.md +++ b/docs/ping-host.md @@ -1,15 +1,15 @@ Script: *ping-host.ps1* ======================== -This PowerShell script pings the given host continously and shows the roundtrip times in a horizontal chart. +This PowerShell script pings the given host. Parameters ---------- ```powershell -PS> ./ping-host.ps1 [[-hostname] ] [[-timeInterval] ] [] +/home/markus/Repos/PowerShell/scripts/ping-host.ps1 [[-hostname] ] [] -hostname - Specifies the hostname or IP address of the host to ping (windows.com by default) + Specifies the hostname or IP address to ping (windows.com by default) Required? false Position? 1 @@ -17,15 +17,6 @@ PS> ./ping-host.ps1 [[-hostname] ] [[-timeInterval] ] [ - Specifies the time interval in milliseconds to repeat the ping (1000 by default) - - Required? false - Position? 2 - Default value 1000 - Accept pipeline input? false - Accept wildcard characters? false - [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, WarningVariable, OutBuffer, PipelineVariable, and OutVariable. @@ -34,15 +25,8 @@ PS> ./ping-host.ps1 [[-hostname] ] [[-timeInterval] ] [ ./ping-host.ps1 - - - -Ping Roundtrip Times to Host: windows.com -β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ 136ms -β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ 154ms -β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ 234ms -... +PS> ./ping-host.ps1 x.com +βœ… x.com is up and running (11ms latency). ``` @@ -59,72 +43,37 @@ Script Content ```powershell <# .SYNOPSIS - Ping a host continuously + Pings a host .DESCRIPTION - This PowerShell script pings the given host continously and shows the roundtrip times in a horizontal chart. + This PowerShell script pings the given host. .PARAMETER hostname - Specifies the hostname or IP address of the host to ping (windows.com by default) -.PARAMETER timeInterval - Specifies the time interval in milliseconds to repeat the ping (1000 by default) + Specifies the hostname or IP address to ping (windows.com by default) .EXAMPLE - PS> ./ping-host.ps1 - - Ping Roundtrip Times to Host: windows.com - β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ 136ms - β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ 154ms - β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ 234ms - ... + PS> ./ping-host.ps1 x.com + βœ… x.com is up and running (11ms latency). .LINK https://github.com/fleschutz/PowerShell .NOTES Author: Markus Fleschutz | License: CC0 #> -param([string]$hostname = "windows.com", [int]$timeInterval = 1000) +param([string]$hostname = "windows.com") function GetPingLatency([string]$hostname) { $hostsArray = $hostname.Split(",") - $tasks = $hostsArray | foreach { - (New-Object Net.NetworkInformation.Ping).SendPingAsync($_,1000) - } + $tasks = $hostsArray | foreach { (New-Object Net.NetworkInformation.Ping).SendPingAsync($_,1500) } [Threading.Tasks.Task]::WaitAll($tasks) - foreach($ping in $tasks.Result) { - if ($ping.Status -eq "Success") { return $ping.RoundtripTime } - } - return 1000 -} - -function WriteChartLine { param([float]$value, [float]$maxValue, [string]$text) - $num = ($value * 110.0) / $maxValue - while ($num -ge 1.0) { - Write-Host -noNewLine "β–ˆ" - $num -= 1.0 - } - if ($num -ge 0.875) { - Write-Host -noNewLine "β–‰" - } elseif ($num -ge 0.75) { - Write-Host -noNewLine "β–Š" - } elseif ($num -ge 0.625) { - Write-Host -noNewLine "β–‹" - } elseif ($num -ge 0.5) { - Write-Host -noNewLine "β–Œ" - } elseif ($num -ge 0.375) { - Write-Host -noNewLine "▍" - } elseif ($num -ge 0.25) { - Write-Host -noNewLine "β–Ž" - } elseif ($num -ge 0.125) { - Write-Host -noNewLine "▏" - } - Write-Host " $text" + foreach($ping in $tasks.Result) { if ($ping.Status -eq "Success") { return $ping.RoundtripTime } } + return 1500 } try { - Write-Host "`nPing Roundtrip Times to Host: $($hostname)" -foregroundColor green - do { - [float]$latency = GetPingLatency $hostname - WriteChartLine $latency 1000.0 "$($latency)ms" - Start-Sleep -Milliseconds $timeInterval - } while($true) + [int]$latency = GetPingLatency($hostname) + if ($latency -eq 1500) { + Write-Host "⚠️ Host '$hostname' doesn't respond - check the connection or maybe the host is down." + exit 1 + } + Write-Host "βœ… $hostname is up and running ($($latency)ms latency)." exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -132,4 +81,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of ping-host.ps1 as of 08/15/2024 09:50:52)* +*(generated by convert-ps2md.ps1 using the comment-based help of ping-host.ps1 as of 11/08/2024 12:34:53)* diff --git a/docs/ping-internet.md b/docs/ping-internet.md new file mode 100644 index 00000000..1f3ca002 --- /dev/null +++ b/docs/ping-internet.md @@ -0,0 +1,99 @@ +Script: *ping-internet.ps1* +======================== + +This PowerShell script measures the ping roundtrip times from the local computer to remote ones (10 Internet servers by default). + +Parameters +---------- +```powershell +/home/markus/Repos/PowerShell/scripts/ping-internet.ps1 [[-hosts] ] [] + +-hosts + Specifies the hosts to ping, seperated by commata (10 Internet servers by default) + + Required? false + Position? 1 + Default value bing.com,cnn.com,dropbox.com,github.com,google.com,ibm.com,live.com,meta.com,x.com,youtube.com + Accept pipeline input? false + Accept wildcard characters? false + +[] + This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, + WarningVariable, OutBuffer, PipelineVariable, and OutVariable. +``` + +Example +------- +```powershell +PS> ./ping-internet.ps1 +βœ… Internet ping takes 12ms (9...18ms range) + +``` + +Notes +----- +Author: Markus Fleschutz | License: CC0 + +Related Links +------------- +https://github.com/fleschutz/PowerShell + +Script Content +-------------- +```powershell +<# +.SYNOPSIS + Pings remote hosts to measure the latency +.DESCRIPTION + This PowerShell script measures the ping roundtrip times from the local computer to remote ones (10 Internet servers by default). +.PARAMETER hosts + Specifies the hosts to ping, seperated by commata (10 Internet servers by default) +.EXAMPLE + PS> ./ping-internet.ps1 + βœ… Internet ping takes 12ms (9...18ms range) +.LINK + https://github.com/fleschutz/PowerShell +.NOTES + Author: Markus Fleschutz | License: CC0 +#> + +param([string]$hosts = "bing.com,cnn.com,dropbox.com,github.com,google.com,ibm.com,live.com,meta.com,x.com,youtube.com") + +try { + $hostsArray = $hosts.Split(",") + $tasks = $hostsArray | foreach { (New-Object Net.NetworkInformation.Ping).SendPingAsync($_,1000) } + [int]$min = 9999999 + [int]$max = [int]$avg = [int]$success = 0 + [int]$total = $hostsArray.Count + [Threading.Tasks.Task]::WaitAll($tasks) + foreach($ping in $tasks.Result) { + if ($ping.Status -ne "Success") { continue } + $success++ + [int]$latency = $ping.RoundtripTime + $avg += $latency + if ($latency -lt $min) { $min = $latency } + if ($latency -gt $max) { $max = $latency } + } + [int]$loss = $total - $success + if ($success -eq 0) { + Write-Host "⚠️ Internet offline (100% ping loss)" + } elseif ($loss -gt 0) { + [float]$speed = [math]::round([float]$avg / [float]$success, 1) + Write-Host "βœ… Online with $loss/$total ping loss and $($min)...$($max)ms latency - $($speed)ms average" + } else { + [float]$speed = [math]::round([float]$avg / [float]$success, 1) + if ($speed -lt 20.0) { $result = "excellent" + } elseif ($speed -lt 50.0) { $result = "good" + } elseif ($speed -lt 100.0) { $result = "average" + } elseif ($speed -lt 150.0) { $result = "okay" + } else { $result = "laggy" } + Write-Host "βœ… Internet ping is $($result): $($speed)ms ($($min)-$($max)ms range)" + } + exit 0 # success +} catch { + "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" + exit 1 +} +``` + +*(generated by convert-ps2md.ps1 using the comment-based help of ping-internet.ps1 as of 11/08/2024 12:34:53)* diff --git a/docs/ping-local-devices.md b/docs/ping-local-devices.md new file mode 100644 index 00000000..51d709d4 --- /dev/null +++ b/docs/ping-local-devices.md @@ -0,0 +1,84 @@ +Script: *ping-local-devices.ps1* +======================== + +This PowerShell script pings devices in the local network and lists which one are up. + +Parameters +---------- +```powershell +/home/markus/Repos/PowerShell/scripts/ping-local-devices.ps1 [[-timeout] ] [] + +-timeout + + Required? false + Position? 1 + Default value 600 + Accept pipeline input? false + Accept wildcard characters? false + +[] + This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, + WarningVariable, OutBuffer, PipelineVariable, and OutVariable. +``` + +Example +------- +```powershell +PS> ./ping-local-devices.ps1 +βœ… Up: epson raspi tux + +``` + +Notes +----- +Author: Markus Fleschutz | License: CC0 + +Related Links +------------- +https://github.com/fleschutz/PowerShell + +Script Content +-------------- +```powershell +<# +.SYNOPSIS + Pings local devices +.DESCRIPTION + This PowerShell script pings devices in the local network and lists which one are up. +.EXAMPLE + PS> ./ping-local-devices.ps1 + βœ… Up: epson raspi tux +.LINK + https://github.com/fleschutz/PowerShell +.NOTES + Author: Markus Fleschutz | License: CC0 +#> + +param([int]$timeout = 600) # ms ping timeout + + +try { + $names = @('accesspoint','AD','AP','amnesiac','archlinux','auriga','berlin','boston','brother','canon','castor','cisco','echodot','epson','epson2815','fedora','fireball','firewall','fritz.box','fritz.nas','fritz.powerline','fritz.repeater','gassensor','gateway','hippo','heizung','hodor','homemanager','io','iphone','jarvis','jenkins','LA','laptop','linux','jupiter','mars','mercury','miami','mobile','none','none-1','none-2','NY','o2.lte','octo','office','officepc','paris','PI','pixel-6a','PC','pluto','printer','proxy','R2D2','raspberry','raspi','rocket','rome','router','sentinel','server','shelly','shelly1','smartphone','smartwatch','soundbar','speedport.ip','sunnyboy','surface','switch','tablet','tau','tigercat','tolino','tux','TV','ubuntu','vega','venus','xrx','zeus') # sorted alphabetically + $queue = [System.Collections.Queue]::new() + foreach($name in $names) { $ping = [System.Net.Networkinformation.Ping]::new() + $queue.Enqueue( @{Host=$name;Ping=$ping;Async=$ping.SendPingAsync($name,$timeout)} ) + } + [string]$up = "" + Write-Host "βœ… Local devices: " -noNewline + while($queue.Count -gt 0) { $obj = $queue.Dequeue() + try { if ($obj.Async.Wait($timeout)) { + if ($obj.Async.Result.Status -ne "TimedOut") { Write-Host "$($obj.Host) " -noNewline } + continue + } + } catch { continue } + $queue.Enqueue($obj) + } + Write-Host "" + exit 0 # success +} catch { + "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" + exit 1 +} +``` + +*(generated by convert-ps2md.ps1 using the comment-based help of ping-local-devices.ps1 as of 11/08/2024 12:34:54)* diff --git a/docs/ping-weather.md b/docs/ping-weather.md index 1a7a7358..1254fa54 100644 --- a/docs/ping-weather.md +++ b/docs/ping-weather.md @@ -6,7 +6,7 @@ This PowerShell script continuously shows the current weather conditions (simila Parameters ---------- ```powershell -PS> ./ping-weather.ps1 [[-Location] ] [[-UpdateInterval] ] [] +/home/markus/Repos/PowerShell/scripts/ping-weather.ps1 [[-Location] ] [[-UpdateInterval] ] [] -Location Specifies the location to use (determined automatically per default) @@ -99,4 +99,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of ping-weather.ps1 as of 08/15/2024 09:50:52)* +*(generated by convert-ps2md.ps1 using the comment-based help of ping-weather.ps1 as of 11/08/2024 12:34:54)* diff --git a/docs/play-bee-sound.md b/docs/play-bee-sound.md index 4084a76a..044707c8 100644 --- a/docs/play-bee-sound.md +++ b/docs/play-bee-sound.md @@ -6,7 +6,7 @@ This PowerShell script plays a bee sound. Parameters ---------- ```powershell -PS> ./play-bee-sound.ps1 [] +/home/markus/Repos/PowerShell/scripts/play-bee-sound.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of play-bee-sound.ps1 as of 08/15/2024 09:50:52)* +*(generated by convert-ps2md.ps1 using the comment-based help of play-bee-sound.ps1 as of 11/08/2024 12:34:54)* diff --git a/docs/play-beep-sound.md b/docs/play-beep-sound.md index 2e066633..36f1dae8 100644 --- a/docs/play-beep-sound.md +++ b/docs/play-beep-sound.md @@ -6,7 +6,7 @@ This PowerShell script plays a short beep sound at 500Hz for 300ms. Parameters ---------- ```powershell -PS> ./play-beep-sound.ps1 [] +/home/markus/Repos/PowerShell/scripts/play-beep-sound.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -56,4 +56,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of play-beep-sound.ps1 as of 08/15/2024 09:50:52)* +*(generated by convert-ps2md.ps1 using the comment-based help of play-beep-sound.ps1 as of 11/08/2024 12:34:54)* diff --git a/docs/play-big-ben.md b/docs/play-big-ben.md index b357a728..dfe2060e 100644 --- a/docs/play-big-ben.md +++ b/docs/play-big-ben.md @@ -6,7 +6,7 @@ This PowerShell script plays the sound of Big Ben. Parameters ---------- ```powershell -PS> ./play-big-ben.ps1 [] +/home/markus/Repos/PowerShell/scripts/play-big-ben.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -50,4 +50,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of play-big-ben.ps1 as of 08/15/2024 09:50:52)* +*(generated by convert-ps2md.ps1 using the comment-based help of play-big-ben.ps1 as of 11/08/2024 12:34:54)* diff --git a/docs/play-cat-sound.md b/docs/play-cat-sound.md index b12a58b9..36c51bbb 100644 --- a/docs/play-cat-sound.md +++ b/docs/play-cat-sound.md @@ -6,7 +6,7 @@ This PowerShell script plays a cat sound. Parameters ---------- ```powershell -PS> ./play-cat-sound.ps1 [] +/home/markus/Repos/PowerShell/scripts/play-cat-sound.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of play-cat-sound.ps1 as of 08/15/2024 09:50:52)* +*(generated by convert-ps2md.ps1 using the comment-based help of play-cat-sound.ps1 as of 11/08/2024 12:34:54)* diff --git a/docs/play-chess.md b/docs/play-chess.md new file mode 100644 index 00000000..4b4b241f --- /dev/null +++ b/docs/play-chess.md @@ -0,0 +1,1263 @@ +Script: *play-chess.ps1* +======================== + +Started off of code from https://github.com/bhassen99/POSH-Chess, which was very +much incomplete. I kept the board shape, but have changed everything else. +The unicode chess pieces unfortunately do not render in the base PowerShell console, +they only appear when run in PowerShell ISE. + +Parameters +---------- +```powershell +/home/markus/Repos/PowerShell/scripts/play-chess.ps1 [] + +[] + This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, + WarningVariable, OutBuffer, PipelineVariable, and OutVariable. +``` + +Notes +----- +Name: Chess.ps1 +Version: 0.3.1 +Author: Michael Shen +Date: 10-19-2017 + +Script Content +-------------- +```powershell +<# +.SYNOPSIS + Local multiplayer chess game in PowerShell. + +.DESCRIPTION + Started off of code from https://github.com/bhassen99/POSH-Chess, which was very +much incomplete. I kept the board shape, but have changed everything else. +The unicode chess pieces unfortunately do not render in the base PowerShell console, +they only appear when run in PowerShell ISE. + +.NOTES + Name: Chess.ps1 + Version: 0.3.1 + Author: Michael Shen + Date: 10-19-2017 +#> + +#Update-Board must be run before Publish-Board +#Draws the board to the screen and displays all the icons +Function Publish-Board { + Clear + Write-Host "`n`n" + Write-Host ' A B C D E F G H' + Write-Host ' --------------------------------- ' + Write-Host ' 8 |'$board[0,7].Icon'|'$board[1,7].Icon'|'$board[2,7].Icon'|'$board[3,7].Icon'|'$board[4,7].Icon'|'$board[5,7].Icon'|'$board[6,7].Icon'|'$board[7,7].Icon'| 8' + Write-Host ' --------------------------------- ' + Write-Host ' 7 |'$board[0,6].Icon'|'$board[1,6].Icon'|'$board[2,6].Icon'|'$board[3,6].Icon'|'$board[4,6].Icon'|'$board[5,6].Icon'|'$board[6,6].Icon'|'$board[7,6].Icon'| 7' + Write-Host ' --------------------------------- ' + Write-Host ' 6 |'$board[0,5].Icon'|'$board[1,5].Icon'|'$board[2,5].Icon'|'$board[3,5].Icon'|'$board[4,5].Icon'|'$board[5,5].Icon'|'$board[6,5].Icon'|'$board[7,5].Icon'| 6' + Write-Host ' --------------------------------- ' + Write-Host ' 5 |'$board[0,4].Icon'|'$board[1,4].Icon'|'$board[2,4].Icon'|'$board[3,4].Icon'|'$board[4,4].Icon'|'$board[5,4].Icon'|'$board[6,4].Icon'|'$board[7,4].Icon'| 5' + Write-Host ' --------------------------------- ' + Write-Host ' 4 |'$board[0,3].Icon'|'$board[1,3].Icon'|'$board[2,3].Icon'|'$board[3,3].Icon'|'$board[4,3].Icon'|'$board[5,3].Icon'|'$board[6,3].Icon'|'$board[7,3].Icon'| 4' + Write-Host ' --------------------------------- ' + Write-Host ' 3 |'$board[0,2].Icon'|'$board[1,2].Icon'|'$board[2,2].Icon'|'$board[3,2].Icon'|'$board[4,2].Icon'|'$board[5,2].Icon'|'$board[6,2].Icon'|'$board[7,2].Icon'| 3' + Write-Host ' --------------------------------- ' + Write-Host ' 2 |'$board[0,1].Icon'|'$board[1,1].Icon'|'$board[2,1].Icon'|'$board[3,1].Icon'|'$board[4,1].Icon'|'$board[5,1].Icon'|'$board[6,1].Icon'|'$board[7,1].Icon'| 2' + Write-Host ' --------------------------------- ' + Write-Host ' 1 |'$board[0,0].Icon'|'$board[1,0].Icon'|'$board[2,0].Icon'|'$board[3,0].Icon'|'$board[4,0].Icon'|'$board[5,0].Icon'|'$board[6,0].Icon'|'$board[7,0].Icon'| 1' + Write-Host ' --------------------------------- ' + Write-Host ' A B C D E F G H' +} + +#Read and clean text input before calling New-Move +Function Read-Input { + Write-Host "" + if($Script:whiteTurn) { + try { + [ValidateScript({$_.Length -eq 2 -or $_ -like '*resign*'})]$src = Read-Host 'White piece source' + if ($src -eq 'resign') { + $Script:gameStatus = [gamestatus]::blackWin + Update-Log -resign $true + } else { + [Int]$cc = Get-Column $src[0] + [Int]$cr = Get-Row $src[1] + [ValidateScript({$_.Color -eq 'White'})]$pc = $board[$cc, $cr] + [ValidateScript({$_.Length -eq 2})]$dst = Read-Host 'White piece destination' + New-Move $src $dst + } + } catch { + Write-Error "Illegal input: Not a white piece or valid location" + Write-Error $src + Read-Input + } + } else { + try { + [ValidateScript({$_.Length -eq 2 -or $_.Value -eq 'resign'})]$src = Read-Host 'Black piece source' + if ($src -like '*resign*') { + $Script:gameStatus = [gamestatus]::whiteWin + Update-Log -resign $true + } + [Int]$cc = Get-Column $src[0] + [Int]$cr = Get-Row $src[1] + [ValidateScript({$_.Color -eq 'Black'})]$pc = $board[$cc, $cr] + [ValidateScript({$_.Length -eq 2})]$dst = Read-Host 'Black piece destination' + New-Move $src $dst + } catch { + Write-Error "Illegal input: Not a black piece or valid location" + Read-Input + } + } +} + +#Update the status of all the pieces and place them +Function Update-Board { + #Get arrays of all piece that are still alive + [Array]$CurrentWhite = $Script:WhitePieces | Where-Object {$_.Alive -eq $true} + [Array]$CurrentBlack = $Script:BlackPieces | Where-Object {$_.Alive -eq $true} + + #Place all the white pieces + foreach ($pc in $CurrentWhite) { + $board[($pc.CurrentColumn),($pc.CurrentRow)] = $pc + } + #Place all the black pieces + foreach ($pc in $CurrentBlack) { + $board[($pc.CurrentColumn),($pc.CurrentRow)] = $pc + } + + #Check for spaces without a piece in them, then fill it with the empty placeholder. + for ($i = 0; $i -le 7; $i++) { + for ($j = 0; $j -le 7; $j++) { + if ($board[$i, $j] -eq $null) { + $board[$i, $j] = $Empty + } + } + } +} + +#Used to move pieces on the board +Function New-Move { + param ([string]$src, [string]$dst) + + enum castleOptions { + none = 0 + kingside = 1 + queenside = 2 + } + + [bool]$attack = $false + [bool]$moveSuccess = $false + [int]$castle = [castleOptions]::none + [bool]$promote = $false + [bool]$ep = $false + [bool]$check = $false + + try { + [Int]$CurrentColumn = Get-Column $src[0] + [Int]$CurrentRow = Get-Row $src[1] + [Int]$DesiredColumn = Get-Column $dst[0] + [Int]$DesiredRow = Get-Row $dst[1] + + $pc = $board[$CurrentColumn, $CurrentRow] + } catch { + Write-Error "Out of bounds" + Read-Input + } + + #Moving nothing, nowhere, or trying to capture your own piece + if ($board[$CurrentColumn, $CurrentRow] -eq $Empty) { + Write-Error "There is nothing there." + Read-Input + } elseif (($CurrentRow -eq $DesiredRow) -and ($CurrentColumn -eq $DesiredColumn)) { + Write-Error "That wouldn't move anywhere." + Read-Input + } elseif ($board[$DesiredColumn, $DesiredRow] -ne $Empty -and ` + $pc.Color -eq $board[$DesiredColumn, $DesiredRow].Color) { + Write-Error "Collision with own team" + Read-Input + } else { + [int]$MoveX = $DesiredColumn - $CurrentColumn + [int]$MoveY = $DesiredRow - $CurrentRow + + #Move verification logic for each piece + switch ($pc.GetType().Name) { + 'Pawn' { + $MoveX = [math]::abs($MoveX) + + #Pawns can max move one to the side when capturing, two forward when moving + if (($MoveX -gt 1) -or ([math]::abs($MoveY) -gt 2)) { + Write-Error "Illegal Pawn Move: Too many spaces" + } else { + #Force pawns to only move "forward" + if ($pc.Color -eq 'Black') { + $MoveY *= -1 + } + + if ($MoveX -eq 0) { + if ($board[$DesiredColumn, $DesiredRow] -eq $Empty) { + if ($MoveY -eq 1) { + $moveSuccess = $true + $pc.firstmove = $false + } elseif ($MoveY -eq 2 -and $pc.firstmove -eq $true) { + if ($board[$DesiredColumn, ($DesiredRow + 1)] -eq $Empty) { + $moveSuccess = $true + $pc.firstmove = $false + $pc.inpassing = $Script:turnCounter + } else { + Write-Error "Illegal Pawn Move: Blocked Path" + } + } else { + Write-Error "Illegal Pawn Move: Cannot Move 2 Spaces" + } + } else { + Write-Error "Illegal Pawn Move: Blocked Path" + } + } elseif (($MoveX -eq 1) -and ($MoveY -eq 1)) { + if ($board[$DesiredColumn, $DesiredRow] -eq $Empty) { + $enpassant = $board[$DesiredColumn, $CurrentRow] + if (($enpassant.GetType().Name -eq 'Pawn') -and ` + ($pc.Color -ne $enpassant.Color) -and ` + ($enpassant.inpassing -eq ($Script:turnCounter - 1))) { + + $moveSuccess = $true + $attack = $true + $ep = $true + + $enpassant.Alive = $false + $enpassant.CurrentPosition = $null + $enpassant.CurrentRow = $null + $enpassant.CurrentColumn = $null + $board[$DesiredColumn, $CurrentRow] = $Empty + } else { + Write-Error 'Illegal Pawn Move: Cannot Capture en passant' + } + } else { + $attack = $true + $moveSuccess = $true + $pc.firstmove = $false + } + } else { + #Catch-all, should never get here + Write-Error "Illegal Pawn Move" + } + } + } + + 'Knight' { + $MoveX = [math]::abs($MoveX) + $MoveY = [math]::abs($MoveY) + + if ((($MoveX -eq 1) -and ($MoveY -eq 2)) -or (($MoveX -eq 2) -and ($MoveY -eq 1))) { + $moveSuccess = $true + if ($board[$DesiredColumn, $DesiredRow] -ne $Empty) { + $attack = $true + } + } else { + Write-Error "Illegal Knight Move" + } + } + + 'Bishop' { + if ([math]::abs($MoveX) -ne [math]::abs($MoveY)) { + Write-Error "Illegal Bishop Move: Not a Diagonal" + } else { + if ($MoveX -gt 0) { + if ($MoveY -gt 0) { + for ($i = 1; $i -lt $MoveX; $i++) { + if ($board[($CurrentColumn + $i) , ($CurrentRow + $i)] -ne $Empty) { + Write-Error "Illegal Bishop Move: Blocked Path" + Read-Input + break + } + } + } else { + for ($i = 1; $i -lt $MoveX; $i++) { + if ($board[($CurrentColumn + $i) , ($CurrentRow - $i)] -ne $Empty) { + Write-Error "Illegal Bishop Move: Blocked Path" + Read-Input + break + } + } + } + } else { + if ($MoveY -gt 0) { + for ($i = 1; $i -lt $MoveY; $i++) { + if ($board[($CurrentColumn - $i) , ($CurrentRow + $i)] -ne $Empty) { + Write-Error "Illegal Bishop Move: Blocked Path" + Publish-Board + break + } + } + } else { + for ($i = 1; $i -lt [math]::abs($MoveX); $i++) { + if ($board[($CurrentColumn - $i) , ($CurrentRow - $i)] -ne $Empty) { + Write-Error "Illegal Bishop Move: Blocked Path" + Publish-Board + break + } + } + } + } + $moveSuccess = $true + if ($board[$DesiredColumn, $DesiredRow] -ne $Empty) { + $attack = $true + } + } + } + + 'Rook' { + if (([math]::abs($MoveX) -gt 0) -and ([math]::abs($MoveY) -gt 0)) { + Write-Error "Illegal Rook Move" + } else { + if ($MoveX -gt 0) { + for ($i = 1; $i -lt $MoveX; $i++) { + if ($board[($CurrentColumn + $i), $CurrentRow] -ne $Empty) { + Write-Error "Illegal Rook Move: Blocked Path" + Publish-Board + break + } + } + } elseif ($MoveX -lt 0) { + for ($i = 1; $i -lt [math]::abs($MoveX); $i++) { + if ($board[($CurrentColumn - $i), $CurrentRow] -ne $Empty) { + Write-Error "Illegal Rook Move: Blocked Path" + Publish-Board + break + } + } + } elseif ($MoveY -gt 0) { + for ($i = 1; $i -lt $MoveY; $i++) { + if ($board[$CurrentColumn, ($CurrentRow + $i)] -ne $Empty) { + Write-Error "Illegal Rook Move: Blocked Path" + Publish-Board + break + } + } + } else { + for ($i = 1; $i -lt [math]::abs($MoveY); $i++) { + if ($board[$CurrentColumn, ($CurrentRow - $i)] -ne $Empty) { + Write-Error "Illegal Rook Move: Blocked Path" + Publish-Board + break + } + } + } + $moveSuccess = $true + $pc.firstmove = $false + if ($board[$DesiredColumn, $DesiredRow] -ne $Empty) { + $attack = $true + } + } + } + + 'King' { + $MoveX = [math]::abs($MoveX) + $MoveY = [math]::abs($MoveY) + + if (($MoveX -eq 1) -or ($MoveY -eq 1)) { + $moveSuccess = $true + if ($board[$DesiredColumn, $DesiredRow] -ne $Empty) { + $attack = $true + } + } elseif (($pc.firstmove -eq $true) -and ` + ($pc.color -eq 'White')) { + if (($dst -eq 'G1') -and ` + ($wHR.firstmove -eq $true)) { + + $Crk = $board[7, 0] + $board[7, 0] = $Empty + $Crk.CurrentPosition = 'F1' + $Crk.CurrentRow = 0 + $Crk.CurrentColumn = 5 + $Crk.firstmove = $false + + $moveSuccess = $true + $castle = [castleOptions]::kingside + $pc.firstmove = $false + } elseif (($dst -eq 'C1') -and ` + ($wAR.firstmove -eq $true)) { + + $Crk = $board[0, 0] + $board[0, 0] = $Empty + $Crk.CurrentPosition = 'D1' + $Crk.CurrentRow = 0 + $Crk.CurrentColumn = 3 + $Crk.firstmove = $false + + $moveSuccess = $true + $castle = [castleOptions]::queenside + $pc.firstmove = $false + } + } elseif (($pc.firstmove -eq $true) -and ` + ($pc.color -eq 'Black')) { + if (($dst -eq 'G8') -and ` + ($bHR.firstmove -eq $true)) { + + $Crk = $board[7, 7] + $board[7, 7] = $Empty + $Crk.CurrentPosition = 'F8' + $Crk.CurrentRow = 7 + $Crk.CurrentColumn = 5 + $Crk.firstmove = $false + + $moveSuccess = $true + $castle = [castleOptions]::kingside + $pc.firstmove = $false + } elseif (($dst -eq 'C8') -and ` + ($bAR.firstmove -eq $true)) { + + $Crk = $board[0, 7] + $board[0, 7] = $Empty + $Crk.CurrentPosition = 'D8' + $Crk.CurrentRow = 7 + $Crk.CurrentColumn = 3 + $Crk.firstmove = $false + + $moveSuccess = $true + $castle = [castleOptions]::queenside + $pc.firstmove = $false + } + } else { + Write-Error "Illegal King Move" + } + } + + 'Queen' { + if ([math]::abs($MoveX) -eq [math]::abs($MoveY)) { + if ($MoveX -gt 0) { + if ($MoveY -gt 0) { + for ($i = 1; $i -lt $MoveX; $i++) { + if ($board[($CurrentColumn + $i) , ($CurrentRow + $i)] -ne $Empty) { + Write-Error "Illegal Queen Move" + Publish-Board + break + } + } + } else { + for ($i = 1; $i -lt $MoveX; $i++) { + if ($board[($CurrentColumn + $i) , ($CurrentRow - $i)] -ne $Empty) { + Write-Error "Illegal Queen Move" + Publish-Board + break + } + } + } + } else { + if ($MoveY -gt 0) { + for ($i = 1; $i -lt $MoveY; $i++) { + if ($board[($CurrentColumn - $i), ($CurrentRow + $i)] -ne $Empty) { + Write-Error "Illegal Queen Move" + Publish-Board + break + } + } + } else { + for ($i = 1; $i -lt [math]::abs($MoveX); $i++) { + if ($board[($CurrentColumn - $i) , ($CurrentRow - $i)] -ne $Empty) { + Write-Error "Illegal Queen Move" + Publish-Board + break + } + } + } + } + $moveSuccess = $true + if ($board[$DesiredColumn, $DesiredRow] -ne $Empty) { + $attack = $true + } + } elseif (($MoveX -ne 0 -and $MoveY -eq 0) -or ` + ($MoveX -eq 0 -and $MoveY -ne 0)) { + if ($MoveX -gt 0) { + for ($i = 1; $i -lt $MoveX; $i++) { + if ($board[($CurrentColumn + $i), $CurrentRow] -ne $Empty) { + Write-Error "Illegal Queen Move" + Publish-Board + break + } + } + } elseif ($MoveX -lt 0) { + for ($i = 1; $i -lt [math]::abs($MoveX); $i++) { + if ($board[($CurrentColumn - $i), $CurrentRow] -ne $Empty) { + Write-Error "Illegal Queen Move" + Publish-Board + break + } + } + } elseif ($MoveY -gt 0) { + for ($i = 1; $i -lt $MoveY; $i++) { + if ($board[$CurrentColumn, ($CurrentRow + $i)] -ne $Empty) { + Write-Error "Illegal Queen Move" + Publish-Board + break + } + } + } else { + for ($i = 1; $i -lt [math]::abs($MoveY); $i++) { + if ($board[$CurrentColumn, ($CurrentRow - $i)] -ne $Empty) { + Write-Error "Illegal Queen Move" + Publish-Board + break + } + } + } + $moveSuccess = $true + if ($board[$DesiredColumn, $DesiredRow] -ne $Empty) { + $attack = $true + } + } else { + Write-Error "Illegal Queen Move" + } + } + } + + if ($moveSuccess -eq $true) { + if ($attack -eq $true -and $ep -eq $false) { + $board[$DesiredColumn, $DesiredRow].Alive = $false + $board[$DesiredColumn, $DesiredRow].CurrentPosition = $null + $board[$DesiredColumn, $DesiredRow].CurrentRow = $null + $board[$DesiredColumn, $DesiredRow].CurrentColumn = $null + } + + #Pawn Promotion logic + if (($pc.GetType().Name -eq 'Pawn') -and ($DesiredRow -eq 0)) { + [ValidateSet('Knight', 'Bishop', 'Rook', 'Queen')]$ptype = Read-Host 'Promote black pawn to' + + $promote = $true + $pc.Type = $ptype + + switch ($ptype) { + 'Knight' { + $pc.Icon = 'β™ž' + $pc.Symbol = 'N' + } + 'Bishop' { + $pc.Icon = '♝' + $pc.Symbol = 'B' + } + 'Rook' { + $pc.Icon = 'β™œ' + $pc.Symbol = 'R' + } + 'Queen' { + $pc.Icon = 'β™›' + $pc.Symbol = 'Q' + } + } + } elseif (($pc.GetType().Name -eq 'Pawn') -and ($DesiredRow -eq 7)) { + [ValidateSet('Knight', 'Bishop', 'Rook', 'Queen')]$ptype = Read-Host 'Promote white pawn to' + + $promote = $true + $pc.Type = $ptype + + switch ($ptype) { + 'Knight' { + $pc.Icon = 'β™˜' + $pc.Symbol = 'N' + } + 'Bishop' { + $pc.Icon = 'β™—' + $pc.Symbol = 'B' + } + 'Rook' { + $pc.Icon = 'β™–' + $pc.Symbol = 'R' + } + 'Queen' { + $pc.Icon = 'β™•' + $pc.Symbol = 'Q' + } + } + } + + $board[$CurrentColumn, $CurrentRow] = $Empty + $pc.CurrentPosition = $dst.ToUpper() + $pc.CurrentRow = $DesiredRow + $pc.CurrentColumn = $DesiredColumn + + Update-Board + + #Check logic + #TODO: Shouldn't check when king is captured Issue 25 + Test-Gamestatus + if ($Script:gameStatus -eq [gamestatus]::ongoing) { + [Array]$curWhite = $Script:WhitePieces | Where-Object {$_.Alive -eq $true} + [Array]$curBlack = $Script:BlackPieces | Where-Object {$_.Alive -eq $true} + + if ($Script:whiteTurn -eq $true) { + foreach ($whitePiece in $curWhite) { + if ($(Test-Move $whitePiece.CurrentPosition $Script:bK.CurrentPosition)[0] -eq $true) { + $check = $true + } + } + } else { + foreach ($blackPiece in $curBlack) { + if ($(Test-Move $blackPiece.CurrentPosition $Script:wK.CurrentPosition)[0] -eq $true) { + $check = $true + } + } + } + } + + #Update the log, advance turn + Update-Log $src $dst $pc.Symbol $attack $castle $promote $ep $check + $Script:turnCounter += 1 + $Script:whiteTurn = !($Script:whiteTurn) + } else { + Read-Input + } + } +} + +#Log logic will go here +Function Update-Log { + param([string]$src, [string]$dst, [string]$piece, [bool]$attack, + [int]$castle, [bool]$promote, [bool]$ep, [bool]$check, [bool]$resign) + + [string]$logentry = '' + + enum castleOptions { + none = 0 + kingside = 1 + queenside = 2 + } + + if ($castle -eq [castleOptions]::kingside) { + $logentry = '0-0' + } elseif ($castle -eq [castleOptions]::queenside) { + $logentry = '0-0-0' + } elseif ($promote -eq $true) { + if ($attack) { + $logentry += 'x' + } + $logentry += $dst + '=' + $piece + } else { + $logentry = $piece + if ($attack) { + $logentry += 'x' + } + $logentry += $dst + } + + if ($ep -eq $true) { + $logentry += ' ep' + } + + if ($check -eq $true) { + $logentry += '+' + } + + if ($Script:gameStatus -ne 0) { + $logentry += '#' + } + + if ($resign -eq $true) { + $logentry = 'resigned' + } + + $Script:log += $logentry + + #Equivalent of touch command to ensure a log exists + Write-Output $null >> $Script:logpath + + #Clear and rewrite the log each time + Clear-Content $Script:logpath + $line = "White`t`tBlack`r`n--------------------" + + #Header + Add-Content -Encoding Unicode $Script:logpath $line + + if ($log.Length -eq 1) { + Add-Content -Encoding Unicode $Script:logpath $log[0] + } else { + for ($i = 0; $i -lt $log.Length - 1; $i += 2) { + $line = $Script:log[$i] + $line += " `t`t" + $line += $Script:log[$i + 1] + Add-Content -Encoding Unicode $Script:logpath $line + } + + #If game ended in white move, print out the "half-line" + if ($log.Length % 2 -eq 1) { + Add-Content -Encoding Unicode $Script:logpath $Script:log[$Script:log.Length - 1] + } + } +} + +#Try a move, used for check and castling logic +Function Test-Move { + param ([string]$src, [string]$dst) + + [bool]$attack = $false + [bool]$moveSuccess = $false + [bool[]]$status = @($moveSuccess, $attack) + + try { + [Int]$CurrentColumn = Get-Column $src[0] + [Int]$CurrentRow = Get-Row $src[1] + [Int]$DesiredColumn = Get-Column $dst[0] + [Int]$DesiredRow = Get-Row $dst[1] + + $pc = $board[$CurrentColumn, $CurrentRow] + } catch { + Write-Error "Out of bounds" + return $status + } + + #Moving nothing, nowhere, or trying to capture your own piece + if ($board[$CurrentColumn, $CurrentRow] -eq $Empty) { + Write-Error "There is nothing there." + return $status + } elseif (($CurrentRow -eq $DesiredRow) -and ($CurrentColumn -eq $DesiredColumn)) { + Write-Error "That wouldn't move anywhere." + return $status + } elseif ($board[$DesiredColumn, $DesiredRow] -ne $Empty -and ` + $pc.Color -eq $board[$DesiredColumn, $DesiredRow].Color) { + Write-Error "Collision with own team" + return $status + } else { + [int]$MoveX = $DesiredColumn - $CurrentColumn + [int]$MoveY = $DesiredRow - $CurrentRow + + #Pieces playable + switch ($pc.Type) { + 'Pawn' { + $MoveX = [math]::abs($MoveX) + if (($MoveX -gt 1) -or ([math]::abs($MoveY) -gt 2)) { + return $status + } else { + #Force pawns to only move "forward" + if ($pc.Color -eq 'Black') { + $MoveY *= -1 + } + if (($MoveX -eq 0) -and ($MoveY -eq 1)) { + if ($board[$DesiredColumn,$DesiredRow] -ne $Empty) { + return $status + } else { + $status[0] = $true + $pc.firstmove = $false + } + } elseif (($MoveX -eq 0) -and ($MoveY -eq 2)) { + if (($pc.firstmove = $true) -and ` + (($board[$DesiredColumn, $DesiredRow] -eq $Empty) -and ` + ($board[($DesiredColumn + 1), $DesiredRow] -eq $Empty))) { + + $status[0] = $true + $pc.firstmove = $false + $pc.inpassing = $Script:turnCounter + } else { + return $status + } + } elseif (($MoveX -eq 1) -and ($MoveY -eq 1)) { + if ($board[$DesiredColumn,$DesiredRow] -eq $Empty) { + $enpassant = $board[$DesiredColumn, $CurrentRow] + if (($enpassant.GetType().Name -eq 'Pawn') -and ` + ($pc.Color -ne $enpassant.Color) -and ` + ($enpassant.inpassing -eq ($Script:turnCounter - 1))) { + + $status[0] = $true + + $enpassant.Alive = $false + $enpassant.CurrentPosition = $null + $enpassant.CurrentRow = $null + $enpassant.CurrentColumn = $null + $board[$DesiredColumn, $CurrentRow] = $Empty + } else { + return $status + } + } else { + $status[1] = $true + $status[0] = $true + $pc.firstmove = $false + } + } else { + return $status + } + } + } + + 'Knight' { + $MoveX = [math]::abs($MoveX) + $MoveY = [math]::abs($MoveY) + + if ((($MoveX -eq 1) -and ($MoveY -eq 2)) -or (($MoveX -eq 2) -and ($MoveY -eq 1))) { + $status[0] = $true + if ($board[$DesiredColumn, $DesiredRow] -ne $Empty) { + $status[1] = $true + } + } else { + return $status + } + } + + 'Bishop' { + if ([math]::abs($MoveX) -ne [math]::abs($MoveY)) { + return $status + } else { + if ($MoveX -gt 0) { + if ($MoveY -gt 0) { + for ($i = 1; $i -lt $MoveX; $i++) { + if ($board[($CurrentColumn + $i) , ($CurrentRow + $i)] -ne $Empty) { + return $status + } + } + } else { + for ($i = 1; $i -lt $MoveX; $i++) { + if ($board[($CurrentColumn + $i) , ($CurrentRow - $i)] -ne $Empty) { + return $status + } + } + } + } else { + if ($MoveY -gt 0) { + for ($i = 1; $i -lt $MoveY; $i++) { + if ($board[($CurrentColumn - $i) , ($CurrentRow + $i)] -ne $Empty) { + return $status + } + } + } else { + for ($i = 1; $i -lt [math]::abs($MoveX); $i++) { + if ($board[($CurrentColumn - $i) , ($CurrentRow - $i)] -ne $Empty) { + return $status + } + } + } + } + $status[0] = $true + if ($board[$DesiredColumn, $DesiredRow] -ne $Empty) { + $status[1] = $true + } + } + } + + 'Rook' { + if (([math]::abs($MoveX) -gt 0) -and ([math]::abs($MoveY) -gt 0)) { + return $status + } else { + if ($MoveX -gt 0) { + for ($i = 1; $i -lt $MoveX; $i++) { + if ($board[($CurrentColumn + $i), $CurrentRow] -ne $Empty) { + return $status + } + } + } elseif ($MoveX -lt 0) { + for ($i = 1; $i -lt [math]::abs($MoveX); $i++) { + if ($board[($CurrentColumn - $i), $CurrentRow] -ne $Empty) { + return $status + } + } + } elseif ($MoveY -gt 0) { + for ($i = 1; $i -lt $MoveY; $i++) { + if ($board[$CurrentColumn, ($CurrentRow + $i)] -ne $Empty) { + return $status + } + } + } else { + for ($i = 1; $i -lt [math]::abs($MoveY); $i++) { + if ($board[$CurrentColumn, ($CurrentRow - $i)] -ne $Empty) { + return $status + } + } + } + $status[0] = $true + $pc.firstmove = $false + if ($board[$DesiredColumn, $DesiredRow] -ne $Empty) { + $status[1] = $true + } + } + } + + 'Queen' { + if ([math]::abs($MoveX) -eq [math]::abs($MoveY)) { + if ($MoveX -gt 0) { + if ($MoveY -gt 0) { + for ($i = 1; $i -lt $MoveX; $i++) { + if ($board[($CurrentColumn + $i) , ($CurrentRow + $i)] -ne $Empty) { + return $status + } + } + } else { + for ($i = 1; $i -lt $MoveX; $i++) { + if ($board[($CurrentColumn + $i) , ($CurrentRow - $i)] -ne $Empty) { + return $status + } + } + } + } else { + if ($MoveY -gt 0) { + for ($i = 1; $i -lt $MoveY; $i++) { + if ($board[($CurrentColumn - $i), ($CurrentRow + $i)] -ne $Empty) { + return $status + } + } + } else { + for ($i = 1; $i -lt [math]::abs($MoveX); $i++) { + if ($board[($CurrentColumn - $i) , ($CurrentRow - $i)] -ne $Empty) { + return $status + } + } + } + } + $status[0] = $true + if ($board[$DesiredColumn, $DesiredRow] -ne $Empty) { + $status[1] = $true + } + } elseif (($MoveX -ne 0 -and $MoveY -eq 0) -or ` + ($MoveX -eq 0 -and $MoveY -ne 0)) { + if ($MoveX -gt 0) { + for ($i = 1; $i -lt $MoveX; $i++) { + if ($board[($CurrentColumn + $i), $CurrentRow] -ne $Empty) { + return $status + } + } + } elseif ($MoveX -lt 0) { + for ($i = 1; $i -lt [math]::abs($MoveX); $i++) { + if ($board[($CurrentColumn - $i), $CurrentRow] -ne $Empty) { + return $status + } + } + } elseif ($MoveY -gt 0) { + for ($i = 1; $i -lt $MoveY; $i++) { + if ($board[$CurrentColumn, ($CurrentRow + $i)] -ne $Empty) { + return $status + } + } + } else { + for ($i = 1; $i -lt [math]::abs($MoveY); $i++) { + if ($board[$CurrentColumn, ($CurrentRow - $i)] -ne $Empty) { + return $status + } + } + } + $status[0] = $true + if ($board[$DesiredColumn, $DesiredRow] -ne $Empty) { + $status[1] = $true + } + } else { + return $status + } + } + + 'King' { + $MoveX = [math]::abs($MoveX) + $MoveY = [math]::abs($MoveY) + + if (($MoveX -le 1) -and ($MoveY -le 1)) { + $status[0] = $true + if ($board[$DesiredColumn, $DesiredRow] -ne $Empty) { + $status[1] = $true + } + } elseif (($pc.firstmove -eq $true) -and ` + ($pc.color -eq 'White')) { + if (($dst -eq 'G1') -and ` + ($wHR.firstmove -eq $true)) { + + $Crk = $board[7, 0] + $board[7, 0] = $Empty + $Crk.CurrentPosition = 'F1' + $Crk.CurrentRow = 0 + $Crk.CurrentColumn = 5 + $Crk.firstmove = $false + + $status[0] = $true + $pc.firstmove = $false + } elseif (($dst -eq 'C1') -and ` + ($wAR.firstmove -eq $true)) { + + $Crk = $board[0, 0] + $board[0, 0] = $Empty + $Crk.CurrentPosition = 'D1' + $Crk.CurrentRow = 0 + $Crk.CurrentColumn = 3 + $Crk.firstmove = $false + + $status[0] = $true + $pc.firstmove = $false + } + } elseif (($pc.firstmove -eq $true) -and ` + ($pc.color -eq 'Black')) { + if (($dst -eq 'G8') -and ` + ($bHR.firstmove -eq $true)) { + + $Crk = $board[7, 7] + $board[7, 7] = $Empty + $Crk.CurrentPosition = 'F8' + $Crk.CurrentRow = 7 + $Crk.CurrentColumn = 5 + $Crk.firstmove = $false + + $status[0] = $true + $pc.firstmove = $false + } elseif (($dst -eq 'C8') -and ` + ($bAR.firstmove -eq $true)) { + + $Crk = $board[0, 7] + $board[0, 7] = $Empty + $Crk.CurrentPosition = 'D8' + $Crk.CurrentRow = 7 + $Crk.CurrentColumn = 3 + $Crk.firstmove = $false + + $status[0] = $true + $pc.firstmove = $false + } + } else { + return $status + } + } + } + + return $status + } +} + +#Figure out if the game is over or still ongoing +Function Test-Gamestatus { + if ($wK.Alive -eq $false) { + $Script:gameStatus = [gamestatus]::blackWin + } elseif ($bK.Alive -eq $false) { + $Script:gameStatus = [gamestatus]::whiteWin + } +} + +Function Get-Column { + param ([ValidatePattern('[A-H]')][string]$Col) + switch ($Col) { + "A" {Return "0"} + "B" {Return "1"} + "C" {Return "2"} + "D" {Return "3"} + "E" {Return "4"} + "F" {Return "5"} + "G" {Return "6"} + "H" {Return "7"} + } +} + +Function Get-Row { + param ([ValidateRange(1,8)][string]$row) + + return ($row - 1) +} + +########################### +#endregion: Functions +#################################################### + + +#################################################### +#region: Classes +########################### + +#Gives all classes that inherit(:) this class the base properties +Class ChessPiece { + [bool]$Alive=$true + [string]$Type + [string]$Icon + [string]$Symbol + [ValidateSet('White', 'Black')][String]$Color + [String]$CurrentPosition + [ValidateRange(0,7)][Int]$CurrentRow + [ValidateRange(0,7)][Int]$CurrentColumn +} + +Class Pawn : ChessPiece { + [bool]$firstmove = $true + [int]$inpassing = 0 + [string]$Type = $this.GetType().Name + [string]$Symbol = " " + Pawn([string]$Position, [string]$color) { + $this.Color = $color + $this.CurrentPosition = $Position + $this.CurrentRow = Get-Row $Position[1] + $this.CurrentColumn = Get-Column $Position[0] + + if ($color -eq 'White') { + $this.Icon = 'β™™' + } elseif ($color -eq 'Black') { + $this.Icon = 'β™Ÿ' + } + } +} + +Class Rook : ChessPiece { + [bool]$firstmove = $true + [string]$Type = $this.GetType().Name + [string]$Symbol = "R" + Rook([string]$Position, [string]$color) { + $this.Color = $color + $this.CurrentPosition = $Position + $this.CurrentRow = Get-Row $Position[1] + $this.CurrentColumn = Get-Column $Position[0] + + if ($color -eq 'White') { + $this.Icon = 'β™–' + } elseif ($color -eq 'Black') { + $this.Icon = 'β™œ' + } + } +} + +Class Knight : ChessPiece { + [string]$Type = $this.GetType().Name + [string]$Symbol = "N" + Knight([string]$Position, [string]$color) { + $this.Color = $color + $this.CurrentPosition = $Position + $this.CurrentRow = Get-Row $Position[1] + $this.CurrentColumn = Get-Column $Position[0] + + if ($color -eq 'White') { + $this.Icon = 'β™˜' + } elseif ($color -eq 'Black') { + $this.Icon = 'β™ž' + } + } +} + +Class Bishop : ChessPiece { + [string]$Type = $this.GetType().Name + [string]$Symbol = "B" + Bishop([String]$Position, [string]$color) { + $this.Color = $color + $this.CurrentPosition = $Position + $this.CurrentRow = Get-Row $Position[1] + $this.CurrentColumn = Get-Column $Position[0] + + if ($color -eq 'White') { + $this.Icon = 'β™—' + } elseif ($color -eq 'Black') { + $this.Icon = '♝' + } + } +} + +Class Queen : ChessPiece { + [string]$Type = $this.GetType().Name + [string]$Symbol = "Q" + Queen([String]$Position, [string]$color) { + $this.Color = $color + $this.CurrentPosition = $Position + $this.CurrentRow = Get-Row $Position[1] + $this.CurrentColumn = Get-Column $Position[0] + + if ($color -eq 'White') { + $this.Icon = 'β™•' + } elseif ($color -eq 'Black') { + $this.Icon = 'β™›' + } + } +} + +Class King : ChessPiece { + [bool]$firstmove = $true + [string]$Type = $this.GetType().Name + [string]$Symbol = "K" + King([String]$Position, [string]$color) { + $this.Color = $color + $this.CurrentPosition = $Position + $this.CurrentRow = Get-Row $Position[1] + $this.CurrentColumn = Get-Column $Position[0] + + if ($color -eq 'White') { + $this.Icon = 'β™”' + } elseif ($color -eq 'Black') { + $this.Icon = 'β™š' + } + } +} + +Class Blank { + [String]$Icon=' ' +} + +########################### +#endregion: Classes +#################################################### + +#Creates the game board +[Object]$Script:board = New-Object 'object[,]' 8,8 + +#Creates a turn status +[bool]$Script:whiteTurn = $true + +#SAN log.txt path, currently on desktop +$DesktopPath = [Environment]::GetFolderPath("Desktop") +[string]$Script:logpath = $DesktopPath + '\log.txt' +[string[]]$Script:log = @() + +$Script:wAP = [Pawn]::New('A2', 'White') +$Script:wBP = [Pawn]::New('B2', 'White') +$Script:wCP = [Pawn]::New('C2', 'White') +$Script:wDP = [Pawn]::New('D2', 'White') +$Script:wEP = [Pawn]::New('E2', 'White') +$Script:wFP = [Pawn]::New('F2', 'White') +$Script:wGP = [Pawn]::New('G2', 'White') +$Script:wHP = [Pawn]::New('H2', 'White') +$Script:wAR = [Rook]::New('A1', 'White') +$Script:wBN = [Knight]::New('B1', 'White') +$Script:wCB = [Bishop]::New('C1', 'White') +$Script:wQ = [Queen]::New('D1', 'White') +$Script:wK = [King]::New('E1', 'White') +$Script:wFB = [Bishop]::New('F1', 'White') +$Script:wGN = [Knight]::New('G1', 'White') +$Script:wHR = [Rook]::New('H1', 'White') + +$Script:bAP = [Pawn]::New('A7', 'Black') +$Script:bBP = [Pawn]::New('B7', 'Black') +$Script:bCP = [Pawn]::New('C7', 'Black') +$Script:bDP = [Pawn]::New('D7', 'Black') +$Script:bEP = [Pawn]::New('E7', 'Black') +$Script:bFP = [Pawn]::New('F7', 'Black') +$Script:bGP = [Pawn]::New('G7', 'Black') +$Script:bHP = [Pawn]::New('H7', 'Black') +$Script:bAR = [Rook]::New('A8', 'Black') +$Script:bBN = [Knight]::New('B8', 'Black') +$Script:bCB = [Bishop]::New('C8', 'Black') +$Script:bQ = [Queen]::New('D8', 'Black') +$Script:bK = [King]::New('E8', 'Black') +$Script:bFB = [Bishop]::New('F8', 'Black') +$Script:bGN = [Knight]::New('G8', 'Black') +$Script:bHR = [Rook]::New('H8', 'Black') + +$Script:Empty = [Blank]::New() + +[Array] $Script:WhitePieces = @( + $Script:wAP,$Script:wBP,$Script:wCP,$Script:wDP, + $Script:wEP,$Script:wFP,$Script:wGP,$Script:wHP, + $Script:wAR,$Script:wHR,$Script:wBN,$Script:wGN, + $Script:wCB,$Script:wFB,$Script:wQ,$Script:wK +) + +[Array] $Script:BlackPieces = @( + $Script:bAP,$Script:bBP,$Script:bCP,$Script:bDP, + $Script:bEP,$Script:bFP,$Script:bGP,$Script:bHP, + $Script:bAR,$Script:bHR,$Script:bBN,$Script:bGN, + $Script:bCB,$Script:bFB,$Script:bQ,$Script:bK +) + +enum gamestatus { + ongoing = 0 + whiteWin = 1 + blackWin = 2 + quit = 3 +} + +#Set global variables to keep track of turn and game status +[int]$Script:turnCounter = 0 +$Script:gameStatus = [gamestatus]::ongoing + +while ($Script:gameStatus -eq [gamestatus]::ongoing) { + Update-Board + Publish-Board + Read-Input + + if ($Script:gameStatus -eq [gamestatus]::blackWin) { + Write-Output "Black Wins!" + } elseif ($Script:gameStatus -eq [gamestatus]::whiteWin) { + Write-Output "White Wins!" + } elseif ($Script:gameStatus -eq [gamestatus]::quit) { + Write-Output "Game ended by request." + } +} +``` + +*(generated by convert-ps2md.ps1 using the comment-based help of play-chess.ps1 as of 11/08/2024 12:34:54)* diff --git a/docs/play-cow-sound.md b/docs/play-cow-sound.md index cbcfde66..9156bb8b 100644 --- a/docs/play-cow-sound.md +++ b/docs/play-cow-sound.md @@ -6,7 +6,7 @@ This PowerShell script plays a cow sound. Parameters ---------- ```powershell -PS> ./play-cow-sound.ps1 [] +/home/markus/Repos/PowerShell/scripts/play-cow-sound.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of play-cow-sound.ps1 as of 08/15/2024 09:50:52)* +*(generated by convert-ps2md.ps1 using the comment-based help of play-cow-sound.ps1 as of 11/08/2024 12:34:54)* diff --git a/docs/play-dog-sound.md b/docs/play-dog-sound.md index 1c8bf93b..d6e6423d 100644 --- a/docs/play-dog-sound.md +++ b/docs/play-dog-sound.md @@ -6,7 +6,7 @@ This PowerShell script plays a dog sound. Parameters ---------- ```powershell -PS> ./play-dog-sound.ps1 [] +/home/markus/Repos/PowerShell/scripts/play-dog-sound.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of play-dog-sound.ps1 as of 08/15/2024 09:50:52)* +*(generated by convert-ps2md.ps1 using the comment-based help of play-dog-sound.ps1 as of 11/08/2024 12:34:54)* diff --git a/docs/play-donkey-sound.md b/docs/play-donkey-sound.md index c1a8b9cd..773d5a50 100644 --- a/docs/play-donkey-sound.md +++ b/docs/play-donkey-sound.md @@ -6,7 +6,7 @@ This PowerShell script plays a donkey sound. Parameters ---------- ```powershell -PS> ./play-donkey-sound.ps1 [] +/home/markus/Repos/PowerShell/scripts/play-donkey-sound.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of play-donkey-sound.ps1 as of 08/15/2024 09:50:52)* +*(generated by convert-ps2md.ps1 using the comment-based help of play-donkey-sound.ps1 as of 11/08/2024 12:34:54)* diff --git a/docs/play-elephant-sound.md b/docs/play-elephant-sound.md index c704cfaa..ccf0ee22 100644 --- a/docs/play-elephant-sound.md +++ b/docs/play-elephant-sound.md @@ -6,7 +6,7 @@ This PowerShell script plays an elephant sound. Parameters ---------- ```powershell -PS> ./play-elephant-sound.ps1 [] +/home/markus/Repos/PowerShell/scripts/play-elephant-sound.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of play-elephant-sound.ps1 as of 08/15/2024 09:50:52)* +*(generated by convert-ps2md.ps1 using the comment-based help of play-elephant-sound.ps1 as of 11/08/2024 12:34:54)* diff --git a/docs/play-elk-sound.md b/docs/play-elk-sound.md index 6b53eb06..75bf6363 100644 --- a/docs/play-elk-sound.md +++ b/docs/play-elk-sound.md @@ -6,7 +6,7 @@ This PowerShell script plays an elk sound. Parameters ---------- ```powershell -PS> ./play-elk-sound.ps1 [] +/home/markus/Repos/PowerShell/scripts/play-elk-sound.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of play-elk-sound.ps1 as of 08/15/2024 09:50:52)* +*(generated by convert-ps2md.ps1 using the comment-based help of play-elk-sound.ps1 as of 11/08/2024 12:34:54)* diff --git a/docs/play-files.md b/docs/play-files.md index 8a591ffe..15a9cd96 100644 --- a/docs/play-files.md +++ b/docs/play-files.md @@ -6,7 +6,7 @@ This PowerShell script plays the given audio files (supporting MP3 and WAV forma Parameters ---------- ```powershell -PS> ./play-files.ps1 [[-FilePattern] ] [] +/home/markus/Repos/PowerShell/scripts/play-files.ps1 [[-FilePattern] ] [] -FilePattern Specifies the file pattern @@ -76,4 +76,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of play-files.ps1 as of 08/15/2024 09:50:52)* +*(generated by convert-ps2md.ps1 using the comment-based help of play-files.ps1 as of 11/08/2024 12:34:54)* diff --git a/docs/play-frog-sound.md b/docs/play-frog-sound.md index 96e9c53a..1d088f8a 100644 --- a/docs/play-frog-sound.md +++ b/docs/play-frog-sound.md @@ -6,7 +6,7 @@ This PowerShell script plays a frog sound. Parameters ---------- ```powershell -PS> ./play-frog-sound.ps1 [] +/home/markus/Repos/PowerShell/scripts/play-frog-sound.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of play-frog-sound.ps1 as of 08/15/2024 09:50:52)* +*(generated by convert-ps2md.ps1 using the comment-based help of play-frog-sound.ps1 as of 11/08/2024 12:34:54)* diff --git a/docs/play-goat-sound.md b/docs/play-goat-sound.md index 9d2440b8..a40f1ff4 100644 --- a/docs/play-goat-sound.md +++ b/docs/play-goat-sound.md @@ -6,7 +6,7 @@ This PowerShell script plays a goat sound. Parameters ---------- ```powershell -PS> ./play-goat-sound.ps1 [] +/home/markus/Repos/PowerShell/scripts/play-goat-sound.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of play-goat-sound.ps1 as of 08/15/2024 09:50:52)* +*(generated by convert-ps2md.ps1 using the comment-based help of play-goat-sound.ps1 as of 11/08/2024 12:34:54)* diff --git a/docs/play-gorilla-sound.md b/docs/play-gorilla-sound.md index b0038f3b..62d895b6 100644 --- a/docs/play-gorilla-sound.md +++ b/docs/play-gorilla-sound.md @@ -6,7 +6,7 @@ This PowerShell script plays a gorilla sound. Parameters ---------- ```powershell -PS> ./play-gorilla-sound.ps1 [] +/home/markus/Repos/PowerShell/scripts/play-gorilla-sound.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of play-gorilla-sound.ps1 as of 08/15/2024 09:50:52)* +*(generated by convert-ps2md.ps1 using the comment-based help of play-gorilla-sound.ps1 as of 11/08/2024 12:34:54)* diff --git a/docs/play-happy-birthday.md b/docs/play-happy-birthday.md index 816dd567..f19be469 100644 --- a/docs/play-happy-birthday.md +++ b/docs/play-happy-birthday.md @@ -6,7 +6,7 @@ This PowerShell script plays the famous Happy Birthday song. Parameters ---------- ```powershell -PS> ./play-happy-birthday.ps1 [] +/home/markus/Repos/PowerShell/scripts/play-happy-birthday.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -79,4 +79,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of play-happy-birthday.ps1 as of 08/15/2024 09:50:52)* +*(generated by convert-ps2md.ps1 using the comment-based help of play-happy-birthday.ps1 as of 11/08/2024 12:34:54)* diff --git a/docs/play-horse-sound.md b/docs/play-horse-sound.md index 317f0983..077360e9 100644 --- a/docs/play-horse-sound.md +++ b/docs/play-horse-sound.md @@ -6,7 +6,7 @@ This PowerShell script plays a horse sound. Parameters ---------- ```powershell -PS> ./play-horse-sound.ps1 [] +/home/markus/Repos/PowerShell/scripts/play-horse-sound.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of play-horse-sound.ps1 as of 08/15/2024 09:50:52)* +*(generated by convert-ps2md.ps1 using the comment-based help of play-horse-sound.ps1 as of 11/08/2024 12:34:54)* diff --git a/docs/play-imperial-march.md b/docs/play-imperial-march.md index d4fedaa7..1543db40 100644 --- a/docs/play-imperial-march.md +++ b/docs/play-imperial-march.md @@ -6,7 +6,7 @@ This PowerShell script plays the Imperial March used in the Star Wars film serie Parameters ---------- ```powershell -PS> ./play-imperial-march.ps1 [] +/home/markus/Repos/PowerShell/scripts/play-imperial-march.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -72,4 +72,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of play-imperial-march.ps1 as of 08/15/2024 09:50:52)* +*(generated by convert-ps2md.ps1 using the comment-based help of play-imperial-march.ps1 as of 11/08/2024 12:34:54)* diff --git a/docs/play-jingle-bells.md b/docs/play-jingle-bells.md index 02c187ed..f0220dcc 100644 --- a/docs/play-jingle-bells.md +++ b/docs/play-jingle-bells.md @@ -6,7 +6,7 @@ This PowerShell script plays the famous Jingle Bells song. Parameters ---------- ```powershell -PS> ./play-jingle-bells.ps1 [] +/home/markus/Repos/PowerShell/scripts/play-jingle-bells.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -201,4 +201,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of play-jingle-bells.ps1 as of 08/15/2024 09:50:52)* +*(generated by convert-ps2md.ps1 using the comment-based help of play-jingle-bells.ps1 as of 11/08/2024 12:34:54)* diff --git a/docs/play-lion-sound.md b/docs/play-lion-sound.md index 958e94a1..dc0a4fee 100644 --- a/docs/play-lion-sound.md +++ b/docs/play-lion-sound.md @@ -6,7 +6,7 @@ This PowerShell script plays a lion sound. Parameters ---------- ```powershell -PS> ./play-lion-sound.ps1 [] +/home/markus/Repos/PowerShell/scripts/play-lion-sound.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of play-lion-sound.ps1 as of 08/15/2024 09:50:52)* +*(generated by convert-ps2md.ps1 using the comment-based help of play-lion-sound.ps1 as of 11/08/2024 12:34:54)* diff --git a/docs/play-m3u.md b/docs/play-m3u.md index e8c0c1a7..5cfb4f86 100644 --- a/docs/play-m3u.md +++ b/docs/play-m3u.md @@ -6,7 +6,7 @@ This PowerShell script plays the given playlist (in .M3U file format) Parameters ---------- ```powershell -PS> ./play-m3u.ps1 [[-filename] ] [] +/home/markus/Repos/PowerShell/scripts/play-m3u.ps1 [[-filename] ] [] -filename Specifies the path to the playlist @@ -92,4 +92,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of play-m3u.ps1 as of 08/15/2024 09:50:53)* +*(generated by convert-ps2md.ps1 using the comment-based help of play-m3u.ps1 as of 11/08/2024 12:34:54)* diff --git a/docs/play-mission-impossible.md b/docs/play-mission-impossible.md index e9316013..ede80e1d 100644 --- a/docs/play-mission-impossible.md +++ b/docs/play-mission-impossible.md @@ -6,7 +6,7 @@ This PowerShell script plays the Mission Impossible theme. Parameters ---------- ```powershell -PS> ./play-mission-impossible.ps1 [] +/home/markus/Repos/PowerShell/scripts/play-mission-impossible.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -100,4 +100,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of play-mission-impossible.ps1 as of 08/15/2024 09:50:53)* +*(generated by convert-ps2md.ps1 using the comment-based help of play-mission-impossible.ps1 as of 11/08/2024 12:34:54)* diff --git a/docs/play-mp3.md b/docs/play-mp3.md index f23b024b..b111e685 100644 --- a/docs/play-mp3.md +++ b/docs/play-mp3.md @@ -6,7 +6,7 @@ This PowerShell script plays the given sound file (MPEG-1 audio layer-3 file for Parameters ---------- ```powershell -PS> ./play-mp3.ps1 [[-path] ] [] +/home/markus/Repos/PowerShell/scripts/play-mp3.ps1 [[-path] ] [] -path Specifies the file path to the .MP3 file @@ -93,4 +93,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of play-mp3.ps1 as of 08/15/2024 09:50:53)* +*(generated by convert-ps2md.ps1 using the comment-based help of play-mp3.ps1 as of 11/08/2024 12:34:54)* diff --git a/docs/play-parrot-sound.md b/docs/play-parrot-sound.md index eb608fd2..8d0f0e7c 100644 --- a/docs/play-parrot-sound.md +++ b/docs/play-parrot-sound.md @@ -6,7 +6,7 @@ This PowerShell script plays a parrot sound. Parameters ---------- ```powershell -PS> ./play-parrot-sound.ps1 [] +/home/markus/Repos/PowerShell/scripts/play-parrot-sound.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of play-parrot-sound.ps1 as of 08/15/2024 09:50:53)* +*(generated by convert-ps2md.ps1 using the comment-based help of play-parrot-sound.ps1 as of 11/08/2024 12:34:54)* diff --git a/docs/play-pig-sound.md b/docs/play-pig-sound.md index 5de1f69d..2bf3ebf3 100644 --- a/docs/play-pig-sound.md +++ b/docs/play-pig-sound.md @@ -6,7 +6,7 @@ This PowerShell script plays a pig sound. Parameters ---------- ```powershell -PS> ./play-pig-sound.ps1 [] +/home/markus/Repos/PowerShell/scripts/play-pig-sound.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of play-pig-sound.ps1 as of 08/15/2024 09:50:53)* +*(generated by convert-ps2md.ps1 using the comment-based help of play-pig-sound.ps1 as of 11/08/2024 12:34:54)* diff --git a/docs/play-pong.md b/docs/play-pong.md index cbf70b2e..5fd160b5 100644 --- a/docs/play-pong.md +++ b/docs/play-pong.md @@ -176,4 +176,4 @@ while ($true) { exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of play-pong.ps1 as of 08/15/2024 09:50:53)* +*(generated by convert-ps2md.ps1 using the comment-based help of play-pong.ps1 as of 11/08/2024 12:34:54)* diff --git a/docs/play-rattlesnake-sound.md b/docs/play-rattlesnake-sound.md index c4f59e91..f9710f35 100644 --- a/docs/play-rattlesnake-sound.md +++ b/docs/play-rattlesnake-sound.md @@ -6,7 +6,7 @@ This PowerShell script plays a rattlesnake sound. Parameters ---------- ```powershell -PS> ./play-rattlesnake-sound.ps1 [] +/home/markus/Repos/PowerShell/scripts/play-rattlesnake-sound.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of play-rattlesnake-sound.ps1 as of 08/15/2024 09:50:53)* +*(generated by convert-ps2md.ps1 using the comment-based help of play-rattlesnake-sound.ps1 as of 11/08/2024 12:34:54)* diff --git a/docs/play-rick.md b/docs/play-rick.md index 885e0b4b..1058c879 100644 --- a/docs/play-rick.md +++ b/docs/play-rick.md @@ -6,7 +6,7 @@ This PowerShell script launches the Web browser with YouTube playing Rick Astley Parameters ---------- ```powershell -PS> ./play-rick.ps1 [] +/home/markus/Repos/PowerShell/scripts/play-rick.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -49,4 +49,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of play-rick.ps1 as of 08/15/2024 09:50:53)* +*(generated by convert-ps2md.ps1 using the comment-based help of play-rick.ps1 as of 11/08/2024 12:34:54)* diff --git a/docs/play-snake.md b/docs/play-snake.md index 1e3ac030..786df1b6 100644 --- a/docs/play-snake.md +++ b/docs/play-snake.md @@ -7,7 +7,7 @@ NOTE: use the arrow keys to control the snake Parameters ---------- ```powershell -PS> ./play-snake.ps1 [] +/home/markus/Repos/PowerShell/scripts/play-snake.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -86,4 +86,4 @@ Start-Sleep -milliseconds 300 exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of play-snake.ps1 as of 08/15/2024 09:50:53)* +*(generated by convert-ps2md.ps1 using the comment-based help of play-snake.ps1 as of 11/08/2024 12:34:54)* diff --git a/docs/play-super-mario.md b/docs/play-super-mario.md index 80bf5737..0ef5d1e9 100644 --- a/docs/play-super-mario.md +++ b/docs/play-super-mario.md @@ -6,7 +6,7 @@ This PowerShell script plays the Super Mario intro. Parameters ---------- ```powershell -PS> ./play-super-mario.ps1 [] +/home/markus/Repos/PowerShell/scripts/play-super-mario.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -71,4 +71,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of play-super-mario.ps1 as of 08/15/2024 09:50:53)* +*(generated by convert-ps2md.ps1 using the comment-based help of play-super-mario.ps1 as of 11/08/2024 12:34:54)* diff --git a/docs/play-system-sounds.md b/docs/play-system-sounds.md index 36eb1ab8..5e4cf225 100644 --- a/docs/play-system-sounds.md +++ b/docs/play-system-sounds.md @@ -55,4 +55,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of play-system-sounds.ps1 as of 08/15/2024 09:50:53)* +*(generated by convert-ps2md.ps1 using the comment-based help of play-system-sounds.ps1 as of 11/08/2024 12:34:54)* diff --git a/docs/play-tetris-melody.md b/docs/play-tetris-melody.md index 8276ec77..5b8e1009 100644 --- a/docs/play-tetris-melody.md +++ b/docs/play-tetris-melody.md @@ -6,7 +6,7 @@ This PowerShell script plays the Tetris melody. Parameters ---------- ```powershell -PS> ./play-tetris-melody.ps1 [] +/home/markus/Repos/PowerShell/scripts/play-tetris-melody.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -161,4 +161,4 @@ Start-Sleep -milliseconds 500 exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of play-tetris-melody.ps1 as of 08/15/2024 09:50:53)* +*(generated by convert-ps2md.ps1 using the comment-based help of play-tetris-melody.ps1 as of 11/08/2024 12:34:54)* diff --git a/docs/play-vulture-sound.md b/docs/play-vulture-sound.md index c89114ab..07afede2 100644 --- a/docs/play-vulture-sound.md +++ b/docs/play-vulture-sound.md @@ -6,7 +6,7 @@ This PowerShell script plays a vulture sound. Parameters ---------- ```powershell -PS> ./play-vulture-sound.ps1 [] +/home/markus/Repos/PowerShell/scripts/play-vulture-sound.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of play-vulture-sound.ps1 as of 08/15/2024 09:50:53)* +*(generated by convert-ps2md.ps1 using the comment-based help of play-vulture-sound.ps1 as of 11/08/2024 12:34:54)* diff --git a/docs/play-wolf-sound.md b/docs/play-wolf-sound.md index bf4ba165..e2f87936 100644 --- a/docs/play-wolf-sound.md +++ b/docs/play-wolf-sound.md @@ -6,7 +6,7 @@ This PowerShell script plays a wolf sound. Parameters ---------- ```powershell -PS> ./play-wolf-sound.ps1 [] +/home/markus/Repos/PowerShell/scripts/play-wolf-sound.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of play-wolf-sound.ps1 as of 08/15/2024 09:50:53)* +*(generated by convert-ps2md.ps1 using the comment-based help of play-wolf-sound.ps1 as of 11/08/2024 12:34:54)* diff --git a/docs/poweroff.md b/docs/poweroff.md index 6eae73bd..ff80d1a4 100644 --- a/docs/poweroff.md +++ b/docs/poweroff.md @@ -6,7 +6,7 @@ This script halts the local computer immediately (needs admin rights). Parameters ---------- ```powershell -PS> ./poweroff.ps1 [] +/home/markus/Repos/PowerShell/scripts/poweroff.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -59,4 +59,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of poweroff.ps1 as of 08/15/2024 09:50:53)* +*(generated by convert-ps2md.ps1 using the comment-based help of poweroff.ps1 as of 11/08/2024 12:34:54)* diff --git a/docs/print-image.md b/docs/print-image.md index 546df36b..cb782f19 100644 --- a/docs/print-image.md +++ b/docs/print-image.md @@ -6,7 +6,7 @@ This PowerShell script shows the printer dialogue to print the given image file. Parameters ---------- ```powershell -PS> ./print-image.ps1 [[-Path] ] [] +/home/markus/Repos/PowerShell/scripts/print-image.ps1 [[-Path] ] [] -Path Specifies the path to the image file @@ -69,4 +69,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of print-image.ps1 as of 08/15/2024 09:50:53)* +*(generated by convert-ps2md.ps1 using the comment-based help of print-image.ps1 as of 11/08/2024 12:34:54)* diff --git a/docs/publish-to-ipfs.md b/docs/publish-to-ipfs.md index cbd6dd6e..923b027c 100644 --- a/docs/publish-to-ipfs.md +++ b/docs/publish-to-ipfs.md @@ -6,7 +6,7 @@ This script publishes the given files and folders to IPFS. Parameters ---------- ```powershell -PS> ./publish-to-ipfs.ps1 [[-FilePattern] ] [[-HashList] ] [[-DF_Hashes] ] [] +/home/markus/Repos/PowerShell/scripts/publish-to-ipfs.ps1 [[-FilePattern] ] [[-HashList] ] [[-DF_Hashes] ] [] -FilePattern Specifies the file pattern @@ -110,7 +110,7 @@ try { } [int]$Elapsed = $StopWatch.Elapsed.TotalSeconds - "βœ”οΈ published $Count file(s)/folder(s) to IPFS in $Elapsed sec" + "βœ… published $Count file(s)/folder(s) to IPFS in $Elapsed sec" " NOTE: to publish it to IPNS execute: ipfs name publish " exit 0 # success } catch { @@ -119,4 +119,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of publish-to-ipfs.ps1 as of 08/15/2024 09:50:53)* +*(generated by convert-ps2md.ps1 using the comment-based help of publish-to-ipfs.ps1 as of 11/08/2024 12:34:54)* diff --git a/docs/pull-repo.md b/docs/pull-repo.md index 4ada390e..a9a86a59 100644 --- a/docs/pull-repo.md +++ b/docs/pull-repo.md @@ -6,7 +6,7 @@ This PowerShell script pulls remote updates into a local Git repository (includi Parameters ---------- ```powershell -PS> ./pull-repo.ps1 [[-pathToRepo] ] [] +/home/markus/Repos/PowerShell/scripts/pull-repo.ps1 [[-pathToRepo] ] [] -pathToRepo Specifies the file path to the local Git repository (default is working directory) @@ -30,7 +30,7 @@ PS> ./pull-repo.ps1 ⏳ (2/4) Checking local repository... C:\Repos\rust ⏳ (3/4) Pulling remote updates... ⏳ (4/4) Updating submodules... -βœ”οΈ Updates pulled into πŸ“‚rust repo in 14s. +βœ… Updates pulled into πŸ“‚rust repo in 14s. ``` @@ -58,7 +58,7 @@ Script Content ⏳ (2/4) Checking local repository... C:\Repos\rust ⏳ (3/4) Pulling remote updates... ⏳ (4/4) Updating submodules... - βœ”οΈ Updates pulled into πŸ“‚rust repo in 14s. + βœ… Updates pulled into πŸ“‚rust repo in 14s. .LINK https://github.com/fleschutz/PowerShell .NOTES @@ -92,7 +92,7 @@ try { if ($lastExitCode -ne "0") { throw "'git submodule update' failed with exit code $lastExitCode" } [int]$elapsed = $stopWatch.Elapsed.TotalSeconds - "βœ”οΈ Updates pulled into πŸ“‚$pathToRepoName repo in $($elapsed)s." + "βœ… Updates pulled into πŸ“‚$pathToRepoName repo in $($elapsed)s." exit 0 # success } catch { "⚠️ Error: $($Error[0]) in script line $($_.InvocationInfo.ScriptLineNumber)" @@ -100,4 +100,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of pull-repo.ps1 as of 08/15/2024 09:50:53)* +*(generated by convert-ps2md.ps1 using the comment-based help of pull-repo.ps1 as of 11/08/2024 12:34:54)* diff --git a/docs/pull-repos.md b/docs/pull-repos.md index 3a0e01f9..648dc6a1 100644 --- a/docs/pull-repos.md +++ b/docs/pull-repos.md @@ -6,7 +6,7 @@ This PowerShell script pulls updates into all Git repositories in a folder (incl Parameters ---------- ```powershell -PS> ./pull-repos.ps1 [[-parentDir] ] [] +/home/markus/Repos/PowerShell/scripts/pull-repos.ps1 [[-parentDir] ] [] -parentDir Specifies the path to the parent folder @@ -94,10 +94,10 @@ try { } [int]$elapsed = $stopWatch.Elapsed.TotalSeconds if ($failed -eq 0) { - "βœ”οΈ Updated $numFolders repositories under πŸ“‚$parentDirName in $($elapsed)s." + "βœ… Pulled updates into $numFolders repos at πŸ“‚$parentDir in $($elapsed)s." exit 0 # success } else { - "⚠️ Updated $numFolders repositories under πŸ“‚$parentDirName in $($elapsed)s but $failed failed!" + "⚠️ Updated $numFolders repos at πŸ“‚$parentDir in $($elapsed)s but $failed failed!" exit 1 } } catch { @@ -106,4 +106,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of pull-repos.ps1 as of 08/15/2024 09:50:53)* +*(generated by convert-ps2md.ps1 using the comment-based help of pull-repos.ps1 as of 11/08/2024 12:34:54)* diff --git a/docs/query-smart-data.md b/docs/query-smart-data.md index 4895b237..dfd64d21 100644 --- a/docs/query-smart-data.md +++ b/docs/query-smart-data.md @@ -8,7 +8,7 @@ Queries the S.M.A.R.T. data of your HDD/SSD's and saves it to the current/given Parameters ---------- ```powershell -PS> ./query-smart-data.ps1 [[-Directory] ] [] +/home/markus/Repos/PowerShell/scripts/query-smart-data.ps1 [[-Directory] ] [] -Directory Specifies the path to the target directory @@ -98,7 +98,7 @@ try { $DevNo++ } - "βœ”οΈ Done." + "βœ… Done." exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -106,4 +106,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of query-smart-data.ps1 as of 08/15/2024 09:50:53)* +*(generated by convert-ps2md.ps1 using the comment-based help of query-smart-data.ps1 as of 11/08/2024 12:34:54)* diff --git a/docs/reboot-fritzbox.md b/docs/reboot-fritzbox.md index 868c3991..ecfb3648 100644 --- a/docs/reboot-fritzbox.md +++ b/docs/reboot-fritzbox.md @@ -6,7 +6,7 @@ This PowerShell script reboots the FRITZ!Box device Parameters ---------- ```powershell -PS> ./reboot-fritzbox.ps1 [[-Username] ] [[-Password] ] [] +/home/markus/Repos/PowerShell/scripts/reboot-fritzbox.ps1 [[-Username] ] [[-Password] ] [] -Username Specifies the user name @@ -152,4 +152,4 @@ echo $Result exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of reboot-fritzbox.ps1 as of 08/15/2024 09:50:53)* +*(generated by convert-ps2md.ps1 using the comment-based help of reboot-fritzbox.ps1 as of 11/08/2024 12:34:54)* diff --git a/docs/reboot.md b/docs/reboot.md index b2892a71..8c131e75 100644 --- a/docs/reboot.md +++ b/docs/reboot.md @@ -6,7 +6,7 @@ This PowerShell script reboots the local computer immediately (needs admin right Parameters ---------- ```powershell -PS> ./reboot.ps1 [] +/home/markus/Repos/PowerShell/scripts/reboot.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -59,4 +59,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of reboot.ps1 as of 08/15/2024 09:50:53)* +*(generated by convert-ps2md.ps1 using the comment-based help of reboot.ps1 as of 11/08/2024 12:34:54)* diff --git a/docs/remember.md b/docs/remember.md index c515bed8..ac32e6d8 100644 --- a/docs/remember.md +++ b/docs/remember.md @@ -6,7 +6,7 @@ This PowerShell script saves the given text to 'Remember.csv' in your home folde Parameters ---------- ```powershell -PS> ./remember.ps1 [[-text1] ] [[-text2] ] [[-text3] ] [] +/home/markus/Repos/PowerShell/scripts/remember.ps1 [[-text1] ] [[-text2] ] [[-text3] ] [] -text1 Specifies the text to memorize @@ -42,7 +42,7 @@ Example ------- ```powershell PS> ./remember.ps1 "Buy apples" -βœ”οΈ Saved to /home/Markus/Remember.csv in 0s. +βœ… Saved to /home/Markus/Remember.csv in 0s. ``` @@ -66,7 +66,7 @@ Script Content Specifies the text to memorize .EXAMPLE PS> ./remember.ps1 "Buy apples" - βœ”οΈ Saved to /home/Markus/Remember.csv in 0s. + βœ… Saved to /home/Markus/Remember.csv in 0s. .LINK https://github.com/fleschutz/PowerShell .NOTES @@ -93,7 +93,7 @@ try { $path = Resolve-Path $path [int]$elapsed = $stopWatch.Elapsed.TotalSeconds - "βœ”οΈ Saved to $path in $($elapsed)s." + "βœ… Saved to $path in $($elapsed)s." exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -101,4 +101,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of remember.ps1 as of 08/15/2024 09:50:53)* +*(generated by convert-ps2md.ps1 using the comment-based help of remember.ps1 as of 11/08/2024 12:34:54)* diff --git a/docs/remind-me.md b/docs/remind-me.md index e1bef389..07f5d2b8 100644 --- a/docs/remind-me.md +++ b/docs/remind-me.md @@ -6,7 +6,7 @@ This PowerShell script creates a scheduled task that will display a popup messag Parameters ---------- ```powershell -PS> ./remind-me.ps1 [[-Message] ] [[-Time] ] [] +/home/markus/Repos/PowerShell/scripts/remind-me.ps1 [[-Message] ] [[-Time] ] [] -Message @@ -88,4 +88,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of remind-me.ps1 as of 08/15/2024 09:50:53)* +*(generated by convert-ps2md.ps1 using the comment-based help of remind-me.ps1 as of 11/08/2024 12:34:54)* diff --git a/docs/remove-dir-tree.md b/docs/remove-dir-tree.md index 40392cc6..9e201991 100644 --- a/docs/remove-dir-tree.md +++ b/docs/remove-dir-tree.md @@ -6,7 +6,7 @@ This PowerShell script silently removes a directory tree recursively. Use it wit Parameters ---------- ```powershell -PS> ./remove-dir-tree.ps1 [[-pathToDirTree] ] [] +/home/markus/Repos/PowerShell/scripts/remove-dir-tree.ps1 [[-pathToDirTree] ] [] -pathToDirTree Specifies the file path to the directory tree @@ -69,4 +69,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of remove-dir-tree.ps1 as of 08/15/2024 09:50:53)* +*(generated by convert-ps2md.ps1 using the comment-based help of remove-dir-tree.ps1 as of 11/08/2024 12:34:54)* diff --git a/docs/remove-empty-dirs.md b/docs/remove-empty-dirs.md index 844486e0..3fe8b44c 100644 --- a/docs/remove-empty-dirs.md +++ b/docs/remove-empty-dirs.md @@ -6,7 +6,7 @@ This PowerShell script removes all empty subfolders within a directory tree. Parameters ---------- ```powershell -PS> ./remove-empty-dirs.ps1 [[-DirTree] ] [] +/home/markus/Repos/PowerShell/scripts/remove-empty-dirs.ps1 [[-DirTree] ] [] -DirTree Specifies the path to the directory tree @@ -83,7 +83,7 @@ try { Remove-Item -Path $Folder.Object.FullName -Force } } - "βœ”οΈ Done." + "βœ… Done." exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -91,4 +91,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of remove-empty-dirs.ps1 as of 08/15/2024 09:50:53)* +*(generated by convert-ps2md.ps1 using the comment-based help of remove-empty-dirs.ps1 as of 11/08/2024 12:34:54)* diff --git a/docs/remove-old-dirs.md b/docs/remove-old-dirs.md index 192ae5d5..71d7a1d6 100644 --- a/docs/remove-old-dirs.md +++ b/docs/remove-old-dirs.md @@ -6,7 +6,7 @@ This PowerShell script removes any subfolder in a parent folder older than ./remove-old-dirs.ps1 [[-path] ] [[-numDays] ] [] +/home/markus/Repos/PowerShell/scripts/remove-old-dirs.ps1 [[-path] ] [[-numDays] ] [] -path Specifies the file path to the parent folder @@ -84,7 +84,7 @@ try { } } [int]$elapsed = $stopWatch.Elapsed.TotalSeconds - "βœ”οΈ Removed $numRemoved of $count subfolders older than $numDays days in $elapsed sec" + "βœ… Removed $numRemoved of $count subfolders older than $numDays days in $elapsed sec" exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -92,4 +92,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of remove-old-dirs.ps1 as of 08/15/2024 09:50:53)* +*(generated by convert-ps2md.ps1 using the comment-based help of remove-old-dirs.ps1 as of 11/08/2024 12:34:54)* diff --git a/docs/remove-print-jobs.md b/docs/remove-print-jobs.md index 1e4e7414..1c0bfa0e 100644 --- a/docs/remove-print-jobs.md +++ b/docs/remove-print-jobs.md @@ -6,7 +6,7 @@ This PowerShell script removes all print jobs from all printer devices. Parameters ---------- ```powershell -PS> ./remove-print-jobs.ps1 [] +/home/markus/Repos/PowerShell/scripts/remove-print-jobs.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -57,7 +57,7 @@ try { } } - "βœ”οΈ all print jobs removed" + "βœ… all print jobs removed" exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -65,4 +65,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of remove-print-jobs.ps1 as of 08/15/2024 09:50:53)* +*(generated by convert-ps2md.ps1 using the comment-based help of remove-print-jobs.ps1 as of 11/08/2024 12:34:54)* diff --git a/docs/remove-tag.md b/docs/remove-tag.md index bb740b36..a51e5f1f 100644 --- a/docs/remove-tag.md +++ b/docs/remove-tag.md @@ -6,7 +6,7 @@ This PowerShell script removes a Git tag, either locally, remote, or both. Parameters ---------- ```powershell -PS> ./remove-tag.ps1 [[-TagName] ] [[-Mode] ] [[-RepoDir] ] [] +/home/markus/Repos/PowerShell/scripts/remove-tag.ps1 [[-TagName] ] [[-Mode] ] [[-RepoDir] ] [] -TagName Specifies the Git tag name @@ -103,7 +103,7 @@ try { } [int]$Elapsed = $StopWatch.Elapsed.TotalSeconds - "βœ”οΈ removed tag '$TagName' in $Elapsed sec" + "βœ… removed tag '$TagName' in $Elapsed sec" exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -111,4 +111,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of remove-tag.ps1 as of 08/15/2024 09:50:53)* +*(generated by convert-ps2md.ps1 using the comment-based help of remove-tag.ps1 as of 11/08/2024 12:34:54)* diff --git a/docs/remove-user.md b/docs/remove-user.md index 390bfe76..fea1370b 100644 --- a/docs/remove-user.md +++ b/docs/remove-user.md @@ -6,7 +6,7 @@ This PowerShell script removes an existing user account including the home direc Parameters ---------- ```powershell -PS> ./remove-user.ps1 [[-username] ] [] +/home/markus/Repos/PowerShell/scripts/remove-user.ps1 [[-username] ] [] -username @@ -25,7 +25,7 @@ Example ------- ```powershell PS> ./remove-user.ps1 Joe -βœ”οΈ Removed user 'Joe' including home directory in 11s. +βœ… Removed user 'Joe' including home directory in 11s. ``` @@ -47,7 +47,7 @@ Script Content This PowerShell script removes an existing user account including the home directory. .EXAMPLE PS> ./remove-user.ps1 Joe - βœ”οΈ Removed user 'Joe' including home directory in 11s. + βœ… Removed user 'Joe' including home directory in 11s. .LINK https://github.com/fleschutz/PowerShell .NOTES @@ -67,7 +67,7 @@ try { } [int]$elapsed = $stopWatch.Elapsed.TotalSeconds - "βœ”οΈ Removed user '$username' including home directory in $($elapsed)s." + "βœ… Removed user '$username' including home directory in $($elapsed)s." exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -75,4 +75,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of remove-user.ps1 as of 08/15/2024 09:50:53)* +*(generated by convert-ps2md.ps1 using the comment-based help of remove-user.ps1 as of 11/08/2024 12:34:54)* diff --git a/docs/remove-vm.md b/docs/remove-vm.md index eca85fa3..82a58570 100644 --- a/docs/remove-vm.md +++ b/docs/remove-vm.md @@ -25,4 +25,4 @@ Remove-Item -Path "C:\VirtualMachines\$VMName" -Recurse exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of remove-vm.ps1 as of 08/15/2024 09:50:53)* +*(generated by convert-ps2md.ps1 using the comment-based help of remove-vm.ps1 as of 11/08/2024 12:34:54)* diff --git a/docs/replace-in-files.md b/docs/replace-in-files.md index aeb408af..296b1e30 100644 --- a/docs/replace-in-files.md +++ b/docs/replace-in-files.md @@ -6,10 +6,10 @@ This PowerShell script searches and replaces a pattern in the given files by the Parameters ---------- ```powershell -PS> ./replace-in-files.ps1 [[-pattern] ] [[-replacement] ] [[-filePattern] ] [] +/home/markus/Repos/PowerShell/scripts/replace-in-files.ps1 [[-pattern] ] [[-replacement] ] [[-filePattern] ] [] -pattern - Specifies the text pattern to look for + Specifies the text pattern to search for (ask user by default) Required? false Position? 1 @@ -18,7 +18,7 @@ PS> ./replace-in-files.ps1 [[-pattern] ] [[-replacement] ] [[-fi Accept wildcard characters? false -replacement - Specifies the text replacement + Specifies the text replacement (ask user by default) Required? false Position? 2 @@ -27,7 +27,7 @@ PS> ./replace-in-files.ps1 [[-pattern] ] [[-replacement] ] [[-fi Accept wildcard characters? false -filePattern - Specifies the file to scan + Specifies the file search pattern (ask user by default) Required? false Position? 3 @@ -64,11 +64,11 @@ Script Content .DESCRIPTION This PowerShell script searches and replaces a pattern in the given files by the replacement. .PARAMETER pattern - Specifies the text pattern to look for + Specifies the text pattern to search for (ask user by default) .PARAMETER replacement - Specifies the text replacement + Specifies the text replacement (ask user by default) .PARAMETER filePattern - Specifies the file to scan + Specifies the file search pattern (ask user by default) .EXAMPLE PS> ./replace-in-files NSA "No Such Agency" C:\Temp\*.txt .LINK @@ -79,17 +79,16 @@ Script Content param([string]$pattern = "", [string]$replacement = "", [string]$filePattern = "") -function ReplaceInFile { param([string]$path, [string]$pattern, [string]$replacement) - +function ReplaceInFile([string]$path, [string]$pattern, [string]$replacement) { [System.IO.File]::WriteAllText($path, ([System.IO.File]::ReadAllText($path) -replace $pattern, $replacement) ) } try { - if ($pattern -eq "" ) { $pattern = Read-Host "Enter the text pattern to look for" } - if ($replacement -eq "" ) { $replacement = Read-Host "Enter the text replacement" } - if ($filePattern -eq "" ) { $filePattern = Read-Host "Enter the file pattern" } + if ($pattern -eq "" ) { $pattern = Read-Host "Enter the text to search for, e.g. 'Joe' " } + if ($replacement -eq "" ) { $replacement = Read-Host "Enter the text to replace with, e.g. 'J' " } + if ($filePattern -eq "" ) { $filePattern = Read-Host "Enter the file search pattern, e.g. '*.c'" } $stopWatch = [system.diagnostics.stopwatch]::startNew() $files = (Get-ChildItem -path "$filePattern" -attributes !Directory) @@ -97,7 +96,7 @@ try { ReplaceInFile $file $pattern $replacement } [int]$elapsed = $stopWatch.Elapsed.TotalSeconds - "βœ”οΈ Replaced '$pattern' by '$replacement' in $($files.Count) files in $elapsed sec" + "βœ… Replaced '$pattern' by '$replacement' in $($files.Count) files in $($elapsed)s." exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -105,4 +104,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of replace-in-files.ps1 as of 08/15/2024 09:50:53)* +*(generated by convert-ps2md.ps1 using the comment-based help of replace-in-files.ps1 as of 11/08/2024 12:34:54)* diff --git a/docs/restart-network-adapters.md b/docs/restart-network-adapters.md index 7b895b9e..25e468b7 100644 --- a/docs/restart-network-adapters.md +++ b/docs/restart-network-adapters.md @@ -6,7 +6,7 @@ This PowerShell script restarts all local network adapters (needs admin rights). Parameters ---------- ```powershell -PS> ./restart-network-adapters.ps1 [] +/home/markus/Repos/PowerShell/scripts/restart-network-adapters.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -52,7 +52,7 @@ try { Get-NetAdapter | Restart-NetAdapter [int]$Elapsed = $StopWatch.Elapsed.TotalSeconds - "βœ”οΈ restarted all local network adapters in $Elapsed sec" + "βœ… restarted all local network adapters in $Elapsed sec" exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -60,4 +60,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of restart-network-adapters.ps1 as of 08/15/2024 09:50:53)* +*(generated by convert-ps2md.ps1 using the comment-based help of restart-network-adapters.ps1 as of 11/08/2024 12:34:54)* diff --git a/docs/roll-a-dice.md b/docs/roll-a-dice.md index c81c9714..f5e5ef90 100644 --- a/docs/roll-a-dice.md +++ b/docs/roll-a-dice.md @@ -6,7 +6,7 @@ This PowerShell script rolls a dice and returns the number by text-to-speech (TT Parameters ---------- ```powershell -PS> ./roll-a-dice.ps1 [] +/home/markus/Repos/PowerShell/scripts/roll-a-dice.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -51,4 +51,4 @@ $Number = "1", "2", "3", "4", "5", "6" | Get-Random exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of roll-a-dice.ps1 as of 08/15/2024 09:50:53)* +*(generated by convert-ps2md.ps1 using the comment-based help of roll-a-dice.ps1 as of 11/08/2024 12:34:54)* diff --git a/docs/save-credentials.md b/docs/save-credentials.md index 1f9134f5..0c1941e3 100644 --- a/docs/save-credentials.md +++ b/docs/save-credentials.md @@ -1,19 +1,19 @@ Script: *save-credentials.ps1* ======================== -This PowerShell script asks for credentials and saves them encrypted into a target file ("$HOME\my.credentials" by default). +This PowerShell script asks for credentials and saves them encrypted into a target file. Parameters ---------- ```powershell -PS> ./save-credentials.ps1 [[-TargetFile] ] [] +/home/markus/Repos/PowerShell/scripts/save-credentials.ps1 [[-targetFile] ] [] --TargetFile - Specifies the target file ("$HOME\my.credentials" by default) +-targetFile + Specifies the target file ("~\my.credentials" by default) Required? false Position? 1 - Default value "$HOME\my.credentials" + Default value ~\my.credentials Accept pipeline input? false Accept wildcard characters? false @@ -27,7 +27,7 @@ Example ```powershell PS> ./save-credentials.ps1 Enter username and password, please. - βœ”οΈ Your credentials have been saved encrypted into C:\Users\Markus\my.credentials + βœ… Your credentials have been saved to C:\Users\Markus\my.credentials (encrypted). ``` @@ -46,26 +46,26 @@ Script Content .SYNOPSIS Saves credentials encrypted .DESCRIPTION - This PowerShell script asks for credentials and saves them encrypted into a target file ("$HOME\my.credentials" by default). -.PARAMETER TargetFile - Specifies the target file ("$HOME\my.credentials" by default) + This PowerShell script asks for credentials and saves them encrypted into a target file. +.PARAMETER targetFile + Specifies the target file ("~\my.credentials" by default) .EXAMPLE PS> ./save-credentials.ps1 Enter username and password, please. - βœ”οΈ Your credentials have been saved encrypted into C:\Users\Markus\my.credentials + βœ… Your credentials have been saved to C:\Users\Markus\my.credentials (encrypted). .LINK https://github.com/fleschutz/PowerShell .NOTES Author: Markus Fleschutz | License: CC0 #> -param([string]$TargetFile = "$HOME\my.credentials") +param([string]$targetFile = "~\my.credentials") try { Write-Host "Enter username and password, please." -foreground red $cred = Get-Credential - $cred.Password | ConvertFrom-SecureString | Set-Content "$TargetFile" - "βœ”οΈ Your credentials have been saved encrypted into $TargetFile" + $cred.Password | ConvertFrom-SecureString | Set-Content "$targetFile" + "βœ… Your credentials have been saved to $targetFile (encrypted)." exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -73,4 +73,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of save-credentials.ps1 as of 08/15/2024 09:50:53)* +*(generated by convert-ps2md.ps1 using the comment-based help of save-credentials.ps1 as of 11/08/2024 12:34:54)* diff --git a/docs/save-screenshot.md b/docs/save-screenshot.md index 05abe23a..0671ef99 100644 --- a/docs/save-screenshot.md +++ b/docs/save-screenshot.md @@ -6,7 +6,7 @@ This PowerShell script takes a single screenshot and saves it into a target fold Parameters ---------- ```powershell -PS> ./save-screenshot.ps1 [[-TargetFolder] ] [] +/home/markus/Repos/PowerShell/scripts/save-screenshot.ps1 [[-TargetFolder] ] [] -TargetFolder Specifies the target folder (the user's screenshots folder by default) @@ -26,7 +26,7 @@ Example ------- ```powershell PS> ./save-screenshot - βœ”οΈ screenshot saved to C:\Users\Markus\Pictures\Screenshots\2021-10-10T14-33-22.png + βœ… screenshot saved to C:\Users\Markus\Pictures\Screenshots\2021-10-10T14-33-22.png ``` @@ -50,7 +50,7 @@ Script Content Specifies the target folder (the user's screenshots folder by default) .EXAMPLE PS> ./save-screenshot - βœ”οΈ screenshot saved to C:\Users\Markus\Pictures\Screenshots\2021-10-10T14-33-22.png + βœ… screenshot saved to C:\Users\Markus\Pictures\Screenshots\2021-10-10T14-33-22.png .LINK https://github.com/fleschutz/PowerShell .NOTES @@ -90,7 +90,7 @@ try { $FilePath = (Join-Path $TargetFolder $Filename) TakeScreenshot $FilePath - "βœ”οΈ screenshot saved to $FilePath" + "βœ… screenshot saved to $FilePath" exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -98,4 +98,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of save-screenshot.ps1 as of 08/15/2024 09:50:53)* +*(generated by convert-ps2md.ps1 using the comment-based help of save-screenshot.ps1 as of 11/08/2024 12:34:54)* diff --git a/docs/scan-folder.md b/docs/scan-folder.md new file mode 100644 index 00000000..e0c975ee --- /dev/null +++ b/docs/scan-folder.md @@ -0,0 +1,94 @@ +Script: *scan-folder.ps1* +======================== + +This PowerShell script scans a directory tree for malware. Requires the installation of ESET or Windows Defender. + +Parameters +---------- +```powershell +/home/markus/Repos/PowerShell/scripts/scan-folder.ps1 [[-path] ] [] + +-path + Specifies the file path to the folder (default is working directory). + + Required? false + Position? 1 + Default value "$PWD" + Accept pipeline input? false + Accept wildcard characters? false + +[] + This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, + WarningVariable, OutBuffer, PipelineVariable, and OutVariable. +``` + +Example +------- +```powershell +PS> ./scan-folder.ps1 C:\Windows +⏳ Scanning πŸ“‚C:\Windows with ESET Antivirus... +... + +``` + +Notes +----- +Author: Markus Fleschutz | License: CC0 + +Related Links +------------- +https://github.com/fleschutz/PowerShell + +Script Content +-------------- +```powershell +<# +.SYNOPSIS + Scans a directory tree for malware +.DESCRIPTION + This PowerShell script scans a directory tree for malware. Requires the installation of ESET or Windows Defender. +.PARAMETER path + Specifies the file path to the folder (default is working directory). +.EXAMPLE + PS> ./scan-folder.ps1 C:\Windows + ⏳ Scanning πŸ“‚C:\Windows with ESET Antivirus... + ... +.LINK + https://github.com/fleschutz/PowerShell +.NOTES + Author: Markus Fleschutz | License: CC0 +#> + +param([string]$path = "$PWD") + +try { + $stopWatch = [system.diagnostics.stopwatch]::startNew() + + if (-not(Test-Path $path -pathType container)) { throw "Invalid file path: $path" } + $path = Resolve-Path $path + + if (Test-Path "C:\Program Files\ESET\ESET Security\ecls.exe" -pathType leaf) { + + "⏳ Scanning πŸ“‚$path with ESET Antivirus..." + & "C:\Program Files\ESET\ESET Security\ecls.exe" $path + if ($lastExitCode -ne 0) { throw "ESET Antivirus failed with exit code $lastExitCode - POTENTIAL DANGER!!!" } + + } elseif (Test-Path "C:\Program Files\Windows Defender\MpCmdRun.exe" -pathType leaf) { + + "⏳ Scanning πŸ“‚$path with Windows Defender..." + & "C:\Program Files\Windows Defender\MpCmdRun.exe" -Scan -ScanType 2 -File $path + if ($lastExitCode -ne 0) { throw "Windows Defender failed with exit code $lastExitCode - POTENTIAL DANGER !!!" } + + } else { + throw "Found no ESET or Windows Defender - please install one." + } + [int]$elapsed = $stopWatch.Elapsed.TotalSeconds + "βœ… Scanned πŸ“‚$path in $($elapsed)s: No malware found." + exit 0 # success +} catch { + "⚠️ Error: $($Error[0])" + exit 1 +} +``` + +*(generated by convert-ps2md.ps1 using the comment-based help of scan-folder.ps1 as of 11/08/2024 12:34:54)* diff --git a/docs/scan-network.md b/docs/scan-network.md index 14ec9e6f..6be76535 100644 --- a/docs/scan-network.md +++ b/docs/scan-network.md @@ -32,4 +32,4 @@ $arguments = $arguments + " " + $targets Start-Process $location -ArgumentList $arguments -Wait ``` -*(generated by convert-ps2md.ps1 using the comment-based help of scan-network.ps1 as of 08/15/2024 09:50:53)* +*(generated by convert-ps2md.ps1 using the comment-based help of scan-network.ps1 as of 11/08/2024 12:34:54)* diff --git a/docs/scan-ports.md b/docs/scan-ports.md index 60c99410..d073d505 100644 --- a/docs/scan-ports.md +++ b/docs/scan-ports.md @@ -6,7 +6,7 @@ This PowerShell script scans the network for open or closed ports. Parameters ---------- ```powershell -PS> ./scan-ports.ps1 [] +/home/markus/Repos/PowerShell/scripts/scan-ports.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -65,4 +65,4 @@ foreach($add in $range) { exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of scan-ports.ps1 as of 08/15/2024 09:50:53)* +*(generated by convert-ps2md.ps1 using the comment-based help of scan-ports.ps1 as of 11/08/2024 12:34:54)* diff --git a/docs/search-filename.md b/docs/search-filename.md index 9e3e26df..f6d649d0 100644 --- a/docs/search-filename.md +++ b/docs/search-filename.md @@ -7,7 +7,7 @@ After you pass in a root folder and a search term, the script will list all file Parameters ---------- ```powershell -PS> ./search-filename.ps1 [-path] [-term] [] +/home/markus/Repos/PowerShell/scripts/search-filename.ps1 [-path] [-term] [] -path Specifies the path @@ -96,4 +96,4 @@ Search-Folder -FilePath $path -SearchTerm $term exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of search-filename.ps1 as of 08/15/2024 09:50:53)* +*(generated by convert-ps2md.ps1 using the comment-based help of search-filename.ps1 as of 11/08/2024 12:34:54)* diff --git a/docs/search-files.md b/docs/search-files.md index a72d8772..83461242 100644 --- a/docs/search-files.md +++ b/docs/search-files.md @@ -6,7 +6,7 @@ This PowerShell script searches for the given text pattern in the given files. Parameters ---------- ```powershell -PS> ./search-files.ps1 [[-textPattern] ] [[-filePattern] ] [] +/home/markus/Repos/PowerShell/scripts/search-files.ps1 [[-textPattern] ] [[-filePattern] ] [] -textPattern Specifies the text pattern to search for @@ -83,7 +83,7 @@ param([string]$textPattern = "", [string]$filePattern = "") function ListLocations { param([string]$textPattern, [string]$filePattern) $list = Select-String -path $filePattern -pattern "$textPattern" foreach($item in $list) { New-Object PSObject -Property @{ 'FILE'="$($item.Path)"; 'LINE'="$($item.LineNumber):$($item.Line)" } } - "βœ”οΈ Found $($list.Count) lines containing '$textPattern' in $filePattern." + "βœ… Found $($list.Count) lines containing '$textPattern' in $filePattern." } try { @@ -98,4 +98,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of search-files.ps1 as of 08/15/2024 09:50:53)* +*(generated by convert-ps2md.ps1 using the comment-based help of search-files.ps1 as of 11/08/2024 12:34:55)* diff --git a/docs/search-repo.md b/docs/search-repo.md new file mode 100644 index 00000000..5faee150 --- /dev/null +++ b/docs/search-repo.md @@ -0,0 +1,94 @@ +Script: *search-repo.ps1* +======================== + +This PowerShell script searches for the given text pattern in a Git repository. + +Parameters +---------- +```powershell +/home/markus/Repos/PowerShell/scripts/search-repo.ps1 [[-textPattern] ] [[-path] ] [] + +-textPattern + Specifies the text pattern to search for + + Required? false + Position? 1 + Default value + Accept pipeline input? false + Accept wildcard characters? false + +-path + Specifies the file path to the local Git repository + + Required? false + Position? 2 + Default value "$PWD" + Accept pipeline input? false + Accept wildcard characters? false + +[] + This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, + WarningVariable, OutBuffer, PipelineVariable, and OutVariable. +``` + +Example +------- +```powershell +PS> ./search-repo.ps1 UFO +list-calendar.ps1: Write-Host (" " * 4 * [int](Get-Date $day -uformat %u)) -NoNewLine +list-calendar.ps1: $dayOffset = [int](Get-Date -day 1 -month ($month + $i) -year $year -uformat %u) + +``` + +Notes +----- +Author: Markus Fleschutz | License: CC0 + +Related Links +------------- +https://github.com/fleschutz/PowerShell + +Script Content +-------------- +```powershell +<# +.SYNOPSIS + Searches for text in a repo +.DESCRIPTION + This PowerShell script searches for the given text pattern in a Git repository. +.PARAMETER textPattern + Specifies the text pattern to search for +.PARAMETER path + Specifies the file path to the local Git repository +.EXAMPLE + PS> ./search-repo.ps1 UFO + list-calendar.ps1: Write-Host (" " * 4 * [int](Get-Date $day -uformat %u)) -NoNewLine + list-calendar.ps1: $dayOffset = [int](Get-Date -day 1 -month ($month + $i) -year $year -uformat %u) +.LINK + https://github.com/fleschutz/PowerShell +.NOTES + Author: Markus Fleschutz | License: CC0 +#> + +param([string]$textPattern = "", [string]$path = "$PWD") + + +try { + if ($textPattern -eq "" ) { $textPattern = Read-Host "Enter the text pattern, e.g. 'UFO'" } + + if (-not(Test-Path "$path" -pathType container)) { throw "Can't access Git repository at: $path" } + + $null = (git --version) + if ($lastExitCode -ne "0") { throw "Can't execute 'git' - make sure Git is installed and available" } + + & git -C "$path" grep $textPattern + if ($lastExitCode -ne "0") { throw "'git grep' failed with exit code $lastExitCode" } + + exit 0 # success +} catch { + "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" + exit 1 +} +``` + +*(generated by convert-ps2md.ps1 using the comment-based help of search-repo.ps1 as of 11/08/2024 12:34:55)* diff --git a/docs/send-email.md b/docs/send-email.md index 698fd43a..223b7813 100644 --- a/docs/send-email.md +++ b/docs/send-email.md @@ -6,7 +6,7 @@ This PowerShell script sends an email message. Parameters ---------- ```powershell -PS> ./send-email.ps1 [[-From] ] [[-To] ] [[-Subject] ] [[-Body] ] [[-SMTPServer] ] [] +/home/markus/Repos/PowerShell/scripts/send-email.ps1 [[-From] ] [[-To] ] [[-Subject] ] [[-Body] ] [[-SMTPServer] ] [] -From Specifies the sender email address @@ -113,7 +113,7 @@ try { $msg.subject = $Subject $msg.body = $Body $smtp.Send($msg) - "βœ”οΈ Message sent." + "βœ… Message sent." exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -121,4 +121,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of send-email.ps1 as of 08/15/2024 09:50:53)* +*(generated by convert-ps2md.ps1 using the comment-based help of send-email.ps1 as of 11/08/2024 12:34:55)* diff --git a/docs/send-tcp.md b/docs/send-tcp.md index b7466122..da3cbd79 100644 --- a/docs/send-tcp.md +++ b/docs/send-tcp.md @@ -6,7 +6,7 @@ This PowerShell script sends a TCP message to the given IP address and port. Parameters ---------- ```powershell -PS> ./send-tcp.ps1 [[-TargetIP] ] [[-TargetPort] ] [[-Message] ] [] +/home/markus/Repos/PowerShell/scripts/send-tcp.ps1 [[-TargetIP] ] [[-TargetPort] ] [[-Message] ] [] -TargetIP Specifies the target IP address @@ -96,7 +96,7 @@ try { $Stream.Close() $Socket.Close() - "βœ”οΈ Done." + "βœ… Done." exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -104,4 +104,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of send-tcp.ps1 as of 08/15/2024 09:50:53)* +*(generated by convert-ps2md.ps1 using the comment-based help of send-tcp.ps1 as of 11/08/2024 12:34:55)* diff --git a/docs/send-udp.md b/docs/send-udp.md index ff98e146..d45cd968 100644 --- a/docs/send-udp.md +++ b/docs/send-udp.md @@ -6,7 +6,7 @@ This PowerShell script sends a UDP datagram message to an IP address and port. Parameters ---------- ```powershell -PS> ./send-udp.ps1 [[-TargetIP] ] [[-TargetPort] ] [[-Message] ] [] +/home/markus/Repos/PowerShell/scripts/send-udp.ps1 [[-TargetIP] ] [[-TargetPort] ] [[-Message] ] [] -TargetIP Specifies the target IP address @@ -44,7 +44,7 @@ Example ------- ```powershell PS> ./send-udp 192.168.100.100 8080 "TEST" -βœ”οΈ Done. +βœ… Done. ``` @@ -72,7 +72,7 @@ Script Content Specifies the message text to send .EXAMPLE PS> ./send-udp 192.168.100.100 8080 "TEST" - βœ”οΈ Done. + βœ… Done. .LINK https://github.com/fleschutz/PowerShell .NOTES @@ -94,7 +94,7 @@ try { $SendMessage = $Socket.Send($EncodedText, $EncodedText.Length, $EndPoints) $Socket.Close() - "βœ”οΈ Done." + "βœ… Done." exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -102,4 +102,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of send-udp.ps1 as of 08/15/2024 09:50:53)* +*(generated by convert-ps2md.ps1 using the comment-based help of send-udp.ps1 as of 11/08/2024 12:34:55)* diff --git a/docs/set-timer.md b/docs/set-timer.md index 8f35daba..5d9bce0f 100644 --- a/docs/set-timer.md +++ b/docs/set-timer.md @@ -6,7 +6,7 @@ This PowerShell script sets a timer for a countdown. Parameters ---------- ```powershell -PS> ./set-timer.ps1 [[-Seconds] ] [] +/home/markus/Repos/PowerShell/scripts/set-timer.ps1 [[-Seconds] ] [] -Seconds Specifies the number of seconds @@ -66,7 +66,7 @@ try { Start-Sleep -seconds 1 } - "βœ”οΈ $Seconds seconds countdown finished" + "βœ… $Seconds seconds countdown finished" exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -74,4 +74,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of set-timer.ps1 as of 08/15/2024 09:50:53)* +*(generated by convert-ps2md.ps1 using the comment-based help of set-timer.ps1 as of 11/08/2024 12:34:55)* diff --git a/docs/set-volume.md b/docs/set-volume.md index 7a80a4f7..067f3e77 100644 --- a/docs/set-volume.md +++ b/docs/set-volume.md @@ -6,7 +6,7 @@ This PowerShell script sets the audio volume to the given value in percent (0..1 Parameters ---------- ```powershell -PS> ./set-volume.ps1 [-percent] [] +/home/markus/Repos/PowerShell/scripts/set-volume.ps1 [-percent] [] -percent Specifies the volume in percent (0..100) @@ -77,4 +77,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of set-volume.ps1 as of 08/15/2024 09:50:53)* +*(generated by convert-ps2md.ps1 using the comment-based help of set-volume.ps1 as of 11/08/2024 12:34:55)* diff --git a/docs/set-wallpaper.md b/docs/set-wallpaper.md index a7488a84..b0747d51 100644 --- a/docs/set-wallpaper.md +++ b/docs/set-wallpaper.md @@ -6,7 +6,7 @@ This PowerShell script sets the given image file as desktop wallpaper (.JPG or . Parameters ---------- ```powershell -PS> ./set-wallpaper.ps1 [[-ImageFile] ] [[-Style] ] [] +/home/markus/Repos/PowerShell/scripts/set-wallpaper.ps1 [[-ImageFile] ] [[-Style] ] [] -ImageFile Specifies the path to the image file @@ -114,7 +114,7 @@ try { if ($ImageFile -eq "" ) { $ImageFile = read-host "Enter path to image file" } SetWallPaper -Image $ImageFile -Style $Style - "βœ”οΈ Done." + "βœ… Done." exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -122,4 +122,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of set-wallpaper.ps1 as of 08/15/2024 09:50:53)* +*(generated by convert-ps2md.ps1 using the comment-based help of set-wallpaper.ps1 as of 11/08/2024 12:34:55)* diff --git a/docs/show-lightnings.md b/docs/show-lightnings.md index 024e4246..6b528188 100644 --- a/docs/show-lightnings.md +++ b/docs/show-lightnings.md @@ -6,7 +6,7 @@ This PowerShell script launches the Web browser and shows lightnings in OpenStre Parameters ---------- ```powershell -PS> ./show-lightnings.ps1 [] +/home/markus/Repos/PowerShell/scripts/show-lightnings.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of show-lightnings.ps1 as of 08/15/2024 09:50:54)* +*(generated by convert-ps2md.ps1 using the comment-based help of show-lightnings.ps1 as of 11/08/2024 12:34:55)* diff --git a/docs/show-notification-motivation-quote.md b/docs/show-notification-motivation-quote.md index ee389f91..527b56e5 100644 --- a/docs/show-notification-motivation-quote.md +++ b/docs/show-notification-motivation-quote.md @@ -69,4 +69,4 @@ $AppId = '{1AC14E77-02E7-4E5D-B744-2EB1AE5198B7}\WindowsPowerShell\v1.0\powershe ``` -*(generated by convert-ps2md.ps1 using the comment-based help of show-notification-motivation-quote.ps1 as of 08/15/2024 09:50:54)* +*(generated by convert-ps2md.ps1 using the comment-based help of show-notification-motivation-quote.ps1 as of 11/08/2024 12:34:55)* diff --git a/docs/show-notification.md b/docs/show-notification.md index 0403f787..da91e6ab 100644 --- a/docs/show-notification.md +++ b/docs/show-notification.md @@ -1,12 +1,12 @@ Script: *show-notification.ps1* ======================== -This PowerShell script shows a toast-message notification for the Windows 10 Notification Center. +This PowerShell script shows a toast-message notification for the Windows Notification Center. Parameters ---------- ```powershell -PS> ./show-notification.ps1 [[-text] ] [[-title] ] [[-Duration] ] [] +/home/markus/Repos/PowerShell/scripts/show-notification.ps1 [[-text] ] [[-title] ] [[-duration] ] [] -text Specifies the text to show ('Hello World' by default) @@ -26,7 +26,7 @@ PS> ./show-notification.ps1 [[-text] ] [[-title] ] [[-Duration] Accept pipeline input? false Accept wildcard characters? false --Duration +-duration Specifies the view duration in milliseconds (5000 by default) Required? false @@ -43,7 +43,7 @@ PS> ./show-notification.ps1 [[-text] ] [[-title] ] [[-Duration] Example ------- ```powershell -PS> ./show-notification +PS> ./show-notification.ps1 ``` @@ -62,7 +62,7 @@ Script Content .SYNOPSIS Shows a notification .DESCRIPTION - This PowerShell script shows a toast-message notification for the Windows 10 Notification Center. + This PowerShell script shows a toast-message notification for the Windows Notification Center. .PARAMETER text Specifies the text to show ('Hello World' by default) .PARAMETER title @@ -70,14 +70,14 @@ Script Content .PARAMETER duration Specifies the view duration in milliseconds (5000 by default) .EXAMPLE - PS> ./show-notification + PS> ./show-notification.ps1 .LINK https://github.com/fleschutz/PowerShell .NOTES Author: Markus Fleschutz | License: CC0 #> -param([string]$text = "Hello World", [string]$title = "NOTE", [int]$Duration = 5000) +param([string]$text = "Hello World", [string]$title = "NOTE", [int]$duration = 5000) try { Add-Type -AssemblyName System.Windows.Forms @@ -88,7 +88,7 @@ try { $balloon.BalloonTipText = $text $balloon.BalloonTipTitle = $title $balloon.Visible = $true - $balloon.ShowBalloonTip($Duration) + $balloon.ShowBalloonTip($duration) exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -96,4 +96,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of show-notification.ps1 as of 08/15/2024 09:50:54)* +*(generated by convert-ps2md.ps1 using the comment-based help of show-notification.ps1 as of 11/08/2024 12:34:55)* diff --git a/docs/show-traffic.md b/docs/show-traffic.md index 11445b40..080e8f2d 100644 --- a/docs/show-traffic.md +++ b/docs/show-traffic.md @@ -6,7 +6,7 @@ This PowerShell script launches the Web browser with MSN showing the current tra Parameters ---------- ```powershell -PS> ./show-traffic.ps1 [] +/home/markus/Repos/PowerShell/scripts/show-traffic.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of show-traffic.ps1 as of 08/15/2024 09:50:54)* +*(generated by convert-ps2md.ps1 using the comment-based help of show-traffic.ps1 as of 11/08/2024 12:34:55)* diff --git a/docs/simulate-presence.md b/docs/simulate-presence.md index 0d20485b..a43d421d 100644 --- a/docs/simulate-presence.md +++ b/docs/simulate-presence.md @@ -6,7 +6,7 @@ This PowerShell script simulates the human presence against burglars. It switche Parameters ---------- ```powershell -PS> ./simulate-presence.ps1 [[-IPaddress] ] [] +/home/markus/Repos/PowerShell/scripts/simulate-presence.ps1 [[-IPaddress] ] [] -IPaddress Specifies the IP address of the Shelly1 device @@ -66,7 +66,7 @@ try { & "$PSScriptRoot/switch-shelly1.ps1" $IPaddress off 0 Start-Sleep -seconds 60 # off for 60 seconds } - "βœ”οΈ Done." + "βœ… Done." exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -74,4 +74,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of simulate-presence.ps1 as of 08/15/2024 09:50:54)* +*(generated by convert-ps2md.ps1 using the comment-based help of simulate-presence.ps1 as of 11/08/2024 12:34:55)* diff --git a/docs/smart-data2csv.md b/docs/smart-data2csv.md index 1aa5f217..422ed6ed 100644 --- a/docs/smart-data2csv.md +++ b/docs/smart-data2csv.md @@ -7,7 +7,7 @@ to a CSV table for analysis (use query-smart-data.ps1 to generate those JSON fil Parameters ---------- ```powershell -PS> ./smart-data2csv.ps1 [[-Directory] ] [] +/home/markus/Repos/PowerShell/scripts/smart-data2csv.ps1 [[-Directory] ] [] -Directory Specifies the path to the directory @@ -141,4 +141,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of smart-data2csv.ps1 as of 08/15/2024 09:50:54)* +*(generated by convert-ps2md.ps1 using the comment-based help of smart-data2csv.ps1 as of 11/08/2024 12:34:55)* diff --git a/docs/speak-arabic.md b/docs/speak-arabic.md index e9eb563e..1a8aac79 100644 --- a/docs/speak-arabic.md +++ b/docs/speak-arabic.md @@ -6,7 +6,7 @@ This PowerShell script speaks the given text with an Arabic text-to-speech (TTS) Parameters ---------- ```powershell -PS> ./speak-arabic.ps1 [[-text] ] [] +/home/markus/Repos/PowerShell/scripts/speak-arabic.ps1 [[-text] ] [] -text Specifies the Arabic text to speak @@ -75,4 +75,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of speak-arabic.ps1 as of 08/15/2024 09:50:54)* +*(generated by convert-ps2md.ps1 using the comment-based help of speak-arabic.ps1 as of 11/08/2024 12:34:55)* diff --git a/docs/speak-checklist.md b/docs/speak-checklist.md index 91ef9f6e..5345005c 100644 --- a/docs/speak-checklist.md +++ b/docs/speak-checklist.md @@ -6,7 +6,7 @@ This PowerShell script speaks the given checklist by text-to-speech (TTS). Parameters ---------- ```powershell -PS> ./speak-checklist.ps1 [[-Name] ] [] +/home/markus/Repos/PowerShell/scripts/speak-checklist.ps1 [[-Name] ] [] -Name Specifies the name of the checklist @@ -78,4 +78,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of speak-checklist.ps1 as of 08/15/2024 09:50:54)* +*(generated by convert-ps2md.ps1 using the comment-based help of speak-checklist.ps1 as of 11/08/2024 12:34:55)* diff --git a/docs/speak-countdown.md b/docs/speak-countdown.md index 82bc08dd..095c27c1 100644 --- a/docs/speak-countdown.md +++ b/docs/speak-countdown.md @@ -6,7 +6,7 @@ This PowerShell script speaks a countdown by text-to-speech (TTS) starting from Parameters ---------- ```powershell -PS> ./speak-countdown.ps1 [[-StartNumber] ] [] +/home/markus/Repos/PowerShell/scripts/speak-countdown.ps1 [[-StartNumber] ] [] -StartNumber Specifies the number to start from (10 by default) @@ -70,4 +70,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of speak-countdown.ps1 as of 08/15/2024 09:50:54)* +*(generated by convert-ps2md.ps1 using the comment-based help of speak-countdown.ps1 as of 11/08/2024 12:34:55)* diff --git a/docs/speak-croatian.md b/docs/speak-croatian.md index 5045e4e4..2f60482e 100644 --- a/docs/speak-croatian.md +++ b/docs/speak-croatian.md @@ -6,7 +6,7 @@ This PowerShell script speaks the given text with a Croatian text-to-speech (TTS Parameters ---------- ```powershell -PS> ./speak-croatian.ps1 [[-text] ] [] +/home/markus/Repos/PowerShell/scripts/speak-croatian.ps1 [[-text] ] [] -text Specifies the Croatian text to speak @@ -75,4 +75,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of speak-croatian.ps1 as of 08/15/2024 09:50:54)* +*(generated by convert-ps2md.ps1 using the comment-based help of speak-croatian.ps1 as of 11/08/2024 12:34:55)* diff --git a/docs/speak-danish.md b/docs/speak-danish.md index 77b81ce6..46d99631 100644 --- a/docs/speak-danish.md +++ b/docs/speak-danish.md @@ -6,7 +6,7 @@ This PowerShell script speaks the given text with a Danish text-to-speech (TTS) Parameters ---------- ```powershell -PS> ./speak-danish.ps1 [[-text] ] [] +/home/markus/Repos/PowerShell/scripts/speak-danish.ps1 [[-text] ] [] -text Specifies the Danish text to speak @@ -75,4 +75,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of speak-danish.ps1 as of 08/15/2024 09:50:54)* +*(generated by convert-ps2md.ps1 using the comment-based help of speak-danish.ps1 as of 11/08/2024 12:34:55)* diff --git a/docs/speak-dutch.md b/docs/speak-dutch.md index 0241fe14..758de3e3 100644 --- a/docs/speak-dutch.md +++ b/docs/speak-dutch.md @@ -6,7 +6,7 @@ This PowerShell script speaks the given text with a Dutch text-to-speech (TTS) v Parameters ---------- ```powershell -PS> ./speak-dutch.ps1 [[-text] ] [] +/home/markus/Repos/PowerShell/scripts/speak-dutch.ps1 [[-text] ] [] -text Specifies the Dutch text to speak @@ -75,4 +75,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of speak-dutch.ps1 as of 08/15/2024 09:50:54)* +*(generated by convert-ps2md.ps1 using the comment-based help of speak-dutch.ps1 as of 11/08/2024 12:34:55)* diff --git a/docs/speak-english.md b/docs/speak-english.md index 7358137f..22a29a25 100644 --- a/docs/speak-english.md +++ b/docs/speak-english.md @@ -6,7 +6,7 @@ This PowerShell script speaks the given text with an English text-to-speech (TTS Parameters ---------- ```powershell -PS> ./speak-english.ps1 [[-text] ] [] +/home/markus/Repos/PowerShell/scripts/speak-english.ps1 [[-text] ] [] -text Specifies the English text to speak @@ -75,4 +75,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of speak-english.ps1 as of 08/15/2024 09:50:54)* +*(generated by convert-ps2md.ps1 using the comment-based help of speak-english.ps1 as of 11/08/2024 12:34:55)* diff --git a/docs/speak-epub.md b/docs/speak-epub.md index 44978ba0..83e783a7 100644 --- a/docs/speak-epub.md +++ b/docs/speak-epub.md @@ -6,7 +6,7 @@ This PowerShell script speaks the content of the given Epub file by text-to-spee Parameters ---------- ```powershell -PS> ./speak-epub.ps1 [[-Filename] ] [] +/home/markus/Repos/PowerShell/scripts/speak-epub.ps1 [[-Filename] ] [] -Filename Specifies the path to the Epub file @@ -139,4 +139,4 @@ foreach($item in $content.package.manifest.Item) { exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of speak-epub.ps1 as of 08/15/2024 09:50:54)* +*(generated by convert-ps2md.ps1 using the comment-based help of speak-epub.ps1 as of 11/08/2024 12:34:55)* diff --git a/docs/speak-esperanto.md b/docs/speak-esperanto.md index 02ffc322..881e4bbe 100644 --- a/docs/speak-esperanto.md +++ b/docs/speak-esperanto.md @@ -6,7 +6,7 @@ This PowerShell script speaks the given text with an Esperanto text-to-speech (T Parameters ---------- ```powershell -PS> ./speak-esperanto.ps1 [[-text] ] [] +/home/markus/Repos/PowerShell/scripts/speak-esperanto.ps1 [[-text] ] [] -text Specifies the Esperanto text to speak @@ -75,4 +75,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of speak-esperanto.ps1 as of 08/15/2024 09:50:54)* +*(generated by convert-ps2md.ps1 using the comment-based help of speak-esperanto.ps1 as of 11/08/2024 12:34:55)* diff --git a/docs/speak-file.md b/docs/speak-file.md index a9e41549..691e4916 100644 --- a/docs/speak-file.md +++ b/docs/speak-file.md @@ -6,7 +6,7 @@ This PowerShell script speaks the content of the given text file by text-to-spee Parameters ---------- ```powershell -PS> ./speak-file.ps1 [[-File] ] [] +/home/markus/Repos/PowerShell/scripts/speak-file.ps1 [[-File] ] [] -File Specifies the path to the text file @@ -71,4 +71,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of speak-file.ps1 as of 08/15/2024 09:50:54)* +*(generated by convert-ps2md.ps1 using the comment-based help of speak-file.ps1 as of 11/08/2024 12:34:55)* diff --git a/docs/speak-finnish.md b/docs/speak-finnish.md index 52e94f99..8e9f794e 100644 --- a/docs/speak-finnish.md +++ b/docs/speak-finnish.md @@ -6,7 +6,7 @@ This PowerShell script speaks the given text with a Finnish text-to-speech (TTS) Parameters ---------- ```powershell -PS> ./speak-finnish.ps1 [[-text] ] [] +/home/markus/Repos/PowerShell/scripts/speak-finnish.ps1 [[-text] ] [] -text Specifies the Finnish text to speak @@ -75,4 +75,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of speak-finnish.ps1 as of 08/15/2024 09:50:54)* +*(generated by convert-ps2md.ps1 using the comment-based help of speak-finnish.ps1 as of 11/08/2024 12:34:55)* diff --git a/docs/speak-french.md b/docs/speak-french.md index 801899e5..a28c4f72 100644 --- a/docs/speak-french.md +++ b/docs/speak-french.md @@ -6,7 +6,7 @@ This PowerShell script speaks the given text with a French text-to-speech (TTS) Parameters ---------- ```powershell -PS> ./speak-french.ps1 [[-text] ] [] +/home/markus/Repos/PowerShell/scripts/speak-french.ps1 [[-text] ] [] -text Specifies the French text to speak @@ -75,4 +75,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of speak-french.ps1 as of 08/15/2024 09:50:54)* +*(generated by convert-ps2md.ps1 using the comment-based help of speak-french.ps1 as of 11/08/2024 12:34:55)* diff --git a/docs/speak-german.md b/docs/speak-german.md index 20ae4ebf..ec0c1bed 100644 --- a/docs/speak-german.md +++ b/docs/speak-german.md @@ -6,7 +6,7 @@ This PowerShell script speaks the given text with a German text-to-speech (TTS) Parameters ---------- ```powershell -PS> ./speak-german.ps1 [[-text] ] [] +/home/markus/Repos/PowerShell/scripts/speak-german.ps1 [[-text] ] [] -text Specifies the German text to speak @@ -75,4 +75,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of speak-german.ps1 as of 08/15/2024 09:50:54)* +*(generated by convert-ps2md.ps1 using the comment-based help of speak-german.ps1 as of 11/08/2024 12:34:55)* diff --git a/docs/speak-greek.md b/docs/speak-greek.md index dcc991c5..5f005a4f 100644 --- a/docs/speak-greek.md +++ b/docs/speak-greek.md @@ -6,7 +6,7 @@ This PowerShell script speaks the given text with a Greek text-to-speech (TTS) v Parameters ---------- ```powershell -PS> ./speak-greek.ps1 [[-text] ] [] +/home/markus/Repos/PowerShell/scripts/speak-greek.ps1 [[-text] ] [] -text Specifies the Greek text to speak @@ -75,4 +75,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of speak-greek.ps1 as of 08/15/2024 09:50:54)* +*(generated by convert-ps2md.ps1 using the comment-based help of speak-greek.ps1 as of 11/08/2024 12:34:55)* diff --git a/docs/speak-hebrew.md b/docs/speak-hebrew.md index 1f90e0fc..51c5e2d5 100644 --- a/docs/speak-hebrew.md +++ b/docs/speak-hebrew.md @@ -6,7 +6,7 @@ This PowerShell script speaks the given text with a Hebrew text-to-speech (TTS) Parameters ---------- ```powershell -PS> ./speak-hebrew.ps1 [[-text] ] [] +/home/markus/Repos/PowerShell/scripts/speak-hebrew.ps1 [[-text] ] [] -text Specifies the Hebrew text to speak @@ -75,4 +75,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of speak-hebrew.ps1 as of 08/15/2024 09:50:54)* +*(generated by convert-ps2md.ps1 using the comment-based help of speak-hebrew.ps1 as of 11/08/2024 12:34:55)* diff --git a/docs/speak-hindi.md b/docs/speak-hindi.md index e658b961..b774a262 100644 --- a/docs/speak-hindi.md +++ b/docs/speak-hindi.md @@ -6,7 +6,7 @@ This PowerShell script speaks the given text with a Hindi text-to-speech (TTS) v Parameters ---------- ```powershell -PS> ./speak-hindi.ps1 [[-text] ] [] +/home/markus/Repos/PowerShell/scripts/speak-hindi.ps1 [[-text] ] [] -text Specifies the Hindi text to speak @@ -75,4 +75,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of speak-hindi.ps1 as of 08/15/2024 09:50:54)* +*(generated by convert-ps2md.ps1 using the comment-based help of speak-hindi.ps1 as of 11/08/2024 12:34:55)* diff --git a/docs/speak-italian.md b/docs/speak-italian.md index 6cf39db6..ee0597a7 100644 --- a/docs/speak-italian.md +++ b/docs/speak-italian.md @@ -6,7 +6,7 @@ This PowerShell script speaks the given text with an Italian text-to-speech (TTS Parameters ---------- ```powershell -PS> ./speak-italian.ps1 [[-text] ] [] +/home/markus/Repos/PowerShell/scripts/speak-italian.ps1 [[-text] ] [] -text Specifies the Italian text to speak @@ -75,4 +75,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of speak-italian.ps1 as of 08/15/2024 09:50:54)* +*(generated by convert-ps2md.ps1 using the comment-based help of speak-italian.ps1 as of 11/08/2024 12:34:55)* diff --git a/docs/speak-japanese.md b/docs/speak-japanese.md index 87841d17..806ba813 100644 --- a/docs/speak-japanese.md +++ b/docs/speak-japanese.md @@ -6,7 +6,7 @@ This PowerShell script speaks the given text with a Japanese text-to-speech (TTS Parameters ---------- ```powershell -PS> ./speak-japanese.ps1 [[-text] ] [] +/home/markus/Repos/PowerShell/scripts/speak-japanese.ps1 [[-text] ] [] -text Specifies the Japanese text to speak @@ -75,4 +75,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of speak-japanese.ps1 as of 08/15/2024 09:50:54)* +*(generated by convert-ps2md.ps1 using the comment-based help of speak-japanese.ps1 as of 11/08/2024 12:34:55)* diff --git a/docs/speak-korean.md b/docs/speak-korean.md index 9a1ebc49..48937b0b 100644 --- a/docs/speak-korean.md +++ b/docs/speak-korean.md @@ -6,7 +6,7 @@ This PowerShell script speaks the given text with a Korean text-to-speech (TTS) Parameters ---------- ```powershell -PS> ./speak-korean.ps1 [[-text] ] [] +/home/markus/Repos/PowerShell/scripts/speak-korean.ps1 [[-text] ] [] -text Specifies the Korean text to speak @@ -75,4 +75,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of speak-korean.ps1 as of 08/15/2024 09:50:54)* +*(generated by convert-ps2md.ps1 using the comment-based help of speak-korean.ps1 as of 11/08/2024 12:34:55)* diff --git a/docs/speak-latin.md b/docs/speak-latin.md index a55b73c5..9f2682db 100644 --- a/docs/speak-latin.md +++ b/docs/speak-latin.md @@ -6,7 +6,7 @@ This PowerShell script speaks the given text with a Latin text-to-speech (TTS) v Parameters ---------- ```powershell -PS> ./speak-latin.ps1 [[-text] ] [] +/home/markus/Repos/PowerShell/scripts/speak-latin.ps1 [[-text] ] [] -text Specifies the Latin text to speak @@ -75,4 +75,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of speak-latin.ps1 as of 08/15/2024 09:50:54)* +*(generated by convert-ps2md.ps1 using the comment-based help of speak-latin.ps1 as of 11/08/2024 12:34:55)* diff --git a/docs/speak-mandarin.md b/docs/speak-mandarin.md index bd6ec98e..f5f38c93 100644 --- a/docs/speak-mandarin.md +++ b/docs/speak-mandarin.md @@ -6,7 +6,7 @@ This PowerShell script speaks the given text with a Mandarin text-to-speech (TTS Parameters ---------- ```powershell -PS> ./speak-mandarin.ps1 [[-text] ] [] +/home/markus/Repos/PowerShell/scripts/speak-mandarin.ps1 [[-text] ] [] -text Specifies the Mandarin text to speak @@ -75,4 +75,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of speak-mandarin.ps1 as of 08/15/2024 09:50:54)* +*(generated by convert-ps2md.ps1 using the comment-based help of speak-mandarin.ps1 as of 11/08/2024 12:34:55)* diff --git a/docs/speak-norwegian.md b/docs/speak-norwegian.md index 6ccd4f92..be9548cc 100644 --- a/docs/speak-norwegian.md +++ b/docs/speak-norwegian.md @@ -6,7 +6,7 @@ This PowerShell script speaks the given text with a Norwegian text-to-speech (TT Parameters ---------- ```powershell -PS> ./speak-norwegian.ps1 [[-text] ] [] +/home/markus/Repos/PowerShell/scripts/speak-norwegian.ps1 [[-text] ] [] -text Specifies the Norwegian text to speak @@ -75,4 +75,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of speak-norwegian.ps1 as of 08/15/2024 09:50:54)* +*(generated by convert-ps2md.ps1 using the comment-based help of speak-norwegian.ps1 as of 11/08/2024 12:34:55)* diff --git a/docs/speak-polish.md b/docs/speak-polish.md index 2ad0c546..8f413378 100644 --- a/docs/speak-polish.md +++ b/docs/speak-polish.md @@ -6,7 +6,7 @@ This PowerShell script speaks the given text with a Polish text-to-speech (TTS) Parameters ---------- ```powershell -PS> ./speak-polish.ps1 [[-text] ] [] +/home/markus/Repos/PowerShell/scripts/speak-polish.ps1 [[-text] ] [] -text Specifies the Polish text to speak @@ -75,4 +75,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of speak-polish.ps1 as of 08/15/2024 09:50:54)* +*(generated by convert-ps2md.ps1 using the comment-based help of speak-polish.ps1 as of 11/08/2024 12:34:55)* diff --git a/docs/speak-portuguese.md b/docs/speak-portuguese.md index 81e9d590..a05f11d4 100644 --- a/docs/speak-portuguese.md +++ b/docs/speak-portuguese.md @@ -6,7 +6,7 @@ This PowerShell script speaks the given text with a Portuguese text-to-speech (T Parameters ---------- ```powershell -PS> ./speak-portuguese.ps1 [[-text] ] [] +/home/markus/Repos/PowerShell/scripts/speak-portuguese.ps1 [[-text] ] [] -text Specifies the Portuguese text to speak @@ -75,4 +75,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of speak-portuguese.ps1 as of 08/15/2024 09:50:54)* +*(generated by convert-ps2md.ps1 using the comment-based help of speak-portuguese.ps1 as of 11/08/2024 12:34:55)* diff --git a/docs/speak-russian.md b/docs/speak-russian.md index 651afbc3..deb65874 100644 --- a/docs/speak-russian.md +++ b/docs/speak-russian.md @@ -6,7 +6,7 @@ This PowerShell script speaks the text with a Russian text-to-speech (TTS) voice Parameters ---------- ```powershell -PS> ./speak-russian.ps1 [[-text] ] [] +/home/markus/Repos/PowerShell/scripts/speak-russian.ps1 [[-text] ] [] -text Specifies the Russian text @@ -75,4 +75,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of speak-russian.ps1 as of 08/15/2024 09:50:54)* +*(generated by convert-ps2md.ps1 using the comment-based help of speak-russian.ps1 as of 11/08/2024 12:34:55)* diff --git a/docs/speak-spanish.md b/docs/speak-spanish.md index 6a9683af..08b60f14 100644 --- a/docs/speak-spanish.md +++ b/docs/speak-spanish.md @@ -6,7 +6,7 @@ This PowerShell script speaks the given text with a Spanish text-to-speech (TTS) Parameters ---------- ```powershell -PS> ./speak-spanish.ps1 [[-text] ] [] +/home/markus/Repos/PowerShell/scripts/speak-spanish.ps1 [[-text] ] [] -text Specifies the Spanish text to speak @@ -75,4 +75,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of speak-spanish.ps1 as of 08/15/2024 09:50:54)* +*(generated by convert-ps2md.ps1 using the comment-based help of speak-spanish.ps1 as of 11/08/2024 12:34:55)* diff --git a/docs/speak-swedish.md b/docs/speak-swedish.md index d21abf29..37f84bd1 100644 --- a/docs/speak-swedish.md +++ b/docs/speak-swedish.md @@ -6,7 +6,7 @@ This PowerShell script speaks the given text with a Swedish text-to-speech (TTS) Parameters ---------- ```powershell -PS> ./speak-swedish.ps1 [[-text] ] [] +/home/markus/Repos/PowerShell/scripts/speak-swedish.ps1 [[-text] ] [] -text Specifies the Swedish text to speak @@ -75,4 +75,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of speak-swedish.ps1 as of 08/15/2024 09:50:54)* +*(generated by convert-ps2md.ps1 using the comment-based help of speak-swedish.ps1 as of 11/08/2024 12:34:55)* diff --git a/docs/speak-test.md b/docs/speak-test.md index 698759d0..2e63b47b 100644 --- a/docs/speak-test.md +++ b/docs/speak-test.md @@ -83,4 +83,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of speak-test.ps1 as of 08/15/2024 09:50:54)* +*(generated by convert-ps2md.ps1 using the comment-based help of speak-test.ps1 as of 11/08/2024 12:34:55)* diff --git a/docs/speak-text.md b/docs/speak-text.md index 0009faac..26d56a51 100644 --- a/docs/speak-text.md +++ b/docs/speak-text.md @@ -6,7 +6,7 @@ This PowerShell script speaks the given text by the default text-to-speech (TTS) Parameters ---------- ```powershell -PS> ./speak-text.ps1 [[-text] ] [] +/home/markus/Repos/PowerShell/scripts/speak-text.ps1 [[-text] ] [] -text Specifies the text to read @@ -69,4 +69,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of speak-text.ps1 as of 08/15/2024 09:50:54)* +*(generated by convert-ps2md.ps1 using the comment-based help of speak-text.ps1 as of 11/08/2024 12:34:55)* diff --git a/docs/speak-thai.md b/docs/speak-thai.md index c33297d9..380ea162 100644 --- a/docs/speak-thai.md +++ b/docs/speak-thai.md @@ -6,7 +6,7 @@ This PowerShell script speaks the given text with a Thai text-to-speech (TTS) vo Parameters ---------- ```powershell -PS> ./speak-thai.ps1 [[-text] ] [] +/home/markus/Repos/PowerShell/scripts/speak-thai.ps1 [[-text] ] [] -text Specifies the Thai text to speak @@ -75,4 +75,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of speak-thai.ps1 as of 08/15/2024 09:50:54)* +*(generated by convert-ps2md.ps1 using the comment-based help of speak-thai.ps1 as of 11/08/2024 12:34:55)* diff --git a/docs/speak-turkish.md b/docs/speak-turkish.md index 3ea3a3e3..fc18102c 100644 --- a/docs/speak-turkish.md +++ b/docs/speak-turkish.md @@ -6,7 +6,7 @@ This PowerShell script speaks the given text with a Turkish text-to-speech (TTS) Parameters ---------- ```powershell -PS> ./speak-turkish.ps1 [[-text] ] [] +/home/markus/Repos/PowerShell/scripts/speak-turkish.ps1 [[-text] ] [] -text Specifies the Turkish text to speak @@ -75,4 +75,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of speak-turkish.ps1 as of 08/15/2024 09:50:54)* +*(generated by convert-ps2md.ps1 using the comment-based help of speak-turkish.ps1 as of 11/08/2024 12:34:55)* diff --git a/docs/speak-ukrainian.md b/docs/speak-ukrainian.md index fee7ff38..76a6720c 100644 --- a/docs/speak-ukrainian.md +++ b/docs/speak-ukrainian.md @@ -6,7 +6,7 @@ This PowerShell script speaks the given text with a Ukrainian text-to-speech (TT Parameters ---------- ```powershell -PS> ./speak-ukrainian.ps1 [[-text] ] [] +/home/markus/Repos/PowerShell/scripts/speak-ukrainian.ps1 [[-text] ] [] -text Specifies the Ukranian text to speak @@ -75,4 +75,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of speak-ukrainian.ps1 as of 08/15/2024 09:50:54)* +*(generated by convert-ps2md.ps1 using the comment-based help of speak-ukrainian.ps1 as of 11/08/2024 12:34:55)* diff --git a/docs/spell-word.md b/docs/spell-word.md index 6a3ae9cc..10589c9d 100644 --- a/docs/spell-word.md +++ b/docs/spell-word.md @@ -6,7 +6,7 @@ This PowerShell script spells the given word by text-to-speech (TTS). Parameters ---------- ```powershell -PS> ./spell-word.ps1 [[-word] ] [] +/home/markus/Repos/PowerShell/scripts/spell-word.ps1 [[-word] ] [] -word Specifies the word to spell @@ -74,4 +74,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of spell-word.ps1 as of 08/15/2024 09:50:54)* +*(generated by convert-ps2md.ps1 using the comment-based help of spell-word.ps1 as of 11/08/2024 12:34:55)* diff --git a/docs/start-ipfs-server.md b/docs/start-ipfs-server.md index ec4d89a4..f4ccade9 100644 --- a/docs/start-ipfs-server.md +++ b/docs/start-ipfs-server.md @@ -6,7 +6,7 @@ This PowerShell script starts a local IPFS server as a daemon process. Parameters ---------- ```powershell -PS> ./start-ipfs-server.ps1 [] +/home/markus/Repos/PowerShell/scripts/start-ipfs-server.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -81,7 +81,7 @@ try { Start-Process nohup -ArgumentList 'ipfs','daemon' -RedirectStandardOutput "$HOME/console.out" -RedirectStandardError "$HOME/console.err" [int]$Elapsed = $StopWatch.Elapsed.TotalSeconds - "βœ”οΈ started IPFS server in $Elapsed sec" + "βœ… started IPFS server in $Elapsed sec" "⚠️ NOTE: make sure your router does not block TCP/UDP port 4001 for IPv4 and IPv6" exit 0 # success } catch { @@ -90,4 +90,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of start-ipfs-server.ps1 as of 08/15/2024 09:50:54)* +*(generated by convert-ps2md.ps1 using the comment-based help of start-ipfs-server.ps1 as of 11/08/2024 12:34:55)* diff --git a/docs/suspend.md b/docs/suspend.md index dc379507..49c35627 100644 --- a/docs/suspend.md +++ b/docs/suspend.md @@ -6,7 +6,7 @@ This PowerShell script suspends the local computer immediately. Parameters ---------- ```powershell -PS> ./suspend.ps1 [] +/home/markus/Repos/PowerShell/scripts/suspend.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -54,4 +54,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of suspend.ps1 as of 08/15/2024 09:50:54)* +*(generated by convert-ps2md.ps1 using the comment-based help of suspend.ps1 as of 11/08/2024 12:34:55)* diff --git a/docs/switch-branch.md b/docs/switch-branch.md index da741375..e96caa22 100644 --- a/docs/switch-branch.md +++ b/docs/switch-branch.md @@ -6,7 +6,7 @@ This PowerShell script switches to the given branch in a Git repository and also Parameters ---------- ```powershell -PS> ./switch-branch.ps1 [[-branchName] ] [[-pathToRepo] ] [] +/home/markus/Repos/PowerShell/scripts/switch-branch.ps1 [[-branchName] ] [[-pathToRepo] ] [] -branchName Specifies the Git branch name to switch to @@ -41,7 +41,7 @@ PS> ./switch-branch main ⏳ (4/6) Switching to branch 'main'... ⏳ (5/6) Pulling remote updates... ⏳ (6/6) Updating submodules... -βœ”οΈ Switched πŸ“‚rust repo to 'main' branch in 22s. +βœ… Switched πŸ“‚rust repo to 'main' branch in 22s. ``` @@ -73,7 +73,7 @@ Script Content ⏳ (4/6) Switching to branch 'main'... ⏳ (5/6) Pulling remote updates... ⏳ (6/6) Updating submodules... - βœ”οΈ Switched πŸ“‚rust repo to 'main' branch in 22s. + βœ… Switched πŸ“‚rust repo to 'main' branch in 22s. .LINK https://github.com/fleschutz/PowerShell .NOTES @@ -118,7 +118,7 @@ try { if ($lastExitCode -ne "0") { throw "'git submodule update' failed with exit code $lastExitCode" } [int]$elapsed = $stopWatch.Elapsed.TotalSeconds - "βœ”οΈ Switched πŸ“‚$repoDirName repo to '$branchName' branch in $($elapsed)s." + "βœ… Switched πŸ“‚$repoDirName repo to '$branchName' branch in $($elapsed)s." exit 0 # success } catch { "⚠️ Error: $($Error[0]) in script line $($_.InvocationInfo.ScriptLineNumber)" @@ -126,4 +126,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of switch-branch.ps1 as of 08/15/2024 09:50:54)* +*(generated by convert-ps2md.ps1 using the comment-based help of switch-branch.ps1 as of 11/08/2024 12:34:55)* diff --git a/docs/switch-shelly1.md b/docs/switch-shelly1.md index 28d77cea..0ffe016c 100644 --- a/docs/switch-shelly1.md +++ b/docs/switch-shelly1.md @@ -6,9 +6,9 @@ This PowerShell script switches a Shelly1 device in the local network. Parameters ---------- ```powershell -PS> ./switch-shelly1.ps1 [[-Host] ] [[-TurnMode] ] [[-Timer] ] [] +/home/markus/Repos/PowerShell/scripts/switch-shelly1.ps1 [[-host] ] [[-turnMode] ] [[-timer] ] [] --Host +-host Specifies either the hostname or IP address of the Shelly1 device Required? false @@ -17,7 +17,7 @@ PS> ./switch-shelly1.ps1 [[-Host] ] [[-TurnMode] ] [[-Timer] +-turnMode Specifies either 'on', 'off', or 'toggle' Required? false @@ -26,7 +26,7 @@ PS> ./switch-shelly1.ps1 [[-Host] ] [[-TurnMode] ] [[-Timer] +-timer Specifies the timer in seconds (0 = infinite) Required? false @@ -63,11 +63,11 @@ Script Content Switches a Shelly1 device .DESCRIPTION This PowerShell script switches a Shelly1 device in the local network. -.PARAMETER Host +.PARAMETER host Specifies either the hostname or IP address of the Shelly1 device -.PARAMETER TurnMode +.PARAMETER turnMode Specifies either 'on', 'off', or 'toggle' -.PARAMETER Timer +.PARAMETER timer Specifies the timer in seconds (0 = infinite) .EXAMPLE PS> ./switch-shelly1 192.168.100.100 toggle 10 @@ -77,16 +77,16 @@ Script Content Author: Markus Fleschutz | License: CC0 #> -param([string]$Host = "", [string]$TurnMode = "", [int]$Timer = -999) +param([string]$host = "", [string]$turnMode = "", [int]$timer = -999) try { - if ($Host -eq "") { $Host = read-host "Enter hostname or IP address of the Shelly1 device" } - if ($TurnMode -eq "") { $TurnMode = read-host "Enter turn mode (on/off/toggle)" } - if ($Timer -eq -999) { [int]$Timer = read-host "Enter timer in seconds (0=endless)" } + if ($host -eq "") { $host = Read-Host "Enter the hostname or IP address of the Shelly1 device" } + if ($turnMode -eq "") { $turnMode = Read-Host "Enter the turn mode (on/off/toggle)" } + if ($timer -eq -999) { [int]$timer = Read-Host "Enter the timer in seconds (0=endless)" } - $Result = Invoke-RestMethod "http://$($Host)/relay/0?turn=$($TurnMode)&timer=$($Timer)" + $result = Invoke-RestMethod "http://$($host)/relay/0?turn=$($turnMode)&timer=$($timer)" - "βœ”οΈ switched Shelly1 device at $Host to $TurnMode for $Timer sec" + "βœ… Switched Shelly1 device at $host to $turnMode for $timer sec." exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -94,4 +94,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of switch-shelly1.ps1 as of 08/15/2024 09:50:54)* +*(generated by convert-ps2md.ps1 using the comment-based help of switch-shelly1.ps1 as of 11/08/2024 12:34:55)* diff --git a/docs/switch-tabs.md b/docs/switch-tabs.md index 6dc216a7..c7dcd115 100644 --- a/docs/switch-tabs.md +++ b/docs/switch-tabs.md @@ -6,7 +6,7 @@ This PowerShell script switches automatically from tab to tab every seconds Parameters ---------- ```powershell -PS> ./switch-tabs.ps1 [[-timeInterval] ] [] +/home/markus/Repos/PowerShell/scripts/switch-tabs.ps1 [[-timeInterval] ] [] -timeInterval Specifies the time interval in seconds (10sec per default) @@ -76,4 +76,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of switch-tabs.ps1 as of 08/15/2024 09:50:54)* +*(generated by convert-ps2md.ps1 using the comment-based help of switch-tabs.ps1 as of 11/08/2024 12:34:55)* diff --git a/docs/sync-folder.md b/docs/sync-folder.md index 6c91c567..510d4bfe 100644 --- a/docs/sync-folder.md +++ b/docs/sync-folder.md @@ -8,7 +8,7 @@ IMPORTANT NOTE: Make sure the target path is correct because the content gets re Parameters ---------- ```powershell -PS> ./sync-folder.ps1 [[-sourcePath] ] [[-targetPath] ] [] +/home/markus/Repos/PowerShell/scripts/sync-folder.ps1 [[-sourcePath] ] [[-targetPath] ] [] -sourcePath Specifies the path to the source folder @@ -88,7 +88,7 @@ try { if ($lastExitCode -gt 3) { throw 'Robocopy failed.' } [int]$elapsed = $stopWatch.Elapsed.TotalSeconds - "βœ”οΈ Synced πŸ“‚$sourcePath to πŸ“‚$targetPath in $elapsed sec" + "βœ… Synced πŸ“‚$sourcePath to πŸ“‚$targetPath in $elapsed sec" exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -96,4 +96,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of sync-folder.ps1 as of 08/15/2024 09:50:54)* +*(generated by convert-ps2md.ps1 using the comment-based help of sync-folder.ps1 as of 11/08/2024 12:34:55)* diff --git a/docs/sync-repo.md b/docs/sync-repo.md index e4b9f174..17839d28 100644 --- a/docs/sync-repo.md +++ b/docs/sync-repo.md @@ -6,10 +6,10 @@ This PowerShell script synchronizes a local Git repository by pull and push (inc Parameters ---------- ```powershell -PS> ./sync-repo.ps1 [[-path] ] [] +/home/markus/Repos/PowerShell/scripts/sync-repo.ps1 [[-path] ] [] -path - Specifies the path to the Git repository + Specifies the path to the Git repository (current working directory by default) Required? false Position? 1 @@ -25,12 +25,12 @@ PS> ./sync-repo.ps1 [[-path] ] [] Example ------- ```powershell -PS> ./sync-repo.ps1 C:\MyRepo +PS> ./sync-repo.ps1 C:\Repos\curl ⏳ (1/4) Searching for Git executable... git version 2.42.0.windows.1 -⏳ (2/4) Checking local repository... πŸ“‚C:\MyRepo +⏳ (2/4) Checking local repository... C:\Repos\curl ⏳ (3/4) Pulling remote updates... Already up to date. ⏳ (4/4) Pushing local updates... Everything up-to-date -βœ”οΈ Synced repo πŸ“‚MyRepo in 5 sec +βœ… Synced the πŸ“‚curl repo in 5s. ``` @@ -51,14 +51,14 @@ Script Content .DESCRIPTION This PowerShell script synchronizes a local Git repository by pull and push (including submodules). .PARAMETER path - Specifies the path to the Git repository + Specifies the path to the Git repository (current working directory by default) .EXAMPLE - PS> ./sync-repo.ps1 C:\MyRepo + PS> ./sync-repo.ps1 C:\Repos\curl ⏳ (1/4) Searching for Git executable... git version 2.42.0.windows.1 - ⏳ (2/4) Checking local repository... πŸ“‚C:\MyRepo + ⏳ (2/4) Checking local repository... C:\Repos\curl ⏳ (3/4) Pulling remote updates... Already up to date. ⏳ (4/4) Pushing local updates... Everything up-to-date - βœ”οΈ Synced repo πŸ“‚MyRepo in 5 sec + βœ… Synced the πŸ“‚curl repo in 5s. .LINK https://github.com/fleschutz/PowerShell .NOTES @@ -68,26 +68,26 @@ Script Content param([string]$path = "$PWD") try { - $StopWatch = [system.diagnostics.stopwatch]::startNew() + $stopWatch = [system.diagnostics.stopwatch]::startNew() Write-Host "⏳ (1/4) Searching for Git executable... " -noNewline & git --version if ($lastExitCode -ne "0") { throw "Can't execute 'git' - make sure Git is installed and available" } - Write-Host "⏳ (2/4) Checking local repository... πŸ“‚$path" + Write-Host "⏳ (2/4) Checking local repository... $path" if (!(Test-Path "$path" -pathType container)) { throw "Can't access folder: $path" } - $pathName = (Get-Item "$path").Name Write-Host "⏳ (3/4) Pulling remote updates... " -noNewline - & git -C "$Path" pull --all --recurse-submodules + & git -C "$path" pull --all --recurse-submodules if ($lastExitCode -ne "0") { throw "'git pull --all --recurse-submodes' failed" } Write-Host "⏳ (4/4) Pushing local updates... " -noNewline - & git -C "$Path" push + & git -C "$path" push if ($lastExitCode -ne "0") { throw "'git push' failed" } - [int]$Elapsed = $StopWatch.Elapsed.TotalSeconds - "βœ”οΈ Synced repo πŸ“‚$pathName in $Elapsed sec" + $pathName = (Get-Item "$path").Name + [int]$elapsed = $stopWatch.Elapsed.TotalSeconds + "βœ… Synced the πŸ“‚$pathName repo in $($elapsed)s." exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -95,4 +95,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of sync-repo.ps1 as of 08/15/2024 09:50:54)* +*(generated by convert-ps2md.ps1 using the comment-based help of sync-repo.ps1 as of 11/08/2024 12:34:55)* diff --git a/docs/tell-joke.md b/docs/tell-joke.md index 8da7aceb..3f89b49a 100644 --- a/docs/tell-joke.md +++ b/docs/tell-joke.md @@ -6,7 +6,7 @@ This PowerShell script selects a random Chuck Norris joke in Data/jokes.csv and Parameters ---------- ```powershell -PS> ./tell-joke.ps1 [] +/home/markus/Repos/PowerShell/scripts/tell-joke.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -60,4 +60,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of tell-joke.ps1 as of 08/15/2024 09:50:54)* +*(generated by convert-ps2md.ps1 using the comment-based help of tell-joke.ps1 as of 11/08/2024 12:34:55)* diff --git a/docs/tell-new-year.md b/docs/tell-new-year.md index deca451e..52ce87c3 100644 --- a/docs/tell-new-year.md +++ b/docs/tell-new-year.md @@ -6,7 +6,7 @@ This PowerShell script calculates the time until New Year and replies by text-to Parameters ---------- ```powershell -PS> ./tell-new-year.ps1 [] +/home/markus/Repos/PowerShell/scripts/tell-new-year.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -62,4 +62,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of tell-new-year.ps1 as of 08/15/2024 09:50:54)* +*(generated by convert-ps2md.ps1 using the comment-based help of tell-new-year.ps1 as of 11/08/2024 12:34:55)* diff --git a/docs/tell-quote.md b/docs/tell-quote.md index 133c8aef..e0126402 100644 --- a/docs/tell-quote.md +++ b/docs/tell-quote.md @@ -6,7 +6,7 @@ This PowerShell script selects a random quote from Data/quotes.csv and speaks it Parameters ---------- ```powershell -PS> ./tell-quote.ps1 [] +/home/markus/Repos/PowerShell/scripts/tell-quote.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -60,4 +60,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of tell-quote.ps1 as of 08/15/2024 09:50:54)* +*(generated by convert-ps2md.ps1 using the comment-based help of tell-quote.ps1 as of 11/08/2024 12:34:55)* diff --git a/docs/toggle-caps-lock.md b/docs/toggle-caps-lock.md index 95d3f314..f557e4c4 100644 --- a/docs/toggle-caps-lock.md +++ b/docs/toggle-caps-lock.md @@ -6,7 +6,7 @@ This PowerShell script toggles the Caps Lock key state. Parameters ---------- ```powershell -PS> ./toggle-caps-lock.ps1 [] +/home/markus/Repos/PowerShell/scripts/toggle-caps-lock.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -54,4 +54,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of toggle-caps-lock.ps1 as of 08/15/2024 09:50:54)* +*(generated by convert-ps2md.ps1 using the comment-based help of toggle-caps-lock.ps1 as of 11/08/2024 12:34:55)* diff --git a/docs/toggle-num-lock.md b/docs/toggle-num-lock.md index 0b44f86c..3fd5f39a 100644 --- a/docs/toggle-num-lock.md +++ b/docs/toggle-num-lock.md @@ -6,7 +6,7 @@ This PowerShell script toggles the Num Lock key state. Parameters ---------- ```powershell -PS> ./toggle-num-lock.ps1 [] +/home/markus/Repos/PowerShell/scripts/toggle-num-lock.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -54,4 +54,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of toggle-num-lock.ps1 as of 08/15/2024 09:50:54)* +*(generated by convert-ps2md.ps1 using the comment-based help of toggle-num-lock.ps1 as of 11/08/2024 12:34:55)* diff --git a/docs/toggle-scroll-lock.md b/docs/toggle-scroll-lock.md index 3fc4b082..0a7e70f0 100644 --- a/docs/toggle-scroll-lock.md +++ b/docs/toggle-scroll-lock.md @@ -6,7 +6,7 @@ This PowerShell script toggles the Scroll Lock key state. Parameters ---------- ```powershell -PS> ./toggle-scroll-lock.ps1 [] +/home/markus/Repos/PowerShell/scripts/toggle-scroll-lock.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -54,4 +54,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of toggle-scroll-lock.ps1 as of 08/15/2024 09:50:54)* +*(generated by convert-ps2md.ps1 using the comment-based help of toggle-scroll-lock.ps1 as of 11/08/2024 12:34:55)* diff --git a/docs/translate-file.md b/docs/translate-file.md index ec849daa..fb868919 100644 --- a/docs/translate-file.md +++ b/docs/translate-file.md @@ -6,7 +6,7 @@ This PowerShell script translates the given text file into another language and Parameters ---------- ```powershell -PS> ./translate-file.ps1 [[-File] ] [[-SourceLang] ] [[-TargetLang] ] [] +/home/markus/Repos/PowerShell/scripts/translate-file.ps1 [[-File] ] [[-SourceLang] ] [[-TargetLang] ] [] -File Specifies the path to the file to be translated @@ -108,4 +108,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of translate-file.ps1 as of 08/15/2024 09:50:54)* +*(generated by convert-ps2md.ps1 using the comment-based help of translate-file.ps1 as of 11/08/2024 12:34:56)* diff --git a/docs/translate-files.md b/docs/translate-files.md index fcb3eea1..d5948058 100644 --- a/docs/translate-files.md +++ b/docs/translate-files.md @@ -6,7 +6,7 @@ This PowerShell script translates text files into multiple languages. Parameters ---------- ```powershell -PS> ./translate-files.ps1 [[-filePattern] ] [] +/home/markus/Repos/PowerShell/scripts/translate-files.ps1 [[-filePattern] ] [] -filePattern Specifies the file pattern of the text file(s) to be translated @@ -105,4 +105,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of translate-files.ps1 as of 08/15/2024 09:50:54)* +*(generated by convert-ps2md.ps1 using the comment-based help of translate-files.ps1 as of 11/08/2024 12:34:56)* diff --git a/docs/translate-text.md b/docs/translate-text.md index 217df4cc..d335c4d6 100644 --- a/docs/translate-text.md +++ b/docs/translate-text.md @@ -6,7 +6,7 @@ This PowerShell script translates text into other languages. Parameters ---------- ```powershell -PS> ./translate-text.ps1 [[-Text] ] [[-SourceLangCode] ] [[-TargetLangCode] ] [] +/home/markus/Repos/PowerShell/scripts/translate-text.ps1 [[-Text] ] [[-SourceLangCode] ] [[-TargetLangCode] ] [] -Text Specifies the text to translate @@ -104,4 +104,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of translate-text.ps1 as of 08/15/2024 09:50:54)* +*(generated by convert-ps2md.ps1 using the comment-based help of translate-text.ps1 as of 11/08/2024 12:34:56)* diff --git a/docs/turn-volume-down.md b/docs/turn-volume-down.md index a8b17863..52ff9c03 100644 --- a/docs/turn-volume-down.md +++ b/docs/turn-volume-down.md @@ -6,7 +6,7 @@ This PowerShell script turns the audio volume down (-10% by default). Parameters ---------- ```powershell -PS> ./turn-volume-down.ps1 [[-percent] ] [] +/home/markus/Repos/PowerShell/scripts/turn-volume-down.ps1 [[-percent] ] [] -percent Specifies the percent number @@ -69,4 +69,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of turn-volume-down.ps1 as of 08/15/2024 09:50:54)* +*(generated by convert-ps2md.ps1 using the comment-based help of turn-volume-down.ps1 as of 11/08/2024 12:34:56)* diff --git a/docs/turn-volume-fully-up.md b/docs/turn-volume-fully-up.md index d51f419c..5e61d1b7 100644 --- a/docs/turn-volume-fully-up.md +++ b/docs/turn-volume-fully-up.md @@ -6,7 +6,7 @@ This PowerShell script turns the audio volume fully up to 100%. Parameters ---------- ```powershell -PS> ./turn-volume-fully-up.ps1 [] +/home/markus/Repos/PowerShell/scripts/turn-volume-fully-up.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -56,4 +56,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of turn-volume-fully-up.ps1 as of 08/15/2024 09:50:54)* +*(generated by convert-ps2md.ps1 using the comment-based help of turn-volume-fully-up.ps1 as of 11/08/2024 12:34:56)* diff --git a/docs/turn-volume-off.md b/docs/turn-volume-off.md index 89075efa..772459a9 100644 --- a/docs/turn-volume-off.md +++ b/docs/turn-volume-off.md @@ -6,7 +6,7 @@ This PowerShell script mutes the default audio device immediately. Parameters ---------- ```powershell -PS> ./turn-volume-off.ps1 [] +/home/markus/Repos/PowerShell/scripts/turn-volume-off.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -54,4 +54,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of turn-volume-off.ps1 as of 08/15/2024 09:50:54)* +*(generated by convert-ps2md.ps1 using the comment-based help of turn-volume-off.ps1 as of 11/08/2024 12:34:56)* diff --git a/docs/turn-volume-on.md b/docs/turn-volume-on.md index b8ba3629..8fa0d788 100644 --- a/docs/turn-volume-on.md +++ b/docs/turn-volume-on.md @@ -6,7 +6,7 @@ This PowerShell script immediately unmutes the audio output. Parameters ---------- ```powershell -PS> ./turn-volume-on.ps1 [] +/home/markus/Repos/PowerShell/scripts/turn-volume-on.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -54,4 +54,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of turn-volume-on.ps1 as of 08/15/2024 09:50:54)* +*(generated by convert-ps2md.ps1 using the comment-based help of turn-volume-on.ps1 as of 11/08/2024 12:34:56)* diff --git a/docs/turn-volume-up.md b/docs/turn-volume-up.md index 5bbd9775..7c97748c 100644 --- a/docs/turn-volume-up.md +++ b/docs/turn-volume-up.md @@ -6,7 +6,7 @@ This PowerShell script turns the audio volume up (+10% by default). Parameters ---------- ```powershell -PS> ./turn-volume-up.ps1 [[-percent] ] [] +/home/markus/Repos/PowerShell/scripts/turn-volume-up.ps1 [[-percent] ] [] -percent Specifies the percent number @@ -69,4 +69,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of turn-volume-up.ps1 as of 08/15/2024 09:50:54)* +*(generated by convert-ps2md.ps1 using the comment-based help of turn-volume-up.ps1 as of 11/08/2024 12:34:56)* diff --git a/docs/uninstall-all-apps.md b/docs/uninstall-all-apps.md index ad7712c8..16a791eb 100644 --- a/docs/uninstall-all-apps.md +++ b/docs/uninstall-all-apps.md @@ -6,7 +6,7 @@ This PowerShell script uninstalls all applications from the local computer. Usef Parameters ---------- ```powershell -PS> ./uninstall-all-apps.ps1 [] +/home/markus/Repos/PowerShell/scripts/uninstall-all-apps.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -57,4 +57,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of uninstall-all-apps.ps1 as of 08/15/2024 09:50:54)* +*(generated by convert-ps2md.ps1 using the comment-based help of uninstall-all-apps.ps1 as of 11/08/2024 12:34:56)* diff --git a/docs/uninstall-bloatware.md b/docs/uninstall-bloatware.md index a35b2d62..b3f9e018 100644 --- a/docs/uninstall-bloatware.md +++ b/docs/uninstall-bloatware.md @@ -6,7 +6,7 @@ This PowerShell script uninstalls unnecessary software and applications. Parameters ---------- ```powershell -PS> ./uninstall-bloatware.ps1 [] +/home/markus/Repos/PowerShell/scripts/uninstall-bloatware.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -94,8 +94,8 @@ winget uninstall 'Netflix' winget uninstall 'LinkedIn' winget uninstall 'Prime Video for Windows' -"βœ”οΈ Finished" +"βœ… Finished" exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of uninstall-bloatware.ps1 as of 08/15/2024 09:50:54)* +*(generated by convert-ps2md.ps1 using the comment-based help of uninstall-bloatware.ps1 as of 11/08/2024 12:34:56)* diff --git a/docs/update-powershell-profile.md b/docs/update-powershell-profile.md index 69efa4c6..747a281f 100644 --- a/docs/update-powershell-profile.md +++ b/docs/update-powershell-profile.md @@ -6,7 +6,7 @@ This PowerShell script write/overwrites the PowerShell profile of the current us Parameters ---------- ```powershell -PS> ./update-powershell-profile.ps1 [[-path] ] [] +/home/markus/Repos/PowerShell/scripts/update-powershell-profile.ps1 [[-path] ] [] -path Specifies the path to the new profile ($PSScriptRoot/my-profile.ps1 by default) @@ -28,7 +28,7 @@ Example PS> ./update-powershell-profile.ps1 ⏳ (1/2) Querying path to PowerShell profile 'CurrentUserCurrentHost'... ⏳ (2/2) Copying my-profile.ps1 to /home/Markus/.config/powershell/Microsoft.PowerShell_profile.ps1... -βœ”οΈ PowerShell profile updated - it get's active on next login. +βœ… Updated your PowerShell profile, it get's active on next login. ``` @@ -54,7 +54,7 @@ Script Content PS> ./update-powershell-profile.ps1 ⏳ (1/2) Querying path to PowerShell profile 'CurrentUserCurrentHost'... ⏳ (2/2) Copying my-profile.ps1 to /home/Markus/.config/powershell/Microsoft.PowerShell_profile.ps1... - βœ”οΈ PowerShell profile updated - it get's active on next login. + βœ… Updated your PowerShell profile, it get's active on next login. .LINK https://github.com/fleschutz/PowerShell .NOTES @@ -72,7 +72,7 @@ try { $null = New-Item -Path $pathToProfile -ItemType "file" -Force Copy-Item "$path" "$pathToProfile" -force - "βœ”οΈ PowerShell profile updated - it get's active on next login." + "βœ… Updated your PowerShell profile, it get's active on next login." exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -80,4 +80,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of update-powershell-profile.ps1 as of 08/15/2024 09:50:55)* +*(generated by convert-ps2md.ps1 using the comment-based help of update-powershell-profile.ps1 as of 11/08/2024 12:34:56)* diff --git a/docs/upgrade-ubuntu.md b/docs/upgrade-ubuntu.md index ee0e3687..1ebee399 100644 --- a/docs/upgrade-ubuntu.md +++ b/docs/upgrade-ubuntu.md @@ -6,7 +6,7 @@ This PowerShell script upgrades Ubuntu Linux to the latest (LTS) release. Parameters ---------- ```powershell -PS> ./upgrade-ubuntu.ps1 [] +/home/markus/Repos/PowerShell/scripts/upgrade-ubuntu.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -79,7 +79,7 @@ try { sudo reboot } - "βœ”οΈ Done." + "βœ… Done." exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -87,4 +87,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of upgrade-ubuntu.ps1 as of 08/15/2024 09:50:55)* +*(generated by convert-ps2md.ps1 using the comment-based help of upgrade-ubuntu.ps1 as of 11/08/2024 12:34:56)* diff --git a/docs/upload-file.md b/docs/upload-file.md index b315334b..9eaf48b1 100644 --- a/docs/upload-file.md +++ b/docs/upload-file.md @@ -6,7 +6,7 @@ This PowerShell script uploads a local file to a FTP server. Parameters ---------- ```powershell -PS> ./upload-file.ps1 [[-File] ] [[-URL] ] [[-Username] ] [[-Password] ] [] +/home/markus/Repos/PowerShell/scripts/upload-file.ps1 [[-File] ] [[-URL] ] [[-Username] ] [[-Password] ] [] -File Specifies the path to the local file @@ -136,7 +136,7 @@ try { $fileStream.Dispose() [int]$Elapsed = $StopWatch.Elapsed.TotalSeconds - "βœ”οΈ uploaded πŸ“„$Filename to $URL in $Elapsed sec" + "βœ… uploaded πŸ“„$Filename to $URL in $Elapsed sec" exit 0 # success } catch { [int]$Elapsed = $StopWatch.Elapsed.TotalSeconds @@ -145,4 +145,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of upload-file.ps1 as of 08/15/2024 09:50:55)* +*(generated by convert-ps2md.ps1 using the comment-based help of upload-file.ps1 as of 11/08/2024 12:34:56)* diff --git a/docs/upload-to-dropbox.md b/docs/upload-to-dropbox.md index 527706b8..b48f18b5 100644 --- a/docs/upload-to-dropbox.md +++ b/docs/upload-to-dropbox.md @@ -6,7 +6,7 @@ This PowerShell script uploads a local file to Dropbox. Parameters ---------- ```powershell -PS> ./upload-to-dropbox.ps1 [-SourceFilePath] [] +/home/markus/Repos/PowerShell/scripts/upload-to-dropbox.ps1 [-SourceFilePath] [] -SourceFilePath @@ -74,4 +74,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of upload-to-dropbox.ps1 as of 08/15/2024 09:50:55)* +*(generated by convert-ps2md.ps1 using the comment-based help of upload-to-dropbox.ps1 as of 11/08/2024 12:34:56)* diff --git a/docs/wake-up-host.md b/docs/wake-up-host.md new file mode 100644 index 00000000..ca838826 --- /dev/null +++ b/docs/wake-up-host.md @@ -0,0 +1,123 @@ +Script: *wake-up-host.ps1* +======================== + +This PowerShell script sends a magic UDP packet to a computer to wake him up (requires the target computer to have Wake-on-LAN activated). + +Parameters +---------- +```powershell +/home/markus/Repos/PowerShell/scripts/wake-up-host.ps1 [[-macAddr] ] [[-ipAddr] ] [[-udpPort] ] [[-numTimes] ] [] + +-macAddr + Specifies the host's MAC address (e.g. 11:22:33:44:55:66) + + Required? false + Position? 1 + Default value + Accept pipeline input? false + Accept wildcard characters? false + +-ipAddr + Specifies the host's IP address or subnet address (e.g. 192.168.0.255) + + Required? false + Position? 2 + Default value + Accept pipeline input? false + Accept wildcard characters? false + +-udpPort + Specifies the UDP port (9 by default) + + Required? false + Position? 3 + Default value 9 + Accept pipeline input? false + Accept wildcard characters? false + +-numTimes + Specifies # of times to send the packet (3 by default) + + Required? false + Position? 4 + Default value 3 + Accept pipeline input? false + Accept wildcard characters? false + +[] + This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, + WarningVariable, OutBuffer, PipelineVariable, and OutVariable. +``` + +Example +------- +```powershell +PS> ./wake-up-host.ps1 11:22:33:44:55:66 192.168.100.100 +βœ… Magic packet sent to IP 192.168.100.100, UDP port 9, 3x - wait a minute until the computer fully boots up. + +``` + +Notes +----- +Author: Markus Fleschutz | License: CC0 + +Related Links +------------- +https://github.com/fleschutz/PowerShell + +Script Content +-------------- +```powershell +<# +.SYNOPSIS + Wakes up a computer using Wake-on-LAN +.DESCRIPTION + This PowerShell script sends a magic UDP packet to a computer to wake him up (requires the target computer to have Wake-on-LAN activated). +.PARAMETER macAddr + Specifies the host's MAC address (e.g. 11:22:33:44:55:66) +.PARAMETER ipAddr + Specifies the host's IP address or subnet address (e.g. 192.168.0.255) +.PARAMETER udpPort + Specifies the UDP port (9 by default) +.PARAMETER numTimes + Specifies # of times to send the packet (3 by default) +.EXAMPLE + PS> ./wake-up-host.ps1 11:22:33:44:55:66 192.168.100.100 + βœ… Magic packet sent to IP 192.168.100.100, UDP port 9, 3x - wait a minute until the computer fully boots up. +.LINK + https://github.com/fleschutz/PowerShell +.NOTES + Author: Markus Fleschutz | License: CC0 +#> + +param([string]$macAddr = "", [string]$ipAddr = "", [int]$udpPort = 9, [int]$numTimes = 3) + +function Send-WOL { param([string]$macAddr, [string]$ipAddr, [int]$udpPort) + $broadcastAddr = [Net.IPAddress]::Parse($ipAddr) + + $macAddr = (($macAddr.replace(":","")).replace("-","")).replace(".","") + $target = 0,2,4,6,8,10 | % {[convert]::ToByte($macAddr.substring($_,2),16)} + $packet = (,[byte]255 * 6) + ($target * 16) + + $UDPclient = New-Object System.Net.Sockets.UdpClient + $UDPclient.Connect($broadcastAddr, $udpPort) + [void]$UDPclient.Send($packet, 102) +} + +try { + if ($macAddr -eq "" ) { $macAddr = Read-Host "Enter the host's MAC address, e.g. 11:22:33:44:55:66" } + if ($ipAddr -eq "" ) { $ipAddr = Read-Host "Enter the host's IP or subnet address, e.g. 192.168.0.255" } + + for ($i = 0; $i -lt $numTimes; $i++) { + Send-WOL $macAddr.Trim() $ipAddr.Trim() $udpPort + Start-Sleep -milliseconds 100 + } + "βœ… Magic packet sent to IP $ipAddr, UDP port $udpPort, $($numTimes)x - wait a minute until the computer fully boots up." + exit 0 # success +} catch { + "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" + exit 1 +} +``` + +*(generated by convert-ps2md.ps1 using the comment-based help of wake-up-host.ps1 as of 11/08/2024 12:34:56)* diff --git a/docs/watch-commits.md b/docs/watch-commits.md index 76ff6e3d..751e6da1 100644 --- a/docs/watch-commits.md +++ b/docs/watch-commits.md @@ -6,7 +6,7 @@ This PowerShell script permanently lists the latest commit in a Git repository i Parameters ---------- ```powershell -PS> ./watch-commits.ps1 [[-pathToRepo] ] [[-updateInterval] ] [[-speed] ] [] +/home/markus/Repos/PowerShell/scripts/watch-commits.ps1 [[-pathToRepo] ] [[-updateInterval] ] [[-speed] ] [] -pathToRepo Specifies the file path to the local Git repository. @@ -115,4 +115,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of watch-commits.ps1 as of 08/15/2024 09:50:55)* +*(generated by convert-ps2md.ps1 using the comment-based help of watch-commits.ps1 as of 11/08/2024 12:34:56)* diff --git a/docs/watch-file.md b/docs/watch-file.md index 04c7572e..c680dc55 100644 --- a/docs/watch-file.md +++ b/docs/watch-file.md @@ -64,4 +64,4 @@ function Watch-File { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of watch-file.ps1 as of 08/15/2024 09:50:55)* +*(generated by convert-ps2md.ps1 using the comment-based help of watch-file.ps1 as of 11/08/2024 12:34:56)* diff --git a/docs/watch-news.md b/docs/watch-news.md index ea393001..0b7db5b8 100644 --- a/docs/watch-news.md +++ b/docs/watch-news.md @@ -1,14 +1,14 @@ Script: *watch-news.ps1* ======================== -This PowerShell script lists the latest headlines by using a RSS (Really Simple Syndication) feed. +This PowerShell script continuously lists the latest headlines by using a RSS (Really Simple Syndication) feed. Parameters ---------- ```powershell -PS> ./watch-news.ps1 [[-RSS_URL] ] [[-lines] ] [[-timeInterval] ] [] +/home/markus/Repos/PowerShell/scripts/watch-news.ps1 [[-URL] ] [[-timeInterval] ] [] --RSS_URL +-URL Specifies the URL to the RSS feed (Yahoo World News by default) Required? false @@ -17,20 +17,11 @@ PS> ./watch-news.ps1 [[-RSS_URL] ] [[-lines] ] [[-timeInterval] < Accept pipeline input? false Accept wildcard characters? false --lines - Specifies the initial number of headlines +-timeInterval + Specifies the time interval in seconds between two Web requests (30 seconds by default) Required? false Position? 2 - Default value 10 - Accept pipeline input? false - Accept wildcard characters? false - --timeInterval - Specifies the time interval in seconds between the Web requests - - Required? false - Position? 3 Default value 30 Accept pipeline input? false Accept wildcard characters? false @@ -44,7 +35,13 @@ Example ------- ```powershell PS> ./watch-news.ps1 -❇️ Niger coup: Ecowas deadline sparks anxiety in northern Nigeria ❇️ + + + +UTC Yahoo News - Latest News & Headlines - https://www.yahoo.com/news/world + --- ----------------------------------------------------------------------- +❇️ 14:29 Niger coup: Ecowas deadline sparks anxiety in northern Nigeria +... ``` @@ -61,48 +58,56 @@ Script Content ```powershell <# .SYNOPSIS - Watch the latest headlines + Watch the news .DESCRIPTION - This PowerShell script lists the latest headlines by using a RSS (Really Simple Syndication) feed. -.PARAMETER RSS_URL + This PowerShell script continuously lists the latest headlines by using a RSS (Really Simple Syndication) feed. +.PARAMETER URL Specifies the URL to the RSS feed (Yahoo World News by default) .PARAMETER lines Specifies the initial number of headlines .PARAMETER timeInterval - Specifies the time interval in seconds between the Web requests + Specifies the time interval in seconds between two Web requests (30 seconds by default) .EXAMPLE PS> ./watch-news.ps1 - ❇️ Niger coup: Ecowas deadline sparks anxiety in northern Nigeria ❇️ + + UTC Yahoo News - Latest News & Headlines - https://www.yahoo.com/news/world + --- ----------------------------------------------------------------------- + ❇️ 14:29 Niger coup: Ecowas deadline sparks anxiety in northern Nigeria + ... .LINK https://github.com/fleschutz/PowerShell .NOTES Author: Markus Fleschutz | License: CC0 #> -param([string]$RSS_URL = "https://news.yahoo.com/rss/world", [int]$lines = 10, [int]$timeInterval = 30) # in seconds +param([string]$URL = "https://news.yahoo.com/rss/world", [int]$timeInterval = 30) # in seconds -function PrintLatestHeadlines([string]$previous, [int]$maxLines) { - [xml]$content = (Invoke-WebRequest -URI $RSS_URL -useBasicParsing).Content - [string]$latest = "" - - foreach ($item in $content.rss.channel.item) { - $itemTitle = "$($item.title)" - if ($latest -eq "") { $latest = $itemTitle } - if ($itemTitle -eq $previous) { break } - - & "$PSScriptRoot/write-animated.ps1" "❇️ $itemTitle ❇️" - $maxLines-- - if ($maxLines -eq 0) { break } +function PrintLatestHeadlines([xml]$content, [string]$latestTimestamp) { + $items = $content.rss.channel.item + [array]::Reverse($items) + foreach($item in $items) { + if ($($item.pubDate) -le $latestTimestamp) { continue } + $title = $item.title + $time = $item.pubDate.Substring(11, 5) + & "$PSScriptRoot/write-typewriter.ps1" "❇️ $time $title" 2 + $latestTimestamp = $item.pubDate } - return $latest + return $latestTimestamp } try { - $latest = "" - while ($true) { - $latest = PrintLatestHeadlines $latest $lines + [xml]$content = (Invoke-WebRequest -URI $URL -useBasicParsing).Content + $title = $content.rss.channel.title + $link = $content.rss.channel.link + " " + " UTC $title - $link" + " --- -----------------------------------------------------------------------" + $latestTimestamp = "2000-01-01" + do { + $latestTimestamp = PrintLatestHeadlines $content $latestTimestamp Start-Sleep -seconds $timeInterval - } + [xml]$content = (Invoke-WebRequest -URI $URL -useBasicParsing).Content + } while ($true) exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -110,4 +115,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of watch-news.ps1 as of 08/15/2024 09:50:55)* +*(generated by convert-ps2md.ps1 using the comment-based help of watch-news.ps1 as of 11/08/2024 12:34:56)* diff --git a/docs/watch-ping.md b/docs/watch-ping.md new file mode 100644 index 00000000..1290af1b --- /dev/null +++ b/docs/watch-ping.md @@ -0,0 +1,138 @@ +Script: *watch-ping.ps1* +======================== + +This PowerShell script pings the given host continously and shows the roundtrip times in a horizontal chart. + +Parameters +---------- +```powershell +/home/markus/Repos/PowerShell/scripts/watch-ping.ps1 [[-hostname] ] [[-timeInterval] ] [] + +-hostname + Specifies the hostname or IP address to ping (windows.com by default) + + Required? false + Position? 1 + Default value windows.com + Accept pipeline input? false + Accept wildcard characters? false + +-timeInterval + Specifies the time interval in milliseconds between two pings (1000 by default) + + Required? false + Position? 2 + Default value 1000 + Accept pipeline input? false + Accept wildcard characters? false + +[] + This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, + WarningVariable, OutBuffer, PipelineVariable, and OutVariable. +``` + +Example +------- +```powershell +PS> ./watch-ping.ps1 + + + +PING ROUNDTRIP TIMES TO: windows.com +#1 β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ 136ms +#2 β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ 154ms +#3 β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ 234ms +... + +``` + +Notes +----- +Author: Markus Fleschutz | License: CC0 + +Related Links +------------- +https://github.com/fleschutz/PowerShell + +Script Content +-------------- +```powershell +<# +.SYNOPSIS + Watch pinging a host +.DESCRIPTION + This PowerShell script pings the given host continously and shows the roundtrip times in a horizontal chart. +.PARAMETER hostname + Specifies the hostname or IP address to ping (windows.com by default) +.PARAMETER timeInterval + Specifies the time interval in milliseconds between two pings (1000 by default) +.EXAMPLE + PS> ./watch-ping.ps1 + + PING ROUNDTRIP TIMES TO: windows.com + #1 β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ 136ms + #2 β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ 154ms + #3 β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ 234ms + ... +.LINK + https://github.com/fleschutz/PowerShell +.NOTES + Author: Markus Fleschutz | License: CC0 +#> + +param([string]$hostname = "windows.com", [int]$timeInterval = 1000) + +function GetPingLatency([string]$hostname) { + $hostsArray = $hostname.Split(",") + $tasks = $hostsArray | foreach { + (New-Object Net.NetworkInformation.Ping).SendPingAsync($_,1000) + } + [Threading.Tasks.Task]::WaitAll($tasks) + foreach($ping in $tasks.Result) { + if ($ping.Status -eq "Success") { return $ping.RoundtripTime } + } + return 1000 +} + +function WriteChartLine { param([float]$value, [float]$maxValue, [string]$text) + $num = ($value * 108.0) / $maxValue + while ($num -ge 1.0) { + Write-Host -noNewLine "β–ˆ" + $num -= 1.0 + } + if ($num -ge 0.875) { + Write-Host -noNewLine "β–‰" + } elseif ($num -ge 0.75) { + Write-Host -noNewLine "β–Š" + } elseif ($num -ge 0.625) { + Write-Host -noNewLine "β–‹" + } elseif ($num -ge 0.5) { + Write-Host -noNewLine "β–Œ" + } elseif ($num -ge 0.375) { + Write-Host -noNewLine "▍" + } elseif ($num -ge 0.25) { + Write-Host -noNewLine "β–Ž" + } elseif ($num -ge 0.125) { + Write-Host -noNewLine "▏" + } + Write-Host " $text" +} + +try { + Write-Host "`n PING ROUNDTRIP TIMES TO: $hostname" -foregroundColor green + [int]$count = 1 + do { + Write-Host "#$count " -noNewline + [float]$latency = GetPingLatency $hostname + WriteChartLine $latency 1000.0 "$($latency)ms" + Start-Sleep -Milliseconds $timeInterval + $count++ + } while($true) + exit 0 # success +} catch { + "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" + exit 1 +} +``` + +*(generated by convert-ps2md.ps1 using the comment-based help of watch-ping.ps1 as of 11/08/2024 12:34:56)* diff --git a/docs/weather-report.md b/docs/weather-report.md index 2a7a30ef..47b816cc 100644 --- a/docs/weather-report.md +++ b/docs/weather-report.md @@ -6,7 +6,7 @@ This PowerShell script lists the local weather report. Parameters ---------- ```powershell -PS> ./weather-report.ps1 [[-GeoLocation] ] [] +/home/markus/Repos/PowerShell/scripts/weather-report.ps1 [[-GeoLocation] ] [] -GeoLocation Specifies the geographic location to use (determine automatically by default) @@ -66,4 +66,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of weather-report.ps1 as of 08/15/2024 09:50:55)* +*(generated by convert-ps2md.ps1 using the comment-based help of weather-report.ps1 as of 11/08/2024 12:34:56)* diff --git a/docs/weather.md b/docs/weather.md index d3493b3b..c1e3c7de 100644 --- a/docs/weather.md +++ b/docs/weather.md @@ -6,7 +6,7 @@ This PowerShell script lists the current weather forecast. Parameters ---------- ```powershell -PS> ./weather.ps1 [[-GeoLocation] ] [] +/home/markus/Repos/PowerShell/scripts/weather.ps1 [[-GeoLocation] ] [] -GeoLocation Specifies the geographic location to use @@ -66,4 +66,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of weather.ps1 as of 08/15/2024 09:50:55)* +*(generated by convert-ps2md.ps1 using the comment-based help of weather.ps1 as of 11/08/2024 12:34:56)* diff --git a/docs/what-is.md b/docs/what-is.md index 87e24324..c0d7b57e 100644 --- a/docs/what-is.md +++ b/docs/what-is.md @@ -6,7 +6,7 @@ This PowerShell script queries the meaning of the given term/abbreviation/etc. a Parameters ---------- ```powershell -PS> ./what-is.ps1 [[-term] ] [] +/home/markus/Repos/PowerShell/scripts/what-is.ps1 [[-term] ] [] -term Specifies the term to query @@ -60,9 +60,9 @@ Script Content param([string]$term = "") try { - if ($term -eq "" ) { $term = Read-Host "Enter the term/abbreviation/etc. to query" } + if ($term -eq "" ) { $term = Read-Host "Enter the term to query" } - $files = (Get-ChildItem "$PSScriptRoot/../data/dicts/*.csv") + $files = Get-ChildItem "$PSScriptRoot/../data/dicts/*.csv" $basename = "" foreach($file in $files) { $table = Import-CSV "$file" @@ -73,7 +73,8 @@ try { } } if ($basename -eq "") { - & "$PSScriptRoot/open-URL.ps1" "https://www.google.com/search?q=what+is+$term" "πŸ€·β€ Sorry, no '$term' entry found. Let's google it at: " + Write-Host "πŸ€·β€ Sorry, '$term' is unknown to me. Ctrl + click here to google it: " -noNewline + Write-Host "https://www.google.com/search?q=what+is+$term" -foregroundColor blue } exit 0 # success } catch { @@ -82,4 +83,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of what-is.ps1 as of 08/15/2024 09:50:55)* +*(generated by convert-ps2md.ps1 using the comment-based help of what-is.ps1 as of 11/08/2024 12:34:56)* diff --git a/docs/windefender.md b/docs/windefender.md index f89fb3d7..dd147c05 100644 --- a/docs/windefender.md +++ b/docs/windefender.md @@ -6,7 +6,7 @@ This script can enable / disable and show Windows defender real time monitoring! Parameters ---------- ```powershell -PS> ./windefender.ps1 [] +/home/markus/Repos/PowerShell/scripts/windefender.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -82,4 +82,4 @@ break } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of windefender.ps1 as of 08/15/2024 09:50:55)* +*(generated by convert-ps2md.ps1 using the comment-based help of windefender.ps1 as of 11/08/2024 12:34:56)* diff --git a/docs/write-animated.md b/docs/write-animated.md index e933795b..1fd11518 100644 --- a/docs/write-animated.md +++ b/docs/write-animated.md @@ -6,7 +6,7 @@ This PowerShell script writes text centered and animated to the console. Parameters ---------- ```powershell -PS> ./write-animated.ps1 [[-text] ] [[-speed] ] [] +/home/markus/Repos/PowerShell/scripts/write-animated.ps1 [[-text] ] [[-speed] ] [] -text Specifies the text line to write ("Welcome to PowerShell" by default) @@ -92,4 +92,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of write-animated.ps1 as of 08/15/2024 09:50:55)* +*(generated by convert-ps2md.ps1 using the comment-based help of write-animated.ps1 as of 11/08/2024 12:34:56)* diff --git a/docs/write-ascii-image.md b/docs/write-ascii-image.md index 4ecb5efd..45fa4bbd 100644 --- a/docs/write-ascii-image.md +++ b/docs/write-ascii-image.md @@ -61,4 +61,4 @@ WriteLine " '`--._,dd###pp='''" exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of write-ascii-image.ps1 as of 08/15/2024 09:50:55)* +*(generated by convert-ps2md.ps1 using the comment-based help of write-ascii-image.ps1 as of 11/08/2024 12:34:56)* diff --git a/docs/write-big.md b/docs/write-big.md index ea168aee..c342ae87 100644 --- a/docs/write-big.md +++ b/docs/write-big.md @@ -6,7 +6,7 @@ This PowerShell script writes the given text in big letters. Parameters ---------- ```powershell -PS> ./write-big.ps1 [[-text] ] [] +/home/markus/Repos/PowerShell/scripts/write-big.ps1 [[-text] ] [] -text Specifies the text to write ("Hello World" by default) @@ -471,4 +471,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of write-big.ps1 as of 08/15/2024 09:50:55)* +*(generated by convert-ps2md.ps1 using the comment-based help of write-big.ps1 as of 11/08/2024 12:34:56)* diff --git a/docs/write-blue.md b/docs/write-blue.md index 76037f4f..219d08c3 100644 --- a/docs/write-blue.md +++ b/docs/write-blue.md @@ -6,7 +6,7 @@ This PowerShell script writes text in a blue foreground color. Parameters ---------- ```powershell -PS> ./write-blue.ps1 [[-text] ] [] +/home/markus/Repos/PowerShell/scripts/write-blue.ps1 [[-text] ] [] -text Specifies the text to write @@ -64,4 +64,4 @@ write-host -foregroundColor blue "$text" exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of write-blue.ps1 as of 08/15/2024 09:50:55)* +*(generated by convert-ps2md.ps1 using the comment-based help of write-blue.ps1 as of 11/08/2024 12:34:56)* diff --git a/docs/write-braille.md b/docs/write-braille.md index 3023d0bb..c127a354 100644 --- a/docs/write-braille.md +++ b/docs/write-braille.md @@ -6,7 +6,7 @@ This PowerShell script writes text in Braille. Parameters ---------- ```powershell -PS> ./write-braille.ps1 [[-text] ] [] +/home/markus/Repos/PowerShell/scripts/write-braille.ps1 [[-text] ] [] -text Specifies the text to write @@ -408,4 +408,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of write-braille.ps1 as of 08/15/2024 09:50:55)* +*(generated by convert-ps2md.ps1 using the comment-based help of write-braille.ps1 as of 11/08/2024 12:34:56)* diff --git a/docs/write-centered.md b/docs/write-centered.md index 81d04803..2cd99288 100644 --- a/docs/write-centered.md +++ b/docs/write-centered.md @@ -6,7 +6,7 @@ This PowerShell script writes the given text centered to the console. Parameters ---------- ```powershell -PS> ./write-centered.ps1 [[-text] ] [] +/home/markus/Repos/PowerShell/scripts/write-centered.ps1 [[-text] ] [] -text Specifies the text to write @@ -76,4 +76,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of write-centered.ps1 as of 08/15/2024 09:50:55)* +*(generated by convert-ps2md.ps1 using the comment-based help of write-centered.ps1 as of 11/08/2024 12:34:56)* diff --git a/docs/write-changelog.md b/docs/write-changelog.md index b6963dcd..e88ed93a 100644 --- a/docs/write-changelog.md +++ b/docs/write-changelog.md @@ -7,7 +7,7 @@ NOTE: For proper sorting the Git commits should start with verbs such as 'Add', Parameters ---------- ```powershell -PS> ./write-changelog.ps1 [[-RepoDir] ] [] +/home/markus/Repos/PowerShell/scripts/write-changelog.ps1 [[-RepoDir] ] [] -RepoDir Specifies the path to the local Git repository (default is current working dir) @@ -155,4 +155,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of write-changelog.ps1 as of 08/15/2024 09:50:55)* +*(generated by convert-ps2md.ps1 using the comment-based help of write-changelog.ps1 as of 11/08/2024 12:34:56)* diff --git a/docs/write-chart.md b/docs/write-chart.md index e3ddcdd3..113fc8db 100644 --- a/docs/write-chart.md +++ b/docs/write-chart.md @@ -68,4 +68,4 @@ WriteChartLine "Tom" 30.9 100.0 exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of write-chart.ps1 as of 08/15/2024 09:50:55)* +*(generated by convert-ps2md.ps1 using the comment-based help of write-chart.ps1 as of 11/08/2024 12:34:56)* diff --git a/docs/write-clock.md b/docs/write-clock.md index eae4c51e..b219e8bc 100644 --- a/docs/write-clock.md +++ b/docs/write-clock.md @@ -6,7 +6,7 @@ This PowerShell script writes the current time as ASCII clock. Parameters ---------- ```powershell -PS> ./write-clock.ps1 [] +/home/markus/Repos/PowerShell/scripts/write-clock.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -73,4 +73,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of write-clock.ps1 as of 08/15/2024 09:50:55)* +*(generated by convert-ps2md.ps1 using the comment-based help of write-clock.ps1 as of 11/08/2024 12:34:56)* diff --git a/docs/write-code.md b/docs/write-code.md index d2d57199..3fd14e0a 100644 --- a/docs/write-code.md +++ b/docs/write-code.md @@ -6,7 +6,7 @@ This PowerShell script generates and writes PowerShell code on the console (no A Parameters ---------- ```powershell -PS> ./write-code.ps1 [[-color] ] [[-speed] ] [] +/home/markus/Repos/PowerShell/scripts/write-code.ps1 [[-color] ] [[-speed] ] [] -color Specifies the text color to use ("green" by default) @@ -118,4 +118,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of write-code.ps1 as of 08/15/2024 09:50:55)* +*(generated by convert-ps2md.ps1 using the comment-based help of write-code.ps1 as of 11/08/2024 12:34:56)* diff --git a/docs/write-credits.md b/docs/write-credits.md new file mode 100644 index 00000000..dbd7a25e --- /dev/null +++ b/docs/write-credits.md @@ -0,0 +1,79 @@ +Script: *write-credits.ps1* +======================== + +This PowerShell script writes the credits for the PowerShell script collection. + +Parameters +---------- +```powershell +/home/markus/Repos/PowerShell/scripts/write-credits.ps1 [] + +[] + This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, + WarningVariable, OutBuffer, PipelineVariable, and OutVariable. +``` + +Example +------- +```powershell +PS> ./write-credits.ps1 + +``` + +Notes +----- +Author: Markus Fleschutz | License: CC0 + +Related Links +------------- +https://github.com/fleschutz/PowerShell + +Script Content +-------------- +```powershell +<# +.SYNOPSIS + Writes the credits +.DESCRIPTION + This PowerShell script writes the credits for the PowerShell script collection. +.EXAMPLE + PS> ./write-credits.ps1 +.LINK + https://github.com/fleschutz/PowerShell +.NOTES + Author: Markus Fleschutz | License: CC0 +#> + +try { + Clear-Host + " ______ ______ ______ _____ __ ______ ______ " + " /\ ___\ /\ == \ /\ ___\ /\ __-. /\ \ /\__ _\ /\ ___\ " + " \ \ \____ \ \ __< \ \ __\ \ \ \/\ \ \ \ \ \/_/\ \/ \ \___ \ " + " \ \_____\ \ \_\ \_\ \ \_____\ \ \____- \ \_\ \ \_\ \/\_____\ " + " \/_____/ \/_/ /_/ \/_____/ \/____/ \/_/ \/_/ \/_____/ " + "" + & "$PSScriptRoot/write-animated.ps1" "Typos: Markus Fleschutz" + & "$PSScriptRoot/write-animated.ps1" "Keyboard: Rapoo 12335 E9270P WL Ultra-Slim Touch" + & "$PSScriptRoot/write-animated.ps1" "Operating Systems: Windows 11 24H2 & Ubuntu Server 24.04 LTS" + & "$PSScriptRoot/write-animated.ps1" "Console: Windows Terminal 1.20.11271.0" + & "$PSScriptRoot/write-animated.ps1" "Shell: PowerShell 5.1.22621.2506 & PowerShell 7.4.3" + & "$PSScriptRoot/write-animated.ps1" "Scripts: PowerShell Scripts 1.2" + & "$PSScriptRoot/write-animated.ps1" "GitHub: github.com/fleschutz/PowerShell" + & "$PSScriptRoot/write-animated.ps1" "Git: version 2.45.0" + & "$PSScriptRoot/write-animated.ps1" "SSH: OpenSSH version 7.7p1" + & "$PSScriptRoot/write-animated.ps1" "Unicode: version 13.0" + & "$PSScriptRoot/write-animated.ps1" "Song #1: Epic Song by BoxCat Games from Free Music Archive" + & "$PSScriptRoot/write-animated.ps1" "Song #2: Siesta by Jahzzar from Free Music Archive" + & "$PSScriptRoot/write-animated.ps1" "Executive Producer: Markus Fleschutz" + & "$PSScriptRoot/write-animated.ps1" "Special Thanks: Andrea Fleschutz" + & "$PSScriptRoot/write-animated.ps1" "Copyright: (c) 2024. All Rights Reserved" + & "$PSScriptRoot/write-animated.ps1" "* No Animals Were Harmed in the Making of This Film *" + & "$PSScriptRoot/write-big.ps1" " Thanx 4 watching" + exit 0 # success +} catch { + "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" + exit 1 +} +``` + +*(generated by convert-ps2md.ps1 using the comment-based help of write-credits.ps1 as of 11/08/2024 12:34:56)* diff --git a/docs/write-date.md b/docs/write-date.md index 625aaa8e..88d24deb 100644 --- a/docs/write-date.md +++ b/docs/write-date.md @@ -1,12 +1,12 @@ Script: *write-date.ps1* ======================== -This PowerShell script determines and writes the current date. +This PowerShell script determines and writes the current date in US format. Parameters ---------- ```powershell -PS> ./write-date.ps1 [] +/home/markus/Repos/PowerShell/scripts/write-date.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -36,7 +36,7 @@ Script Content .SYNOPSIS Writes the current date .DESCRIPTION - This PowerShell script determines and writes the current date. + This PowerShell script determines and writes the current date in US format. .EXAMPLE PS> ./write-date πŸ“…12/25/2022 @@ -57,4 +57,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of write-date.ps1 as of 08/15/2024 09:50:55)* +*(generated by convert-ps2md.ps1 using the comment-based help of write-date.ps1 as of 11/08/2024 12:34:56)* diff --git a/docs/write-fractal.md b/docs/write-fractal.md index 32b006c3..3d0367e8 100644 --- a/docs/write-fractal.md +++ b/docs/write-fractal.md @@ -79,4 +79,4 @@ while ($true) { exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of write-fractal.ps1 as of 08/15/2024 09:50:55)* +*(generated by convert-ps2md.ps1 using the comment-based help of write-fractal.ps1 as of 11/08/2024 12:34:56)* diff --git a/docs/write-green.md b/docs/write-green.md index 59bd5733..b5f2e6d4 100644 --- a/docs/write-green.md +++ b/docs/write-green.md @@ -6,7 +6,7 @@ This PowerShell script writes text in a green foreground color. Parameters ---------- ```powershell -PS> ./write-green.ps1 [[-text] ] [] +/home/markus/Repos/PowerShell/scripts/write-green.ps1 [[-text] ] [] -text Specifies the text to write @@ -63,4 +63,4 @@ write-host -foregroundColor green "$text" exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of write-green.ps1 as of 08/15/2024 09:50:55)* +*(generated by convert-ps2md.ps1 using the comment-based help of write-green.ps1 as of 11/08/2024 12:34:56)* diff --git a/docs/write-hands-off.md b/docs/write-hands-off.md new file mode 100644 index 00000000..19bbdcfd --- /dev/null +++ b/docs/write-hands-off.md @@ -0,0 +1,70 @@ +Script: *write-hands-off.ps1* +======================== + +This PowerShell script writes 'Hands Off' in BIG letters. + +Parameters +---------- +```powershell +/home/markus/Repos/PowerShell/scripts/write-hands-off.ps1 [] + +[] + This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, + WarningVariable, OutBuffer, PipelineVariable, and OutVariable. +``` + +Example +------- +```powershell +PS> ./write-hands-off.ps1 + +``` + +Notes +----- +Author: Markus Fleschutz | License: CC0 + +Related Links +------------- +https://github.com/fleschutz/PowerShell + +Script Content +-------------- +```powershell +<# +.SYNOPSIS + Writes 'Hands Off' +.DESCRIPTION + This PowerShell script writes 'Hands Off' in BIG letters. +.EXAMPLE + PS> ./write-hands-off.ps1 +.LINK + https://github.com/fleschutz/PowerShell +.NOTES + Author: Markus Fleschutz | License: CC0 +#> + +try { + $randomNumberGenerator = New-Object System.Random + while ($true) { + Clear-Host + Write-Host "`n`n" + & "$PSScriptRoot/write-big.ps1" " HANDS OFF" + Write-Host "`n`n" + & "$PSScriptRoot/write-big.ps1" " DO NOT TOUCH" + Write-Host "`n`n" + & "$PSScriptRoot/write-big.ps1" " MY PC" + [int]$x = $randomNumberGenerator.next(1, 90) + [int]$y = $randomNumberGenerator.next(1, 22) + [System.Console]::SetCursorPosition($x, $y) + Write-Host "πŸ”₯πŸ”₯πŸ”₯ LAST WARNING πŸ”₯πŸ”₯πŸ”₯" -foregroundColor red + Start-Sleep -milliseconds 900 + } + exit 0 # success +} catch { + "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" + exit 1 +} +``` + +*(generated by convert-ps2md.ps1 using the comment-based help of write-hands-off.ps1 as of 11/08/2024 12:34:56)* diff --git a/docs/write-headline.md b/docs/write-headline.md index e99ef8a8..efcf0181 100644 --- a/docs/write-headline.md +++ b/docs/write-headline.md @@ -6,7 +6,7 @@ This PowerShell script writes the given text as a headline. Parameters ---------- ```powershell -PS> ./write-headline.ps1 [[-text] ] [] +/home/markus/Repos/PowerShell/scripts/write-headline.ps1 [[-text] ] [] -text Specifies the text to write @@ -26,11 +26,9 @@ Example ------- ```powershell PS> ./write-headline.ps1 "Hello World" - - - -* Hello World * ---------------- +----------------- + Hello World +----------------- ``` @@ -54,9 +52,9 @@ Script Content Specifies the text to write .EXAMPLE PS> ./write-headline.ps1 "Hello World" - - * Hello World * - --------------- + ----------------- + Hello World + ----------------- .LINK https://github.com/fleschutz/PowerShell .NOTES @@ -68,11 +66,10 @@ param([string]$text = "") try { if ($text -eq "") { $text = Read-Host "Enter the text to write" } - Write-Host "`n* $text *" -foregroundColor green [int]$len = $text.Length - [string]$line = "----" + [string]$line = "------" for ([int]$i = 0; $i -lt $len; $i++) { $line += "-" } - Write-Host "$line" -foregroundColor green + Write-Host "`n$line`n $text`n$line" -foregroundColor green exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -80,4 +77,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of write-headline.ps1 as of 08/15/2024 09:50:55)* +*(generated by convert-ps2md.ps1 using the comment-based help of write-headline.ps1 as of 11/08/2024 12:34:56)* diff --git a/docs/write-help.md b/docs/write-help.md new file mode 100644 index 00000000..7ac6dce3 --- /dev/null +++ b/docs/write-help.md @@ -0,0 +1,67 @@ +Script: *write-help.ps1* +======================== + +write-help.ps1 + + +Parameters +---------- +```powershell + + +[] + This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, + WarningVariable, OutBuffer, PipelineVariable, and OutVariable. +``` + +Script Content +-------------- +```powershell +<# +.SYNOPSIS + Writes a help page +.DESCRIPTION + This PowerShell script writes a PowerShell help page. +.EXAMPLE + PS> ./write-help.ps1 +.LINK + https://github.com/fleschutz/PowerShell +.NOTES + Author: Markus Fleschutz | License: CC0 +#> + +function White([string]$line) { + Write-Host $line -foregroundColor white -backgroundColor black -noNewline +} +function Blue([string]$line) { + Write-Host $line -foregroundColor blue -backgroundColor black -noNewline +} + +try { + White "β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ`n" + White "β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ πŸ‘‹ Welcome to POWERSHELL $($PSVersionTable.PSVersion) $($PSVersionTable.PSEdition) edition`n" + White "β–ˆβ–ˆβ–ˆβ–ˆ β–„β–„β–„β–„β–„ β–ˆβ–€ β–ˆβ–€β–€β–ˆβ–€β–€ β–„β–„β–ˆβ–ˆ β–„β–„β–„β–„β–„ β–ˆβ–ˆβ–ˆβ–ˆ`n" + White "β–ˆβ–ˆβ–ˆβ–ˆ β–ˆ β–ˆ β–ˆβ–€ β–„ β–ˆβ–€ β–€ β–€β–„β–ˆ β–ˆ β–ˆ β–ˆ β–ˆβ–ˆβ–ˆβ–ˆ Documentation: "; Blue "https://docs.microsoft.com/en-us/powershell`n" + White "β–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–„β–„β–„β–ˆ β–ˆβ–€β–ˆ β–ˆβ–„β–€β–„β–€ β–€ β–„β–„β–ˆ β–ˆβ–„β–„β–„β–ˆ β–ˆβ–ˆβ–ˆβ–ˆ`n" + White "β–ˆβ–ˆβ–ˆβ–ˆβ–„β–„β–„β–„β–„β–„β–„β–ˆβ–„β–ˆβ–„β–ˆ β–ˆβ–„β–ˆ β–ˆβ–„β–€ β–ˆβ–„β–„β–„β–„β–„β–„β–„β–ˆβ–ˆβ–ˆβ–ˆ Tutorial: "; Blue "https://www.guru99.com/powershell-tutorial.html`n" + White "β–ˆβ–ˆβ–ˆβ–ˆβ–„β–„ β–„β–ˆβ–„β–„ β–„β–ˆβ–„β–„ β–ˆβ–€ β–€β–€β–€ β–€β–„β–€β–„β–ˆβ–„β–€β–ˆβ–ˆβ–ˆβ–ˆ`n" + White "β–ˆβ–ˆβ–ˆβ–ˆβ–€β–„β–„β–ˆβ–€β–ˆβ–„β–ˆβ–ˆ β–€ β–„β–„β–€ β–ˆβ–„β–ˆβ–€ β–€ β–„β–€β–€β–ˆβ–€β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ Video tutorials: "; Blue "https://www.youtube.com/results?search_query=PowerShell`n" + White "β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–„β–„β–ˆβ–„β–„β–€β–„ β–€β–„β–€ β–„β–„ β–€ β–€β–€β–€ β–€β–„β–„β–ˆβ–€β–ˆβ–ˆβ–ˆβ–ˆ`n" + White "β–ˆβ–ˆβ–ˆβ–ˆβ–„ β–€ β–„ β–„β–„β–ˆ β–ˆβ–€β–ˆβ–ˆβ–„ β–ˆβ–ˆβ–€β–„β–ˆβ–„β–„β–€β–„β–„β–€β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ Execute: 'Get-Help ' to display information about `n" + White "β–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–„β–„ β–„β–ˆβ–„β–„β–„β–ˆβ–ˆ β–€ β–€β–€β–€β–€β–„ β–ˆβ–€β–ˆβ–ˆβ–ˆβ–ˆ`n" + White "β–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–„ β–„β–€β–€β–ˆβ–ˆ β–„β–ˆ β–„β–„β–„β–ˆβ–€ β–„β–„ β–ˆβ–ˆβ–„β–€β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ FAQ's: "; Blue "https://github.com/fleschutz/PowerShell/blob/main/docs/FAQ.md`n" + White "β–ˆβ–ˆβ–ˆβ–ˆβ–„β–ˆβ–„β–ˆβ–ˆβ–ˆβ–„β–„β–€β–„β–„β–„β–€ β–„β–„ β–„β–€β–„ β–„β–„β–„ β–€ β–ˆβ–ˆβ–ˆβ–ˆ`n" + White "β–ˆβ–ˆβ–ˆβ–ˆ β–„β–„β–„β–„β–„ β–ˆβ–„β–„β–„β–ˆβ–€β–ˆβ–„ β–ˆβ–ˆ β–ˆβ–„β–ˆ β–„β–„β–ˆβ–€β–ˆβ–ˆβ–ˆβ–ˆ 500+ sample scripts: "; Blue "https://github.com/fleschutz/PowerShell`n" + White "β–ˆβ–ˆβ–ˆβ–ˆ β–ˆ β–ˆ β–ˆ β–€β–„β–ˆβ–„ β–„β–„ β–€β–ˆ β–„β–„β–„β–„β–€ β–ˆβ–ˆβ–ˆβ–ˆ`n" + White "β–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–„β–„β–„β–ˆ β–ˆ β–ˆβ–ˆ β–„β–ˆβ–„ β–„β–€β–€β–€ β–„β–„ β–„ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ Cheat sheet: "; Blue "https://github.com/fleschutz/PowerShell/blob/main/docs/cheat-sheet.md`n" + White "β–ˆβ–ˆβ–ˆβ–ˆβ–„β–„β–„β–„β–„β–„β–„β–ˆβ–„β–„β–ˆβ–„β–„β–ˆβ–ˆβ–ˆβ–ˆβ–„β–„β–„β–ˆβ–ˆβ–„β–„β–„β–ˆβ–„β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ`n" + White "β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ NOTE: use + to open the links in your browser.`n" + White "β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ`n" + exit 0 # success +} catch { + "⚠️ Error in line $($_.InvocationInfo.ScriptWhiteNumber): $($Error[0])" + exit 1 +} +``` + +*(generated by convert-ps2md.ps1 using the comment-based help of write-help.ps1 as of 11/08/2024 12:34:56)* diff --git a/docs/write-in-emojis.md b/docs/write-in-emojis.md index 49485e85..0a7f4dc0 100644 --- a/docs/write-in-emojis.md +++ b/docs/write-in-emojis.md @@ -6,7 +6,7 @@ This PowerShell script replaces certain words in the given text by Emojis and wr Parameters ---------- ```powershell -PS> ./write-in-emojis.ps1 [[-text] ] [] +/home/markus/Repos/PowerShell/scripts/write-in-emojis.ps1 [[-text] ] [] -text Specifies the text @@ -74,4 +74,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of write-in-emojis.ps1 as of 08/15/2024 09:50:55)* +*(generated by convert-ps2md.ps1 using the comment-based help of write-in-emojis.ps1 as of 11/08/2024 12:34:56)* diff --git a/docs/write-joke.md b/docs/write-joke.md index 088d70ba..332ca4a6 100644 --- a/docs/write-joke.md +++ b/docs/write-joke.md @@ -6,7 +6,7 @@ This PowerShell script selects a random joke from Data/jokes.csv and writes it t Parameters ---------- ```powershell -PS> ./write-joke.ps1 [] +/home/markus/Repos/PowerShell/scripts/write-joke.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -61,4 +61,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of write-joke.ps1 as of 08/15/2024 09:50:55)* +*(generated by convert-ps2md.ps1 using the comment-based help of write-joke.ps1 as of 11/08/2024 12:34:56)* diff --git a/docs/write-location.md b/docs/write-location.md new file mode 100644 index 00000000..9fa09557 --- /dev/null +++ b/docs/write-location.md @@ -0,0 +1,65 @@ +Script: *write-location.ps1* +======================== + +This PowerShell script determines the location and writes it to the console. + +Parameters +---------- +```powershell +/home/markus/Repos/PowerShell/scripts/write-location.ps1 [] + +[] + This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, + WarningVariable, OutBuffer, PipelineVariable, and OutVariable. +``` + +Example +------- +```powershell +PS> ./write-location.ps1 +πŸ“47.7278Β°,10.3192Β° near 87435 Kempten in Bavaria, Germany. + +``` + +Notes +----- +Author: Markus Fleschutz | License: CC0 + +Related Links +------------- +https://github.com/fleschutz/PowerShell + +Script Content +-------------- +```powershell +<# +.SYNOPSIS + Writes the current location +.DESCRIPTION + This PowerShell script determines the location and writes it to the console. +.EXAMPLE + PS> ./write-location.ps1 + πŸ“47.7278Β°,10.3192Β° near 87435 Kempten in Bavaria, Germany. +.LINK + https://github.com/fleschutz/PowerShell +.NOTES + Author: Markus Fleschutz | License: CC0 +#> + +try { + $location = (Invoke-WebRequest -URI http://ifconfig.co/json -userAgent "curl" -useBasicParsing).Content | ConvertFrom-Json + $lat = $location.latitude + $long = $location.longitude + $city = $location.city + $zip = $location.zip_code + $region = $location.region_name + $country = $location.country + Write-Output "πŸ“$latΒ°,$longΒ° near $zip $city in $region, $country." + exit 0 # success +} catch { + "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" + exit 1 +} +``` + +*(generated by convert-ps2md.ps1 using the comment-based help of write-location.ps1 as of 11/08/2024 12:34:56)* diff --git a/docs/write-lowercase.md b/docs/write-lowercase.md index 2ef8d8fa..3eabc847 100644 --- a/docs/write-lowercase.md +++ b/docs/write-lowercase.md @@ -6,7 +6,7 @@ This PowerShell script writes the given text in lowercase letters. Parameters ---------- ```powershell -PS> ./write-lowercase.ps1 [[-text] ] [] +/home/markus/Repos/PowerShell/scripts/write-lowercase.ps1 [[-text] ] [] -text Specifies the text to write @@ -65,4 +65,4 @@ Write-Output $text.ToLower() exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of write-lowercase.ps1 as of 08/15/2024 09:50:55)* +*(generated by convert-ps2md.ps1 using the comment-based help of write-lowercase.ps1 as of 11/08/2024 12:34:56)* diff --git a/docs/write-marquee.md b/docs/write-marquee.md index 492266eb..d0cc0483 100644 --- a/docs/write-marquee.md +++ b/docs/write-marquee.md @@ -6,7 +6,7 @@ This PowerShell script writes the given text as marquee. Parameters ---------- ```powershell -PS> ./write-marquee.ps1 [[-Text] ] [[-Speed] ] [] +/home/markus/Repos/PowerShell/scripts/write-marquee.ps1 [[-Text] ] [[-Speed] ] [] -Text Specifies the text to write @@ -89,4 +89,4 @@ StartMarquee " exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of write-marquee.ps1 as of 08/15/2024 09:50:55)* +*(generated by convert-ps2md.ps1 using the comment-based help of write-marquee.ps1 as of 11/08/2024 12:34:56)* diff --git a/docs/write-matrix.md b/docs/write-matrix.md index 3bde95f2..25edfcef 100644 --- a/docs/write-matrix.md +++ b/docs/write-matrix.md @@ -81,4 +81,4 @@ exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of write-matrix.ps1 as of 08/15/2024 09:50:55)* +*(generated by convert-ps2md.ps1 using the comment-based help of write-matrix.ps1 as of 11/08/2024 12:34:57)* diff --git a/docs/write-moon.md b/docs/write-moon.md index bcdba187..559dcda2 100644 --- a/docs/write-moon.md +++ b/docs/write-moon.md @@ -6,7 +6,7 @@ This PowerShell script writes the current moon phase to the console. Parameters ---------- ```powershell -PS> ./write-moon.ps1 [] +/home/markus/Repos/PowerShell/scripts/write-moon.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -53,4 +53,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of write-moon.ps1 as of 08/15/2024 09:50:55)* +*(generated by convert-ps2md.ps1 using the comment-based help of write-moon.ps1 as of 11/08/2024 12:34:57)* diff --git a/docs/write-morse-code.md b/docs/write-morse-code.md index 337bc6ab..30301598 100644 --- a/docs/write-morse-code.md +++ b/docs/write-morse-code.md @@ -6,7 +6,7 @@ This PowerShell script writes the given text in Morse code. Parameters ---------- ```powershell -PS> ./write-morse-code.ps1 [[-text] ] [[-speed] ] [] +/home/markus/Repos/PowerShell/scripts/write-morse-code.ps1 [[-text] ] [[-speed] ] [] -text Specifies the text to write @@ -153,4 +153,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of write-morse-code.ps1 as of 08/15/2024 09:50:55)* +*(generated by convert-ps2md.ps1 using the comment-based help of write-morse-code.ps1 as of 11/08/2024 12:34:57)* diff --git a/docs/write-motd.md b/docs/write-motd.md index 0f5bf134..5498fda0 100644 --- a/docs/write-motd.md +++ b/docs/write-motd.md @@ -6,7 +6,7 @@ This PowerShell script writes the message of the day (MOTD). Parameters ---------- ```powershell -PS> ./write-motd.ps1 [] +/home/markus/Repos/PowerShell/scripts/write-motd.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -140,4 +140,4 @@ Write-Host " 'VEzjt:;;z>*`` " -ForegroundColor Yellow exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of write-motd.ps1 as of 08/15/2024 09:50:55)* +*(generated by convert-ps2md.ps1 using the comment-based help of write-motd.ps1 as of 11/08/2024 12:34:57)* diff --git a/docs/write-pi.md b/docs/write-pi.md new file mode 100644 index 00000000..6db823fa --- /dev/null +++ b/docs/write-pi.md @@ -0,0 +1,120 @@ +Script: *write-pi.ps1* +======================== + +This PowerShell script calculates and writes the digits of the mathematical constant PI. + +Parameters +---------- +```powershell +/home/markus/Repos/PowerShell/scripts/write-pi.ps1 [[-digits] ] [] + +-digits + Specifies the number of digits to list (1000 by default) + + Required? false + Position? 1 + Default value 1000 + Accept pipeline input? false + Accept wildcard characters? false + +[] + This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, + WarningVariable, OutBuffer, PipelineVariable, and OutVariable. +``` + +Example +------- +```powershell +PS> ./write-pi.ps1 +3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342... + +``` + +Notes +----- +Author: Markus Fleschutz | License: CC0 + +Related Links +------------- +https://github.com/fleschutz/PowerShell + +Script Content +-------------- +```powershell +<# +.SYNOPSIS + Writes PI +.DESCRIPTION + This PowerShell script calculates and writes the digits of the mathematical constant PI. +.PARAMETER digits + Specifies the number of digits to list (1000 by default) +.EXAMPLE + PS> ./write-pi.ps1 + 3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342... +.LINK + https://github.com/fleschutz/PowerShell +.NOTES + Author: Markus Fleschutz | License: CC0 +#> + +param([int]$digits = 1000) + +function Write-Pi ( $digits ) { + $Big = [bigint[]](0..10) + + $ndigits = 0 + + $q = $t = $k = $Big[1] + $r = $Big[0] + $l = $n = $Big[3] + + # calculate first digit + $nr = ( $Big[2] * $q + $r ) * $l + $nn = ( $q * ( $Big[7] * $k + $Big[2] ) + $r * $l ) / ( $t * $l ) + $q *= $k + $t *= $l + $l += $Big[2] + $k = $k + $Big[1] + $n = $nn + $r = $nr + + Write-Host "$($n)." -noNewline + $ndigits++ + + $nr = $Big[10] * ( $r - $n * $t ) + $n = ( ( $Big[10] * ( 3 * $q + $r ) ) / $t ) - 10 * $n + $q *= $Big[10] + $r = $nr + + while ($ndigits -lt $digits) { + if ($Big[4] * $q + $r - $t -lt $n * $t) { + Write-Host "$n" -noNewline + $ndigits++ + $nr = $Big[10] * ( $r - $n * $t ) + $n = ( ( $Big[10] * ( 3 * $q + $r ) ) / $t ) - 10 * $n + $q *= $Big[10] + $r = $nr + } else { + $nr = ( $Big[2] * $q + $r ) * $l + $nn = ( $q * ( $Big[7] * $k + $Big[2] ) + $r * $l ) / ( $t * $l ) + $q *= $k + $t *= $l + $l += $Big[2] + $k = $k + $Big[1] + $n = $nn + $r = $nr + } + } + Write-Host "... ($digits digits)" +} + +try { + Write-Pi $digits + exit 0 # success +} catch { + "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" + exit 1 +} +``` + +*(generated by convert-ps2md.ps1 using the comment-based help of write-pi.ps1 as of 11/08/2024 12:34:57)* diff --git a/docs/write-qr-code.md b/docs/write-qr-code.md index 5e5f836a..a189ca33 100644 --- a/docs/write-qr-code.md +++ b/docs/write-qr-code.md @@ -6,7 +6,7 @@ This PowerShell script writes "Hello World" as QR code to the console output. Parameters ---------- ```powershell -PS> ./write-qr-code.ps1 [] +/home/markus/Repos/PowerShell/scripts/write-qr-code.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -65,4 +65,4 @@ Write-Host " " -foregroundColor black -backgroundCol exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of write-qr-code.ps1 as of 08/15/2024 09:50:55)* +*(generated by convert-ps2md.ps1 using the comment-based help of write-qr-code.ps1 as of 11/08/2024 12:34:57)* diff --git a/docs/write-quote.md b/docs/write-quote.md index 7c058723..58a6b60c 100644 --- a/docs/write-quote.md +++ b/docs/write-quote.md @@ -6,7 +6,7 @@ This PowerShell script selects a random quote from .../data/quotes.csv and write Parameters ---------- ```powershell -PS> ./write-quote.ps1 [] +/home/markus/Repos/PowerShell/scripts/write-quote.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -67,4 +67,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of write-quote.ps1 as of 08/15/2024 09:50:55)* +*(generated by convert-ps2md.ps1 using the comment-based help of write-quote.ps1 as of 11/08/2024 12:34:57)* diff --git a/docs/write-red.md b/docs/write-red.md index c9aa73a2..50494142 100644 --- a/docs/write-red.md +++ b/docs/write-red.md @@ -6,7 +6,7 @@ This PowerShell script writes text in a red foreground color. Parameters ---------- ```powershell -PS> ./write-red.ps1 [[-text] ] [] +/home/markus/Repos/PowerShell/scripts/write-red.ps1 [[-text] ] [] -text Specifies the text to write @@ -63,4 +63,4 @@ write-host -foregroundcolor red "$text" exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of write-red.ps1 as of 08/15/2024 09:50:55)* +*(generated by convert-ps2md.ps1 using the comment-based help of write-red.ps1 as of 11/08/2024 12:34:57)* diff --git a/docs/write-rot13.md b/docs/write-rot13.md index a082d485..61620093 100644 --- a/docs/write-rot13.md +++ b/docs/write-rot13.md @@ -6,7 +6,7 @@ This PowerShell script writes text encoded or decoded with ROT13. Parameters ---------- ```powershell -PS> ./write-rot13.ps1 [[-text] ] [] +/home/markus/Repos/PowerShell/scripts/write-rot13.ps1 [[-text] ] [] -text Specifies the text to write @@ -82,4 +82,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of write-rot13.ps1 as of 08/15/2024 09:50:55)* +*(generated by convert-ps2md.ps1 using the comment-based help of write-rot13.ps1 as of 11/08/2024 12:34:57)* diff --git a/docs/write-shit.md b/docs/write-shit.md index 5106cce9..edd5b645 100644 --- a/docs/write-shit.md +++ b/docs/write-shit.md @@ -6,7 +6,7 @@ This PowerShell script writes shit to the console (fun). Parameters ---------- ```powershell -PS> ./write-shit.ps1 [] +/home/markus/Repos/PowerShell/scripts/write-shit.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -50,4 +50,4 @@ Write-Output "πŸ’©" exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of write-shit.ps1 as of 08/15/2024 09:50:55)* +*(generated by convert-ps2md.ps1 using the comment-based help of write-shit.ps1 as of 11/08/2024 12:34:57)* diff --git a/docs/write-sine-curves.md b/docs/write-sine-curves.md index 427b5a30..efa46e63 100644 --- a/docs/write-sine-curves.md +++ b/docs/write-sine-curves.md @@ -6,7 +6,7 @@ This PowerShell script writes sine curves. Parameters ---------- ```powershell -PS> ./write-sine-curves.ps1 [] +/home/markus/Repos/PowerShell/scripts/write-sine-curves.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -56,4 +56,4 @@ Script Content } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of write-sine-curves.ps1 as of 08/15/2024 09:50:55)* +*(generated by convert-ps2md.ps1 using the comment-based help of write-sine-curves.ps1 as of 11/08/2024 12:34:57)* diff --git a/docs/write-time.md b/docs/write-time.md index dc3a3f0b..3b9639aa 100644 --- a/docs/write-time.md +++ b/docs/write-time.md @@ -1,12 +1,12 @@ Script: *write-time.ps1* ======================== -This PowerShell script queries the current time and writes it to the console. +This PowerShell script queries the current time and writes it in US format to the console. Parameters ---------- ```powershell -PS> ./write-time.ps1 [] +/home/markus/Repos/PowerShell/scripts/write-time.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -36,7 +36,7 @@ Script Content .SYNOPSIS Writes the current time .DESCRIPTION - This PowerShell script queries the current time and writes it to the console. + This PowerShell script queries the current time and writes it in US format to the console. .EXAMPLE PS> ./write-time.ps1 πŸ•’7:20 PM @@ -57,4 +57,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of write-time.ps1 as of 08/15/2024 09:50:55)* +*(generated by convert-ps2md.ps1 using the comment-based help of write-time.ps1 as of 11/08/2024 12:34:57)* diff --git a/docs/write-typewriter.md b/docs/write-typewriter.md index 6e23e170..b7f27b94 100644 --- a/docs/write-typewriter.md +++ b/docs/write-typewriter.md @@ -6,7 +6,7 @@ This PowerShell script writes the given text with the typewriter effect. Parameters ---------- ```powershell -PS> ./write-typewriter.ps1 [[-text] ] [[-speed] ] [] +/home/markus/Repos/PowerShell/scripts/write-typewriter.ps1 [[-text] ] [[-speed] ] [] -text Specifies the text to write @@ -91,4 +91,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of write-typewriter.ps1 as of 08/15/2024 09:50:55)* +*(generated by convert-ps2md.ps1 using the comment-based help of write-typewriter.ps1 as of 11/08/2024 12:34:57)* diff --git a/docs/write-uppercase.md b/docs/write-uppercase.md index 749a11a5..52521f42 100644 --- a/docs/write-uppercase.md +++ b/docs/write-uppercase.md @@ -6,10 +6,10 @@ This PowerShell script writes the given text in uppercase letters. Parameters ---------- ```powershell -PS> ./write-uppercase.ps1 [[-text] ] [] +/home/markus/Repos/PowerShell/scripts/write-uppercase.ps1 [[-text] ] [] -text - Specifies the text to write + Specifies the text to write (ask user by default) Required? false Position? 1 @@ -25,7 +25,7 @@ PS> ./write-uppercase.ps1 [[-text] ] [] Example ------- ```powershell -PS> ./write-uppercase "Hello World" +PS> ./write-uppercase.ps1 "Hello World" HELLO WORLD ``` @@ -47,9 +47,9 @@ Script Content .DESCRIPTION This PowerShell script writes the given text in uppercase letters. .PARAMETER text - Specifies the text to write + Specifies the text to write (ask user by default) .EXAMPLE - PS> ./write-uppercase "Hello World" + PS> ./write-uppercase.ps1 "Hello World" HELLO WORLD .LINK https://github.com/fleschutz/PowerShell @@ -65,4 +65,4 @@ Write-Output $text.ToUpper() exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of write-uppercase.ps1 as of 08/15/2024 09:50:55)* +*(generated by convert-ps2md.ps1 using the comment-based help of write-uppercase.ps1 as of 11/08/2024 12:34:57)* diff --git a/docs/write-vertical.md b/docs/write-vertical.md index c6637f3a..e9c7ed98 100644 --- a/docs/write-vertical.md +++ b/docs/write-vertical.md @@ -6,7 +6,7 @@ This PowerShell script writes text in vertical direction. Parameters ---------- ```powershell -PS> ./write-vertical.ps1 [[-text] ] [] +/home/markus/Repos/PowerShell/scripts/write-vertical.ps1 [[-text] ] [] -text Specifies the text to write @@ -71,4 +71,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of write-vertical.ps1 as of 08/15/2024 09:50:56)* +*(generated by convert-ps2md.ps1 using the comment-based help of write-vertical.ps1 as of 11/08/2024 12:34:57)* diff --git a/scripts/cd-nextcloud.ps1 b/scripts/cd-nextcloud.ps1 old mode 100644 new mode 100755 diff --git a/scripts/install-gitlab.ps1 b/scripts/install-gitlab.ps1 old mode 100644 new mode 100755 diff --git a/scripts/install-powershell.ps1 b/scripts/install-powershell.ps1 index cd7495dc..fc532674 100755 --- a/scripts/install-powershell.ps1 +++ b/scripts/install-powershell.ps1 @@ -430,8 +430,13 @@ try { } if (-not $UseMSI) { - Write-Host "Removing current installation at: $Destination ..." - Remove-Destination $Destination + Write-Host "⏳ (4/5) Removing current installation at: $Destination ..." + if ($IsLinuxEnv) { + & sudo rm -rf "$Destination" + } else { + Remove-Destination "$Destination" + } + if (Test-Path $Destination) { Write-Host "⏳ (4/4) Copying files to $Destination... " # only copy files as folders will already exist at $Destination diff --git a/scripts/list-local-ip.ps1 b/scripts/list-local-ip.ps1 old mode 100644 new mode 100755 diff --git a/scripts/list-old-branches.ps1 b/scripts/list-old-branches.ps1 old mode 100644 new mode 100755 diff --git a/scripts/new-reboot-task.ps1 b/scripts/new-reboot-task.ps1 old mode 100644 new mode 100755 diff --git a/scripts/play-chess.ps1 b/scripts/play-chess.ps1 old mode 100644 new mode 100755 diff --git a/scripts/scan-folder.ps1 b/scripts/scan-folder.ps1 old mode 100644 new mode 100755 diff --git a/scripts/watch-ping.ps1 b/scripts/watch-ping.ps1 old mode 100644 new mode 100755 diff --git a/scripts/write-hands-off.ps1 b/scripts/write-hands-off.ps1 old mode 100644 new mode 100755 diff --git a/scripts/write-location.ps1 b/scripts/write-location.ps1 old mode 100644 new mode 100755