diff --git a/Data/scripts.csv b/Data/scripts.csv index d8b7c144..4f36fc82 100644 --- a/Data/scripts.csv +++ b/Data/scripts.csv @@ -91,6 +91,7 @@ list-branches.ps1, lists all branches in the current/given Git repository list-cheat-sheet.ps1, lists the PowerShell cheat sheet list-city-weather.ps1, lists the current weather of cities worldwide (east to west) list-commits.ps1, lists all commits in the current/given Git repository +list-console-colors.ps1, lists all console colors list-cli-tools.ps1, lists available command-line interface (CLI) tools list-clipboard.ps1, lists the contents of the clipboard list-credits.ps1, shows the credits diff --git a/README.md b/README.md index 31489748..e7e8ef70 100644 --- a/README.md +++ b/README.md @@ -193,6 +193,7 @@ Mega Collection of PowerShell Scripts * [list-automatic-variables.ps1](Scripts/list-automatic-variables.ps1) - lists the automatic variables of PowerShell * [list-cheat-sheet.ps1](Scripts/list-cheat-sheet.ps1) - lists the PowerShell cheat sheet * [list-cmdlets.ps1](Scripts/list-cmdlets.ps1) - lists the PowerShell cmdlets +* [list-console-colors.ps1](Scripts/list-console-colors.ps1) - lists all console colors * [list-modules.ps1](Scripts/list-modules.ps1) - lists the PowerShell modules * [list-profiles.ps1](Scripts/list-profiles.ps1) - lists your PowerShell profiles * [list-scripts.ps1](Scripts/list-scripts.ps1) - lists all PowerShell scripts in this repository diff --git a/Scripts/list-console-colors.ps1 b/Scripts/list-console-colors.ps1 new file mode 100755 index 00000000..a1feafb3 --- /dev/null +++ b/Scripts/list-console-colors.ps1 @@ -0,0 +1,31 @@ +<# +.SYNOPSIS + list-console-colors.ps1 +.DESCRIPTION + Lists all console colors +.EXAMPLE + PS> .\list-console-colors.ps1 +.LINK + https://github.com/fleschutz/PowerShell +.NOTES + Author: Markus Fleschutz + Creation Date: 2021-08-27 + License: CC0 +#> + +try { + $Colors = [Enum]::GetValues([ConsoleColor]) + "" + "Name `tForeground `tBackground" + "---- `t---------- `t----------" + foreach($Color in $Colors) { + write-host -noNewline "$Color `t" + write-host -noNewline -foregroundcolor $Color "$Color `t" + write-host -noNewline -backgroundcolor $Color "$Color" + write-host "" + } + exit 0 +} catch { + write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" + exit 1 +}