diff --git a/Scripts/add-firewall-rules.ps1 b/Scripts/add-firewall-rules.ps1 index 434978a1..2ee7a14f 100755 --- a/Scripts/add-firewall-rules.ps1 +++ b/Scripts/add-firewall-rules.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - add-firewall-rules.ps1 [] -.DESCRIPTION Adds firewall rules for the given executables (needs admin rights) +.DESCRIPTION + add-firewall-rules.ps1 [] .EXAMPLE PS> ./add-firewall-rules C:\MyApp\bin Adding firewall rule for C:\MyApp\bin\app1.exe diff --git a/Scripts/add-memo.ps1 b/Scripts/add-memo.ps1 index b52b96af..d7ef1d57 100755 --- a/Scripts/add-memo.ps1 +++ b/Scripts/add-memo.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - add-memo.ps1 [] + Adds a memo to Memos.csv in the home folder .DESCRIPTION - Adds the given memo text to $HOME/Memos.csv + add-memo.ps1 [] .EXAMPLE PS> ./add-memo "Buy apples" ✔️ added to 📄/home/markus/Memos.csv diff --git a/Scripts/alert.ps1 b/Scripts/alert.ps1 index 6858f5c0..89ff5354 100755 --- a/Scripts/alert.ps1 +++ b/Scripts/alert.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - alert.ps1 [] -.DESCRIPTION Handle and escalate the given alert message +.DESCRIPTION + alert.ps1 [] .EXAMPLE PS> ./alert "Harddisk failure" .LINK diff --git a/Scripts/cd-desktop.ps1 b/Scripts/cd-desktop.ps1 index 4706eebf..cb9d0042 100755 --- a/Scripts/cd-desktop.ps1 +++ b/Scripts/cd-desktop.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - cd-desktop.ps1 -.DESCRIPTION Change the working directory to the user's desktop folder +.DESCRIPTION + cd-desktop.ps1 .EXAMPLE PS> ./cd-desktop 📂/home/markus/Desktop diff --git a/Scripts/cd-docs.ps1 b/Scripts/cd-docs.ps1 index de30cf87..3255f047 100755 --- a/Scripts/cd-docs.ps1 +++ b/Scripts/cd-docs.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - cd-docs.ps1 -.DESCRIPTION Change the working directory to the user's documents folder +.DESCRIPTION + cd-docs.ps1 .EXAMPLE PS> ./cd-docs 📂/home/markus/Documents diff --git a/Scripts/cd-downloads.ps1 b/Scripts/cd-downloads.ps1 index 4e67833f..0edd5804 100755 --- a/Scripts/cd-downloads.ps1 +++ b/Scripts/cd-downloads.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - cd-downloads.ps1 -.DESCRIPTION Change the working directory to the user's downloads folder +.DESCRIPTION + cd-downloads.ps1 .EXAMPLE PS> ./cd-downloads 📂/home/markus/Downloads diff --git a/Scripts/cd-dropbox.ps1 b/Scripts/cd-dropbox.ps1 index f1beb6b2..0de07981 100755 --- a/Scripts/cd-dropbox.ps1 +++ b/Scripts/cd-dropbox.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - cd-dropbox.ps1 -.DESCRIPTION Change the working directory to the user's Dropbox folder +.DESCRIPTION + cd-dropbox.ps1 .EXAMPLE PS> ./cd-dropbox 📂/home/markus/Dropbox diff --git a/Scripts/cd-home.ps1 b/Scripts/cd-home.ps1 index adcf5bdd..c731825a 100755 --- a/Scripts/cd-home.ps1 +++ b/Scripts/cd-home.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - cd-home.ps1 -.DESCRIPTION Change the working directory to the user's home directory +.DESCRIPTION + cd-home.ps1 .EXAMPLE PS> ./cd-home 📂/home/markus diff --git a/Scripts/cd-music.ps1 b/Scripts/cd-music.ps1 index 3ff85ef7..9159ecf4 100755 --- a/Scripts/cd-music.ps1 +++ b/Scripts/cd-music.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - cd-music.ps1 -.DESCRIPTION Change the working directory to the user's music folder +.DESCRIPTION + cd-music.ps1 .EXAMPLE PS> ./cd-music 📂/home/markus/Music diff --git a/Scripts/cd-onedrive.ps1 b/Scripts/cd-onedrive.ps1 index 8aa8bee1..dd161108 100644 --- a/Scripts/cd-onedrive.ps1 +++ b/Scripts/cd-onedrive.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - cd-onedrive.ps1 -.DESCRIPTION Change the working directory to the user's OneDrive folder +.DESCRIPTION + cd-onedrive.ps1 .EXAMPLE PS> ./cd-onedrive 📂/home/markus/OneDrive diff --git a/Scripts/cd-pics.ps1 b/Scripts/cd-pics.ps1 index 4e757171..89f8f2a4 100755 --- a/Scripts/cd-pics.ps1 +++ b/Scripts/cd-pics.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - cd-pics.ps1 -.DESCRIPTION Change the working directory to the user's pictures folder +.DESCRIPTION + cd-pics.ps1 .EXAMPLE PS> ./cd-pics 📂/home/markus/Pictures diff --git a/Scripts/cd-recycle-bin.ps1 b/Scripts/cd-recycle-bin.ps1 index 9a2d3457..58d459f9 100644 --- a/Scripts/cd-recycle-bin.ps1 +++ b/Scripts/cd-recycle-bin.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - cd-recycle-bin.ps1 -.DESCRIPTION Change the working directory to the user's recycle bin folder +.DESCRIPTION + cd-recycle-bin.ps1 .EXAMPLE PS> ./cd-recycle-bin 📂C:\$Recycle.Bin\S-1-5-21-123404-23309-294260-1001 diff --git a/Scripts/cd-repos.ps1 b/Scripts/cd-repos.ps1 index 7bc0e3a1..0270a8c4 100644 --- a/Scripts/cd-repos.ps1 +++ b/Scripts/cd-repos.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - cd-repos.ps1 -.DESCRIPTION Change the working directory to the user's Git repositories folder +.DESCRIPTION + cd-repos.ps1 .EXAMPLE PS> ./cd-repos 📂/home/markus/Repos diff --git a/Scripts/cd-root.ps1 b/Scripts/cd-root.ps1 index eac29ff4..2b96aa68 100755 --- a/Scripts/cd-root.ps1 +++ b/Scripts/cd-root.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - cd-root.ps1 -.DESCRIPTION Change the working directory to the root directory (C:\ on Windows) +.DESCRIPTION + cd-root.ps1 .EXAMPLE PS> ./cd-root 📂C:\ diff --git a/Scripts/cd-scripts.ps1 b/Scripts/cd-scripts.ps1 index c6c65df2..57db5149 100755 --- a/Scripts/cd-scripts.ps1 +++ b/Scripts/cd-scripts.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - cd-scripts.ps1 -.DESCRIPTION Change the working directory to the PowerShell scripts folder +.DESCRIPTION + cd-scripts.ps1 .EXAMPLE PS> ./cd-scripts 📂/home/markus/PowerShell/Scripts diff --git a/Scripts/cd-ssh.ps1 b/Scripts/cd-ssh.ps1 index 116273fe..61cac91f 100755 --- a/Scripts/cd-ssh.ps1 +++ b/Scripts/cd-ssh.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - cd-ssh.ps1 -.DESCRIPTION Change the working directory to the user's SSH folder +.DESCRIPTION + cd-ssh.ps1 .EXAMPLE PS> ./cd-ssh 📂/home/markus/.ssh diff --git a/Scripts/cd-up.ps1 b/Scripts/cd-up.ps1 index 13646c29..700839b9 100755 --- a/Scripts/cd-up.ps1 +++ b/Scripts/cd-up.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - cd-up.ps1 -.DESCRIPTION Change the working directory to one level up +.DESCRIPTION + cd-up.ps1 .EXAMPLE PS> .\cd-up (one level up) diff --git a/Scripts/cd-up2.ps1 b/Scripts/cd-up2.ps1 index d3cd25e9..0bb8c4ee 100644 --- a/Scripts/cd-up2.ps1 +++ b/Scripts/cd-up2.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - cd-up2.ps1 -.DESCRIPTION Change the working directory to two directory levels up +.DESCRIPTION + cd-up2.ps1 .EXAMPLE PS> ./cd-up2 (two levels up) diff --git a/Scripts/cd-up3.ps1 b/Scripts/cd-up3.ps1 index 2e661414..4722af88 100644 --- a/Scripts/cd-up3.ps1 +++ b/Scripts/cd-up3.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - cd-up3.ps1 -.DESCRIPTION Change the working directory to three directory levels up +.DESCRIPTION + cd-up3.ps1 .EXAMPLE PS> ./cd-up3 (three levels up) diff --git a/Scripts/cd-up4.ps1 b/Scripts/cd-up4.ps1 index 3e4119b5..c866cf97 100644 --- a/Scripts/cd-up4.ps1 +++ b/Scripts/cd-up4.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - cd-up4.ps1 -.DESCRIPTION Change the working directory to four directory levels up +.DESCRIPTION + cd-up4.ps1 .EXAMPLE PS> ./cd-up4 (four levels up) diff --git a/Scripts/cd-videos.ps1 b/Scripts/cd-videos.ps1 index d5cce2d9..e2611fae 100755 --- a/Scripts/cd-videos.ps1 +++ b/Scripts/cd-videos.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - cd-videos.ps1 -.DESCRIPTION Change the working directory to the user's videos folder +.DESCRIPTION + cd-videos.ps1 .EXAMPLE PS> ./cd-videos 📂/home/markus/Videos diff --git a/Scripts/check-cpu-temp.ps1 b/Scripts/check-cpu-temp.ps1 index 5dcc6512..df1fbf56 100755 --- a/Scripts/check-cpu-temp.ps1 +++ b/Scripts/check-cpu-temp.ps1 @@ -1,10 +1,11 @@ <# .SYNOPSIS - check-cpu-temp.ps1 -.DESCRIPTION Checks the CPU temperature +.DESCRIPTION + check-cpu-temp.ps1 .EXAMPLE PS> ./check-cpu-temp + ✔️ 30.3 °C CPU temperature - good .LINK https://github.com/fleschutz/PowerShell .NOTES diff --git a/Scripts/check-dns-resolution.ps1 b/Scripts/check-dns-resolution.ps1 index c682cf80..2197a248 100755 --- a/Scripts/check-dns-resolution.ps1 +++ b/Scripts/check-dns-resolution.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - check-dns-resolution.ps1 -.DESCRIPTION Checks the DNS resolution with frequently used domain names +.DESCRIPTION + check-dns-resolution.ps1 .EXAMPLE PS> ./check-dns-resolution ✔️ 11.8 domains/sec (177 domains resolved in 15 sec) diff --git a/Scripts/check-drive-space.ps1 b/Scripts/check-drive-space.ps1 index 1046895c..175c65cd 100755 --- a/Scripts/check-drive-space.ps1 +++ b/Scripts/check-drive-space.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - check-drive-space.ps1 [] [] -.DESCRIPTION Checks a drive for free space left (20 GB by default) +.DESCRIPTION + check-drive-space.ps1 [] [] .EXAMPLE PS> ./check-drive-space C ✔️ 172 GB left on drive C (61 of 233 GB used) diff --git a/Scripts/check-file-system.ps1 b/Scripts/check-file-system.ps1 index 529f77a2..3a95f55d 100755 --- a/Scripts/check-file-system.ps1 +++ b/Scripts/check-file-system.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - check-file-system.ps1 [] -.DESCRIPTION Checks the file system of a drive (needs admin rights) +.DESCRIPTION + check-file-system.ps1 [] .EXAMPLE PS> ./check-file-system C ✔️ file system on drive C is clean diff --git a/Scripts/check-health.ps1 b/Scripts/check-health.ps1 index 52e66491..ef5f35bd 100755 --- a/Scripts/check-health.ps1 +++ b/Scripts/check-health.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - check-health.ps1 -.DESCRIPTION Checks the health of the local computer +.DESCRIPTION + check-health.ps1 .EXAMPLE PS> ./check-health ✔️ 1213 GB left for swap space (67 of 1280 GB used) diff --git a/Scripts/check-ipv4-address.ps1 b/Scripts/check-ipv4-address.ps1 index 53bb3a29..2f45f589 100755 --- a/Scripts/check-ipv4-address.ps1 +++ b/Scripts/check-ipv4-address.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - check-ipv4-address.ps1 [
] -.DESCRIPTION Checks the given IPv4 address for validity +.DESCRIPTION + check-ipv4-address.ps1 [
] .EXAMPLE PS> ./check-ipv4-address 192.168.11.22 ✔️ IPv4 192.168.11.22 is valid diff --git a/Scripts/check-ipv6-address.ps1 b/Scripts/check-ipv6-address.ps1 index 2d73b69d..a83f5b11 100755 --- a/Scripts/check-ipv6-address.ps1 +++ b/Scripts/check-ipv6-address.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - check-ipv6-address.ps1 [
] -.DESCRIPTION Checks the given IPv6 address for validity +.DESCRIPTION + check-ipv6-address.ps1 [
] .EXAMPLE PS> ./check-ipv6-address fe80::200:5aee:feaa:20a2 ✔️ IPv6 fe80::200:5aee:feaa:20a2 is valid diff --git a/Scripts/check-mac-address.ps1 b/Scripts/check-mac-address.ps1 index 79264023..8e13d92f 100755 --- a/Scripts/check-mac-address.ps1 +++ b/Scripts/check-mac-address.ps1 @@ -1,8 +1,9 @@ <# .SYNOPSIS - check-mac-address.ps1 [] + Checks the given MAC address for validity .DESCRIPTION - Checks the given MAC address for validity (MAC address like 00:00:00:00:00:00 or 00-00-00-00-00-00 or 000000000000). + Supported MAC address formats are: 00:00:00:00:00:00 or 00-00-00-00-00-00 or 000000000000. + check-mac-address.ps1 [] .EXAMPLE PS> ./check-mac-address 11:22:33:44:55:66 ✔️ MAC address 11:22:33:44:55:66 is valid diff --git a/Scripts/check-ping.ps1 b/Scripts/check-ping.ps1 index 5a6ba763..3a617d0f 100755 --- a/Scripts/check-ping.ps1 +++ b/Scripts/check-ping.ps1 @@ -1,9 +1,9 @@ <# .SYNOPSIS - check-ping.ps1 [] -.DESCRIPTION Checks the ping latency from the local computer to selected Internet hosts - (default is: 'amazon.com,apple.com,bing.com,cnn.com,dropbox.com,facebook.com,google.com,live.com,twitter.com,youtube.com) +.DESCRIPTION + Hosts by default are: amazon.com,apple.com,bing.com,cnn.com,dropbox.com,facebook.com,google.com,live.com,twitter.com,youtube.com + check-ping.ps1 [] .EXAMPLE PS> ./check-ping ✔️ 36 ms ping average (13 ms min, 109 ms max, 10 hosts) diff --git a/Scripts/check-smart-devices.ps1 b/Scripts/check-smart-devices.ps1 index fca040e2..916b5702 100755 --- a/Scripts/check-smart-devices.ps1 +++ b/Scripts/check-smart-devices.ps1 @@ -1,9 +1,10 @@ <# .SYNOPSIS - check-smart-devices.ps1 [] + Performs a selftest on your S.M.A.R.T. HDD/SSD devices. .DESCRIPTION - Performs a selftest on your S.M.A.R.T. HDD/SSD devices. Type is either short(default) or long. - Requires smartctl (smartmontools) and admin rights. + check-smart-devices.ps1 [] + Type is either short(default) or long. + Requires smartctl (smartmontools package) and admin rights. .EXAMPLE PS> ./check-smart-devices ✔️ short selftest started on S.M.A.R.T. device /dev/sda diff --git a/Scripts/check-subnet-mask.ps1 b/Scripts/check-subnet-mask.ps1 index 0b296ed2..d71ac6a5 100755 --- a/Scripts/check-subnet-mask.ps1 +++ b/Scripts/check-subnet-mask.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - check-subnet-mask.ps1 [
] -.DESCRIPTION Checks the given subnet mask for validity +.DESCRIPTION + check-subnet-mask.ps1 [
] .EXAMPLE PS> ./check-subnet-mask 255.255.255.0 ✔️ subnet mask 255.255.255.0 is valid diff --git a/Scripts/check-swap-space.ps1 b/Scripts/check-swap-space.ps1 index 4f76a13c..69076fb5 100755 --- a/Scripts/check-swap-space.ps1 +++ b/Scripts/check-swap-space.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - check-swap-space.ps1 [] -.DESCRIPTION Checks the free swap space +.DESCRIPTION + check-swap-space.ps1 [] .EXAMPLE PS> ./check-swap-space ✔️ 1213 GB left for swap space (67 of 1280 GB used) diff --git a/Scripts/check-symlinks.ps1 b/Scripts/check-symlinks.ps1 index 59f18abf..e2825b39 100755 --- a/Scripts/check-symlinks.ps1 +++ b/Scripts/check-symlinks.ps1 @@ -1,8 +1,9 @@ <# .SYNOPSIS - check-symlinks.ps1 [] + Checks every symlink in a folder (including subfolders) .DESCRIPTION - Checks every symlink in a directory tree. + check-symlinks.ps1 [] + Returns the number of broken symlinks as exit value. .EXAMPLE PS> ./check-symlinks . ✔️ 0 out of 10 symlinks are broken in 📂/home/markus @@ -12,12 +13,12 @@ Author: Markus Fleschutz · License: CC0 #> -param([string]$DirTree = "") +param([string]$folder = "") try { - if ($DirTree -eq "" ) { $DirTree = read-host "Enter the path to the directory tree" } + if ($folder -eq "" ) { $folder = read-host "Enter the path to the folder" } - $FullPath = Resolve-Path "$DirTree" + $FullPath = Resolve-Path "$folder" write-progress "Checking every symlink in 📂$FullPath..." [int]$NumTotal = [int]$NumBroken = 0 Get-ChildItem $FullPath -recurse | Where { $_.Attributes -match "ReparsePoint" } | ForEach-Object { diff --git a/Scripts/check-weather.ps1 b/Scripts/check-weather.ps1 index 700ceeb8..4eb8ac16 100755 --- a/Scripts/check-weather.ps1 +++ b/Scripts/check-weather.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - check-weather.ps1 [] -.DESCRIPTION Checks the weather for critical values +.DESCRIPTION + check-weather.ps1 [] .EXAMPLE PS> ./check-weather .LINK diff --git a/Scripts/check-windows-system-files.ps1 b/Scripts/check-windows-system-files.ps1 index 923ba7bf..07341591 100755 --- a/Scripts/check-windows-system-files.ps1 +++ b/Scripts/check-windows-system-files.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - check-windows-system-files.ps1 -.DESCRIPTION Checks the validity of the Windows system files (requires admin rights) +.DESCRIPTION + check-windows-system-files.ps1 .EXAMPLE PS> ./check-windows-system-files ✔️ checked Windows system files diff --git a/Scripts/check-xml-file.ps1 b/Scripts/check-xml-file.ps1 index 73e63028..fc87c176 100755 --- a/Scripts/check-xml-file.ps1 +++ b/Scripts/check-xml-file.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - check-xml-file [] -.DESCRIPTION Checks the given XML file for validity +.DESCRIPTION + check-xml-file [] .EXAMPLE PS> ./check-xml-file myfile.xml ✔️ XML file is valid diff --git a/Scripts/cherry-picker.ps1 b/Scripts/cherry-picker.ps1 index 1b29d1f2..934d6726 100755 --- a/Scripts/cherry-picker.ps1 +++ b/Scripts/cherry-picker.ps1 @@ -1,7 +1,8 @@ <# .SYNOPSIS - cherry-picker.ps1 [] [] [] [] + Cherry-picks a Git commit into one or more branches .DESCRIPTION + cherry-picker.ps1 [] [] [] [] Cherry-picks a Git commit into one or more branches (branch names need to be separated by spaces) NOTE: in case of merge conflicts the script stops immediately! .EXAMPLE diff --git a/Scripts/clean-repo.ps1 b/Scripts/clean-repo.ps1 index 5249fb4e..d624c59c 100755 --- a/Scripts/clean-repo.ps1 +++ b/Scripts/clean-repo.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - clean-repo.ps1 [] + Cleans a Git repository from untracked files (including submodules) .DESCRIPTION - Cleans a Git repository from untracked files (including submodules, e.g. for a fresh build) + clean-repo.ps1 [] .EXAMPLE PS> ./clean-repo C:\MyRepo 🧹 Cleaning Git repository 📂C:\MyRepo from untracked files... diff --git a/Scripts/clean-repos.ps1 b/Scripts/clean-repos.ps1 index 3db8ac78..84f9c930 100755 --- a/Scripts/clean-repos.ps1 +++ b/Scripts/clean-repos.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - clean-repos.ps1 [] + Cleans all Git repositories in a folder from untracked files (including submodules) .DESCRIPTION - Cleans all Git repositories under the current/given directory from untracked files (including submodules) + clean-repos.ps1 [] .EXAMPLE PS> ./clean-repos C:\MyRepos .NOTES diff --git a/Scripts/clear-recycle-bin.ps1 b/Scripts/clear-recycle-bin.ps1 index be0d893c..ec2a1682 100755 --- a/Scripts/clear-recycle-bin.ps1 +++ b/Scripts/clear-recycle-bin.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - clear-recycle-bin.ps1 + Removes the content of the recycle bin folder permanently .DESCRIPTION - Removes the content of the recycle bin folder + clear-recycle-bin.ps1 NOTE: can not be undo! .EXAMPLE PS> ./clear-recycle-bin diff --git a/Scripts/clone-repos.ps1 b/Scripts/clone-repos.ps1 index d46810b6..c9317cd5 100755 --- a/Scripts/clone-repos.ps1 +++ b/Scripts/clone-repos.ps1 @@ -1,22 +1,22 @@ <# .SYNOPSIS - clone-repos.ps1 [] + Clones well-known Git repositories into a folder .DESCRIPTION - Clones well-known Git repositories under the current/given directory + clone-repos.ps1 [] .EXAMPLE - PS> ./clone-repos C:\MyRepos + PS> ./clone-repos C:\Users\Markus\Repos .NOTES Author: Markus Fleschutz · License: CC0 .LINK https://github.com/fleschutz/PowerShell #> -param([string]$ParentDir = "$PWD") +param([string]$folder = "$PWD") try { $StopWatch = [system.diagnostics.stopwatch]::startNew() - if (-not(test-path "$ParentDir" -pathType container)) { throw "Can't access directory: $ParentDir" } + if (-not(test-path "$folder" -pathType container)) { throw "Can't access directory: $folder" } $Null = (git --version) if ($lastExitCode -ne "0") { throw "Can't execute 'git' - make sure Git is installed and available" } @@ -32,22 +32,22 @@ try { [string]$Shallow = $Row.Shallow [string]$URL = $Row.URL - if (test-path "$ParentDir/$FolderName" -pathType container) { + if (test-path "$folder/$FolderName" -pathType container) { "📂$FolderName exists, skipping..." continue } if ($Shallow -eq "yes") { "🢃 Cloning to 📂$FolderName, $Branch branch, shallow..." - & git clone --branch "$Branch" --depth 1 --shallow-submodules --recurse-submodules "$URL" "$ParentDir/$FolderName" + & git clone --branch "$Branch" --depth 1 --shallow-submodules --recurse-submodules "$URL" "$folder/$FolderName" } else { "🢃 Cloning to 📂$FolderName, $Branch branch, full history..." - & git clone --branch "$Branch" --recurse-submodules "$URL" "$ParentDir/$FolderName" + & git clone --branch "$Branch" --recurse-submodules "$URL" "$folder/$FolderName" } if ($lastExitCode -ne "0") { throw "'git clone $URL' failed" } $Count++ } [int]$Elapsed = $StopWatch.Elapsed.TotalSeconds - "✔️ cloned $Count Git repositories at 📂$ParentDir in $Elapsed sec" + "✔️ cloned $Count Git repositories into 📂$folder in $Elapsed sec" exit 0 # success } catch { "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))" diff --git a/Scripts/close-calculator.ps1 b/Scripts/close-calculator.ps1 index 961797c9..0d754826 100755 --- a/Scripts/close-calculator.ps1 +++ b/Scripts/close-calculator.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - close-calculator.ps1 -.DESCRIPTION Closes the calculator program gracefully +.DESCRIPTION + close-calculator.ps1 .EXAMPLE PS> ./close-calculator .NOTES diff --git a/Scripts/close-chrome.ps1 b/Scripts/close-chrome.ps1 index 713f2dbd..ee7295a7 100755 --- a/Scripts/close-chrome.ps1 +++ b/Scripts/close-chrome.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - close-chrome.ps1 -.DESCRIPTION Closes the Google Chrome Web browser +.DESCRIPTION + close-chrome.ps1 .EXAMPLE PS> ./close-chrome .NOTES diff --git a/Scripts/close-cortana.ps1 b/Scripts/close-cortana.ps1 index 12f80403..4e8b9eb7 100755 --- a/Scripts/close-cortana.ps1 +++ b/Scripts/close-cortana.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - close-cortana.ps1 + Closes Microsoft's Cortana application .DESCRIPTION - Closes Cortana gracefully + close-cortana.ps1 .EXAMPLE PS> ./close-cortana .NOTES diff --git a/Scripts/close-edge.ps1 b/Scripts/close-edge.ps1 index 3026dd64..9eb55743 100755 --- a/Scripts/close-edge.ps1 +++ b/Scripts/close-edge.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - close-edge.ps1 + Closes Microsoft's Edge Web browser .DESCRIPTION - Closes the Microsoft Edge Web browser + close-edge.ps1 .EXAMPLE PS> ./close-edge .NOTES diff --git a/Scripts/close-file-explorer.ps1 b/Scripts/close-file-explorer.ps1 index aff075a6..8921d65d 100755 --- a/Scripts/close-file-explorer.ps1 +++ b/Scripts/close-file-explorer.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - close-file-explorer.ps1 + Closes Microsoft's File Explorer .DESCRIPTION - Closes Microsoft File Explorer gracefully + close-file-explorer.ps1 .EXAMPLE PS> ./close-file-explorer .NOTES diff --git a/Scripts/close-firefox.ps1 b/Scripts/close-firefox.ps1 index 4df76973..0796ab5c 100755 --- a/Scripts/close-firefox.ps1 +++ b/Scripts/close-firefox.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - close-firefox.ps1 + Closes Mozilla's Firefox Web browser .DESCRIPTION - Closes the Firefox Web browser + close-firefox.ps1 .EXAMPLE PS> ./close-firefox .NOTES diff --git a/Scripts/close-netflix.ps1 b/Scripts/close-netflix.ps1 index 751db72a..d408314f 100755 --- a/Scripts/close-netflix.ps1 +++ b/Scripts/close-netflix.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - close-netflix.ps1 + Closes the Netflix application .DESCRIPTION - Closes the Netflix application gracefully + close-netflix.ps1 .EXAMPLE PS> ./close-netflix .NOTES diff --git a/Scripts/close-onedrive.ps1 b/Scripts/close-onedrive.ps1 index 8af2d893..80d8bf35 100755 --- a/Scripts/close-onedrive.ps1 +++ b/Scripts/close-onedrive.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - close-onedrive.ps1 + Closes Microsoft's OneDrive folder .DESCRIPTION - Closes Microsoft OneDrive gracefully + close-onedrive.ps1 .EXAMPLE PS> ./close-onedrive .NOTES diff --git a/Scripts/close-program.ps1 b/Scripts/close-program.ps1 index 3a465656..173034b4 100755 --- a/Scripts/close-program.ps1 +++ b/Scripts/close-program.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - close-program.ps1 [] [] [] -.DESCRIPTION Closes the processes of the given program gracefully +.DESCRIPTION + close-program.ps1 [] [] [] .EXAMPLE PS> ./close-program "Google Chrome" "chrome.exe" .NOTES diff --git a/Scripts/close-system-settings.ps1 b/Scripts/close-system-settings.ps1 index 90b57819..6b88742f 100755 --- a/Scripts/close-system-settings.ps1 +++ b/Scripts/close-system-settings.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - close-system-settings.ps1 + Closes the System Settings window .DESCRIPTION - Closes the System Settings gracefully + close-system-settings.ps1 .EXAMPLE PS> ./close-system-settings .NOTES diff --git a/Scripts/close-thunderbird.ps1 b/Scripts/close-thunderbird.ps1 index c027c4ef..3bf534d4 100755 --- a/Scripts/close-thunderbird.ps1 +++ b/Scripts/close-thunderbird.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - close-thunderbird.ps1 + Closes Mozilla's Thunderbird email client .DESCRIPTION - Closes the mail client Mozilla Thunderbird gracefully + close-thunderbird.ps1 .EXAMPLE PS> ./close-thunderbird .NOTES diff --git a/Scripts/close-vlc.ps1 b/Scripts/close-vlc.ps1 index feb49bf7..d70ffefe 100755 --- a/Scripts/close-vlc.ps1 +++ b/Scripts/close-vlc.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - close-vlc.ps1 -.DESCRIPTION Closes the VLC media player application +.DESCRIPTION + close-vlc.ps1 .EXAMPLE PS> ./close-vlc .NOTES diff --git a/Scripts/close-windows-terminal.ps1 b/Scripts/close-windows-terminal.ps1 index 9fd9cc31..16ec368d 100755 --- a/Scripts/close-windows-terminal.ps1 +++ b/Scripts/close-windows-terminal.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - close-windows-terminal.ps1 -.DESCRIPTION Closes the Windows Terminal application +.DESCRIPTION + close-windows-terminal.ps1 .EXAMPLE PS> ./close-windows-terminal .NOTES diff --git a/Scripts/configure-git.ps1 b/Scripts/configure-git.ps1 index 9b2a0e5f..7d611808 100755 --- a/Scripts/configure-git.ps1 +++ b/Scripts/configure-git.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - configure-git.ps1 [] [] [] + Configures the user settings for Git .DESCRIPTION - Sets up the Git user configuration + configure-git.ps1 [] [] [] .EXAMPLE PS> ./configure-git .NOTES diff --git a/Scripts/convert-csv2txt.ps1 b/Scripts/convert-csv2txt.ps1 index e40d26fa..63fc4336 100755 --- a/Scripts/convert-csv2txt.ps1 +++ b/Scripts/convert-csv2txt.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - convert-csv2txt.ps1 [] -.DESCRIPTION Converts a .CSV file into a text file +.DESCRIPTION + convert-csv2txt.ps1 [] .EXAMPLE PS> ./convert-csv2txt salaries.csv .NOTES diff --git a/Scripts/convert-mysql2csv.ps1 b/Scripts/convert-mysql2csv.ps1 index 033efefa..b8f256cf 100755 --- a/Scripts/convert-mysql2csv.ps1 +++ b/Scripts/convert-mysql2csv.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - convert-mysql2csv.ps1 [] [] [] [] [] -.DESCRIPTION Convert a MySQL database table to a .CSV file +.DESCRIPTION + convert-mysql2csv.ps1 [] [] [] [] [] .EXAMPLE PS> ./convert-mysql2csv .NOTES diff --git a/Scripts/convert-ps2bat.ps1 b/Scripts/convert-ps2bat.ps1 index 5d1f487f..a1e3ed7d 100644 --- a/Scripts/convert-ps2bat.ps1 +++ b/Scripts/convert-ps2bat.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - convert-ps2bat.ps1 [] -.DESCRIPTION Converts a PowerShell script to .bat files +.DESCRIPTION + convert-ps2bat.ps1 [] .EXAMPLE PS> ./convert-ps2bat *.ps1 .NOTES diff --git a/Scripts/convert-ps2md.ps1 b/Scripts/convert-ps2md.ps1 index e6fbb402..057c5d16 100644 --- a/Scripts/convert-ps2md.ps1 +++ b/Scripts/convert-ps2md.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - convert-ps2md.ps1 [] -.DESCRIPTION Converts the comment-based help of a PowerShell script to Markdown +.DESCRIPTION + convert-ps2md.ps1 [] .EXAMPLE PS> ./convert-ps2md myscript.ps1 .NOTES diff --git a/Scripts/convert-sql2csv.ps1 b/Scripts/convert-sql2csv.ps1 index ef93a8bc..08cc7057 100755 --- a/Scripts/convert-sql2csv.ps1 +++ b/Scripts/convert-sql2csv.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - convert-sql2csv.ps1 [] [] [] [] [] -.DESCRIPTION Converts a SQL database table to a .CSV file +.DESCRIPTION + convert-sql2csv.ps1 [] [] [] [] [] .EXAMPLE PS> ./convert-sql2csv .NOTES diff --git a/Scripts/convert-txt2wav.ps1 b/Scripts/convert-txt2wav.ps1 index 8e433161..855b4db5 100755 --- a/Scripts/convert-txt2wav.ps1 +++ b/Scripts/convert-txt2wav.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - convert-txt2wav.ps1 [] [] -.DESCRIPTION Converts text to a .WAV audio file +.DESCRIPTION + convert-txt2wav.ps1 [] [] .EXAMPLE PS> ./convert-txt2wav "Hello World" spoken.wav .NOTES diff --git a/Scripts/copy-photos-sorted.ps1 b/Scripts/copy-photos-sorted.ps1 index 18ddf53e..690a102c 100755 --- a/Scripts/copy-photos-sorted.ps1 +++ b/Scripts/copy-photos-sorted.ps1 @@ -1,8 +1,9 @@ <# .SYNOPSIS - copy-photos-sorted.ps1 [] [] + Copy image files sorted by year and month .DESCRIPTION Copy image files from SourceDir to TargetDir sorted by year and month + copy-photos-sorted.ps1 [] [] .EXAMPLE PS> ./copy-photos-sorted D:\Mobile\DCIM C:\MyPhotoAlbum .NOTES diff --git a/Scripts/decrypt-file.ps1 b/Scripts/decrypt-file.ps1 index 7ad9e412..7adc28e6 100755 --- a/Scripts/decrypt-file.ps1 +++ b/Scripts/decrypt-file.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - decrypt-file.ps1 [] [] -.DESCRIPTION Decrypts the given file +.DESCRIPTION + decrypt-file.ps1 [] [] .EXAMPLE PS> ./decrypt-file-rules C:\MyFile.txt "123" .NOTES diff --git a/Scripts/display-time.ps1 b/Scripts/display-time.ps1 index da0db2cf..4d0c84b6 100755 --- a/Scripts/display-time.ps1 +++ b/Scripts/display-time.ps1 @@ -1,8 +1,9 @@ <# .SYNOPSIS - display-time.ps1 [] + Displays the current time .DESCRIPTION Displays the current time (for 10 seconds by default) + display-time.ps1 [] .EXAMPLE PS> ./display-time .NOTES diff --git a/Scripts/download-dir.ps1 b/Scripts/download-dir.ps1 index 8efd1461..fc0854a6 100755 --- a/Scripts/download-dir.ps1 +++ b/Scripts/download-dir.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - download-dir.ps1 [] + Downloads a folder (including subfolders) from the given URL .DESCRIPTION - Downloads a directory tree from the given URL + download-dir.ps1 [] .EXAMPLE PS> ./download-dir "https://www.cnn.com" .NOTES diff --git a/Scripts/download-file.ps1 b/Scripts/download-file.ps1 index 257fece5..ad146afb 100755 --- a/Scripts/download-file.ps1 +++ b/Scripts/download-file.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - download-file.ps1 [] -.DESCRIPTION Downloads a file from the given URL +.DESCRIPTION + download-file.ps1 [] .EXAMPLE PS> ./download-file "https://www.cnn.com/index.html" .NOTES diff --git a/Scripts/edit.ps1 b/Scripts/edit.ps1 index ea6fea58..eff48793 100755 --- a/Scripts/edit.ps1 +++ b/Scripts/edit.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - edit.ps1 -.DESCRIPTION Opens the built-in text editor to edit the given file +.DESCRIPTION + edit.ps1 .EXAMPLE PS> ./edit C:\MyFile.txt .NOTES diff --git a/Scripts/enable-crash-dumps.ps1 b/Scripts/enable-crash-dumps.ps1 index b393a817..bd471921 100755 --- a/Scripts/enable-crash-dumps.ps1 +++ b/Scripts/enable-crash-dumps.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - enable-crash-dumps.ps1 -.DESCRIPTION Enables the writing of crash dumps +.DESCRIPTION + enable-crash-dumps.ps1 .EXAMPLE PS> ./enable-crash-dumps .NOTES diff --git a/Scripts/enable-god-mode.ps1 b/Scripts/enable-god-mode.ps1 index baa719ab..75d647b0 100755 --- a/Scripts/enable-god-mode.ps1 +++ b/Scripts/enable-god-mode.ps1 @@ -1,8 +1,9 @@ <# .SYNOPSIS - enable-god-mode.ps1 + Enables the god mode .DESCRIPTION Enables the god mode (adds a new icon to the desktop) + enable-god-mode.ps1 .EXAMPLE PS> ./enable-god-mode .NOTES diff --git a/Scripts/encrypt-file.ps1 b/Scripts/encrypt-file.ps1 index 49c96677..dc49d53b 100755 --- a/Scripts/encrypt-file.ps1 +++ b/Scripts/encrypt-file.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - encrypt-file.ps1 [] [] + Encrypts a file .DESCRIPTION - Encrypts the given file + encrypt-file.ps1 [] [] .EXAMPLE PS> ./encrypt-file C:\MyFile.txt "123" .NOTES diff --git a/Scripts/enter-chat.ps1 b/Scripts/enter-chat.ps1 index e0088fd1..4ec93cf0 100644 --- a/Scripts/enter-chat.ps1 +++ b/Scripts/enter-chat.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - enter-chat.ps1 -.DESCRIPTION Enters a chat using a common network shared file +.DESCRIPTION + enter-chat.ps1 .EXAMPLE PS> ./enter-chat .NOTES diff --git a/Scripts/fetch-repo.ps1 b/Scripts/fetch-repo.ps1 index 3d4afb3f..a220169e 100755 --- a/Scripts/fetch-repo.ps1 +++ b/Scripts/fetch-repo.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - fetch-repo.ps1 [] -.DESCRIPTION Fetches updates for a local Git repository (including submodules) +.DESCRIPTION + fetch-repo.ps1 [] .EXAMPLE PS> ./fetch-repo .NOTES diff --git a/Scripts/fetch-repos.ps1 b/Scripts/fetch-repos.ps1 index ac210ce6..de6ef056 100755 --- a/Scripts/fetch-repos.ps1 +++ b/Scripts/fetch-repos.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - fetch-repos.ps1 [] + Fetches updates for all Git repositories in a folder (including submodules) .DESCRIPTION - Fetches updates for all Git repositories under the current/given directory (including submodules) + fetch-repos.ps1 [] .EXAMPLE PS> ./fetch-repos C:\MyRepos .NOTES diff --git a/Scripts/get-md5.ps1 b/Scripts/get-md5.ps1 index eb9fb76c..88d41107 100755 --- a/Scripts/get-md5.ps1 +++ b/Scripts/get-md5.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - get-md5.ps1 [] -.DESCRIPTION Prints the MD5 checksum of the given file +.DESCRIPTION + get-md5.ps1 [] .EXAMPLE PS> ./get-md5 C:\MyFile.txt .NOTES diff --git a/Scripts/get-sha1.ps1 b/Scripts/get-sha1.ps1 index 1ccfa960..26c14169 100755 --- a/Scripts/get-sha1.ps1 +++ b/Scripts/get-sha1.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - get-sha1.ps1 [] + Prints the SHA1 checksum of a file .DESCRIPTION - Prints the SHA1 checksum of the given file + get-sha1.ps1 [] .EXAMPLE PS> ./get-sha1 C:\MyFile.txt .NOTES diff --git a/Scripts/get-sha256.ps1 b/Scripts/get-sha256.ps1 index c75ef215..b81607b6 100755 --- a/Scripts/get-sha256.ps1 +++ b/Scripts/get-sha256.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - get-sha256.ps1 [] + Prints the SHA256 checksum of a file .DESCRIPTION - Prints the SHA256 checksum of the given file + get-sha256.ps1 [] .EXAMPLE PS> ./get-sha256 C:\MyFile.txt .NOTES diff --git a/Scripts/hibernate.ps1 b/Scripts/hibernate.ps1 index 5ef474d1..5d56a403 100755 --- a/Scripts/hibernate.ps1 +++ b/Scripts/hibernate.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - hibernate.ps1 -.DESCRIPTION Enables hibernate mode for the local computer (needs admin rights) +.DESCRIPTION + hibernate.ps1 .EXAMPLE PS> ./hibernate .NOTES diff --git a/Scripts/inspect-exe.ps1 b/Scripts/inspect-exe.ps1 index 9016900d..f6764df4 100755 --- a/Scripts/inspect-exe.ps1 +++ b/Scripts/inspect-exe.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - inspect-exe.ps1 [] + Prints basic information of an executable file .DESCRIPTION - Prints basic information of the given executable file + inspect-exe.ps1 [] .EXAMPLE PS> ./inspect-exe C:\MyApp.exe .NOTES diff --git a/Scripts/install-github-cli.ps1 b/Scripts/install-github-cli.ps1 index 4819fe01..798f0523 100644 --- a/Scripts/install-github-cli.ps1 +++ b/Scripts/install-github-cli.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - install-github-cli.ps1 -.DESCRIPTION Installs GitHub CLI +.DESCRIPTION + install-github-cli.ps1 .EXAMPLE PS> ./install-github-cli .NOTES diff --git a/Scripts/install-google-chrome.ps1 b/Scripts/install-google-chrome.ps1 index ba72af7c..4aa831e7 100755 --- a/Scripts/install-google-chrome.ps1 +++ b/Scripts/install-google-chrome.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - install-google-chrome.ps1 -.DESCRIPTION Installs the latest Google Chrome browser +.DESCRIPTION + install-google-chrome.ps1 .EXAMPLE PS> ./install-google-chrome .NOTES diff --git a/Scripts/install-knot-resolver.ps1 b/Scripts/install-knot-resolver.ps1 index a6203752..b9e08bf8 100644 --- a/Scripts/install-knot-resolver.ps1 +++ b/Scripts/install-knot-resolver.ps1 @@ -1,8 +1,9 @@ <# .SYNOPSIS - install-knot-resolver.ps1 + Installs Knot Resolver (needs admin rights) .DESCRIPTION - Installs the Knot Resolver (a DNS resolver daemon, needs admin rights) + Knot Resolver is a DNS resolver daemon. + install-knot-resolver.ps1 .EXAMPLE PS> ./install-knot-resolver .NOTES diff --git a/Scripts/install-signal-cli.ps1 b/Scripts/install-signal-cli.ps1 index 75febf37..4dd3b309 100755 --- a/Scripts/install-signal-cli.ps1 +++ b/Scripts/install-signal-cli.ps1 @@ -1,8 +1,9 @@ <# .SYNOPSIS - install-signal-cli.ps1 [] + Installs signal-cli .DESCRIPTION Installs signal-cli from github.com/AsamK/signal-cli. See the Web page for the correct version number + install-signal-cli.ps1 [] .EXAMPLE PS> ./install-signal-cli 0.11.12 .NOTES diff --git a/Scripts/install-ssh-client.ps1 b/Scripts/install-ssh-client.ps1 index 54c2a135..5a83f51b 100755 --- a/Scripts/install-ssh-client.ps1 +++ b/Scripts/install-ssh-client.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - install-ssh-client.ps1 -.DESCRIPTION Installs the SSH client (needs admin rights) +.DESCRIPTION + install-ssh-client.ps1 .EXAMPLE PS> ./install-ssh-client .NOTES diff --git a/Scripts/install-ssh-server.ps1 b/Scripts/install-ssh-server.ps1 index c28d0ba6..f743c8f5 100755 --- a/Scripts/install-ssh-server.ps1 +++ b/Scripts/install-ssh-server.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - install-ssh-server.ps1 -.DESCRIPTION Installs the SSH server (needs admin rights) +.DESCRIPTION + install-ssh-server.ps1 .EXAMPLE PS> ./install-ssh-server .NOTES diff --git a/Scripts/install-updates.ps1 b/Scripts/install-updates.ps1 index 7b3e7c34..bf2115d0 100755 --- a/Scripts/install-updates.ps1 +++ b/Scripts/install-updates.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - install-updates.ps1 + Installs updates for the local machine (needs admin rights) .DESCRIPTION - Install updates on the local machhine (needs admin rights) + install-updates.ps1 .EXAMPLE PS> ./install-updates .NOTES diff --git a/Scripts/install-wsl.ps1 b/Scripts/install-wsl.ps1 index 03a05872..f84ea2f1 100755 --- a/Scripts/install-wsl.ps1 +++ b/Scripts/install-wsl.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - install-wsl.ps1 + Installs Windows Subsystem for Linux (needs admin rights) .DESCRIPTION - Installs Windows Subsystem for Linux (WSL) - needs admin rights + install-wsl.ps1 .EXAMPLE PS> ./install-wsl .NOTES diff --git a/Scripts/introduce-powershell.ps1 b/Scripts/introduce-powershell.ps1 index 5c3b558d..30feeb6e 100755 --- a/Scripts/introduce-powershell.ps1 +++ b/Scripts/introduce-powershell.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - introduce-powershell.ps1 -.DESCRIPTION Introduces PowerShell to new users +.DESCRIPTION + introduce-powershell.ps1 .EXAMPLE PS> ./introduce-powershell .NOTES diff --git a/Scripts/list-aliases.ps1 b/Scripts/list-aliases.ps1 index 4d070ee3..6cdafed0 100755 --- a/Scripts/list-aliases.ps1 +++ b/Scripts/list-aliases.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - list-aliases.ps1 -.DESCRIPTION Lists all PowerShell aliases +.DESCRIPTION + list-aliases.ps1 .EXAMPLE PS> ./list-aliases diff --git a/Scripts/list-anagrams.ps1 b/Scripts/list-anagrams.ps1 index 2d79d7b2..a68a444d 100755 --- a/Scripts/list-anagrams.ps1 +++ b/Scripts/list-anagrams.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - list-anagrams.ps1 [] [] -.DESCRIPTION Lists all anagrams of the given word +.DESCRIPTION + list-anagrams.ps1 [] [] .EXAMPLE PS> ./list-anagrams Baby .NOTES diff --git a/Scripts/list-automatic-variables.ps1 b/Scripts/list-automatic-variables.ps1 index fbf475ff..818848c5 100755 --- a/Scripts/list-automatic-variables.ps1 +++ b/Scripts/list-automatic-variables.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - list-automatic-variables.ps1 -.DESCRIPTION Lists all automatic variables of PowerShell +.DESCRIPTION + list-automatic-variables.ps1 .EXAMPLE PS> ./list-automatic-variables diff --git a/Scripts/list-branches.ps1 b/Scripts/list-branches.ps1 index 68cace79..f2677535 100755 --- a/Scripts/list-branches.ps1 +++ b/Scripts/list-branches.ps1 @@ -1,8 +1,10 @@ <# .SYNOPSIS - list-branches.ps1 [] [] + Lists all branches in a Git repository .DESCRIPTION - Lists all branches in the current/given Git repository + list-branches.ps1 [] [] + is the current working directory by default + is "*" (anything) by default .EXAMPLE PS> ./list-branches .NOTES @@ -11,7 +13,7 @@ https://github.com/fleschutz/PowerShell #> -param([string]$RepoDir = "$PWD", [string]$Pattern = "*") +param([string]$RepoDir = "$PWD", [string]$SearchPattern = "*") try { if (-not(test-path "$RepoDir" -pathType container)) { throw "Can't access directory: $RepoDir" } @@ -31,7 +33,7 @@ try { foreach($Branch in $Branches) { if ("$Branch" -match "origin/HEAD") { continue } $BranchName = $Branch.substring(9) - if ("$BranchName" -notlike "$Pattern") { continue } + if ("$BranchName" -notlike "$SearchPattern") { continue } "$BranchName" } "" diff --git a/Scripts/list-cheat-sheet.ps1 b/Scripts/list-cheat-sheet.ps1 index d0f15937..b4336df2 100755 --- a/Scripts/list-cheat-sheet.ps1 +++ b/Scripts/list-cheat-sheet.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - list-cheat-sheet.ps1 -.DESCRIPTION Lists the PowerShell cheat sheet +.DESCRIPTION + list-cheat-sheet.ps1 .EXAMPLE PS> ./list-cheat-sheet .NOTES diff --git a/Scripts/list-city-weather.ps1 b/Scripts/list-city-weather.ps1 index 8241adb6..07f08c3f 100755 --- a/Scripts/list-city-weather.ps1 +++ b/Scripts/list-city-weather.ps1 @@ -1,8 +1,9 @@ <# .SYNOPSIS - list-city-weather.ps1 + List the current weather of cities world-wide .DESCRIPTION List the current weather of cities world-wide (west to east) + list-city-weather.ps1 .EXAMPLE PS> ./list-city-weather .NOTES diff --git a/Scripts/list-cli-tools.ps1 b/Scripts/list-cli-tools.ps1 index 4188d6cc..a191bfec 100755 --- a/Scripts/list-cli-tools.ps1 +++ b/Scripts/list-cli-tools.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - list-cli-tools.ps1 -.DESCRIPTION Lists available command-line interface (CLI) tools +.DESCRIPTION + list-cli-tools.ps1 .EXAMPLE PS> ./list-cli-tools diff --git a/Scripts/list-clipboard.ps1 b/Scripts/list-clipboard.ps1 index 9aa400b3..c85effef 100755 --- a/Scripts/list-clipboard.ps1 +++ b/Scripts/list-clipboard.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - list-clipboard.ps1 -.DESCRIPTION Lists the contents of the clipboard +.DESCRIPTION + list-clipboard.ps1 .EXAMPLE PS> ./list-clipboard .NOTES diff --git a/Scripts/list-cmdlets.ps1 b/Scripts/list-cmdlets.ps1 index 44b440cb..0a7d2e54 100755 --- a/Scripts/list-cmdlets.ps1 +++ b/Scripts/list-cmdlets.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - list-cmdlets.ps1 -.DESCRIPTION Lists all PowerShell cmdlets +.DESCRIPTION + list-cmdlets.ps1 .EXAMPLE PS> ./list-cmdlets diff --git a/Scripts/list-commits.ps1 b/Scripts/list-commits.ps1 index 0f1b7afe..f493c2ea 100755 --- a/Scripts/list-commits.ps1 +++ b/Scripts/list-commits.ps1 @@ -1,8 +1,10 @@ <# .SYNOPSIS - list-commits.ps1 [] [] + Lists all commits in a Git repository .DESCRIPTION - Lists all commits in a Git repository (format is: list|compact|normal|JSON) + list-commits.ps1 [] [] + is the path to the Git repository + is either: list|compact|normal|JSON .EXAMPLE PS> ./list-commits diff --git a/Scripts/list-console-colors.ps1 b/Scripts/list-console-colors.ps1 index 0e4a77dc..e7f60f74 100755 --- a/Scripts/list-console-colors.ps1 +++ b/Scripts/list-console-colors.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - list-console-colors.ps1 -.DESCRIPTION Lists all console colors +.DESCRIPTION + list-console-colors.ps1 .EXAMPLE PS> ./list-console-colors .NOTES diff --git a/Scripts/list-countries.ps1 b/Scripts/list-countries.ps1 index d3fddaf6..99624818 100644 --- a/Scripts/list-countries.ps1 +++ b/Scripts/list-countries.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - list-countries.ps1 -.DESCRIPTION Lists details of all countries +.DESCRIPTION + list-countries.ps1 .EXAMPLE PS> ./list-countries .NOTES diff --git a/Scripts/list-credits.ps1 b/Scripts/list-credits.ps1 index 4476cd27..79333f48 100755 --- a/Scripts/list-credits.ps1 +++ b/Scripts/list-credits.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - list-credits.ps1 -.DESCRIPTION Shows the credits for the PowerShell Scripts +.DESCRIPTION + list-credits.ps1 .EXAMPLE PS> ./list-credits .NOTES diff --git a/Scripts/list-crypto-rates.ps1 b/Scripts/list-crypto-rates.ps1 index e6404800..e6ada538 100644 --- a/Scripts/list-crypto-rates.ps1 +++ b/Scripts/list-crypto-rates.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - list-crypto-rates.ps1 -.DESCRIPTION Lists the current crypto exchange rates +.DESCRIPTION + list-crypto-rates.ps1 .EXAMPLE PS> ./list-crypto-rates .NOTES diff --git a/Scripts/list-dir-tree.ps1 b/Scripts/list-dir-tree.ps1 index ccdf6248..3ab92d8e 100755 --- a/Scripts/list-dir-tree.ps1 +++ b/Scripts/list-dir-tree.ps1 @@ -1,8 +1,9 @@ <# .SYNOPSIS - list-dir-tree.ps1 [] -.DESCRIPTION Lists the full directory tree +.DESCRIPTION + list-dir-tree.ps1 [] + is the path to the directory tree .EXAMPLE PS> ./list-dir-tree C:\ .NOTES diff --git a/Scripts/list-dir.ps1 b/Scripts/list-dir.ps1 index 27835dd4..02f5f338 100755 --- a/Scripts/list-dir.ps1 +++ b/Scripts/list-dir.ps1 @@ -1,8 +1,9 @@ <# .SYNOPSIS - list-dir.ps1 [] -.DESCRIPTION Lists the directory content formatted in columns +.DESCRIPTION + list-dir.ps1 [] + is "*" (anything) by default .EXAMPLE PS> ./list-dir C:\ .NOTES @@ -11,10 +12,10 @@ https://github.com/fleschutz/PowerShell #> -param([string]$Pattern = "*") +param([string]$SearchPattern = "*") -function ListDir { param([string]$Pattern) - $Items = get-childItem -path "$Pattern" +function ListDir { param([string]$SearchPattern) + $Items = get-childItem -path "$SearchPattern" foreach ($Item in $Items) { $Name = $Item.Name if ($Name[0] -eq '.') { continue } # hidden file/dir @@ -28,7 +29,7 @@ function ListDir { param([string]$Pattern) } try { - ListDir $Pattern | format-wide -autoSize + ListDir $SearchPattern | format-wide -autoSize exit 0 # success } catch { "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))" diff --git a/Scripts/list-drives.ps1 b/Scripts/list-drives.ps1 index 0eb11d79..8e4c545c 100755 --- a/Scripts/list-drives.ps1 +++ b/Scripts/list-drives.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - list-drives.ps1 -.DESCRIPTION Lists all local drives. +.DESCRIPTION + list-drives.ps1 .EXAMPLE PS> ./list-drives diff --git a/Scripts/list-earthquakes.ps1 b/Scripts/list-earthquakes.ps1 index 03d3279a..63740d82 100755 --- a/Scripts/list-earthquakes.ps1 +++ b/Scripts/list-earthquakes.ps1 @@ -1,8 +1,9 @@ <# .SYNOPSIS - list-earthquakes.ps1 + Lists major earthquakes for the last 30 days .DESCRIPTION Lists earthquakes with magnitude >= 6.0 for the last 30 days + list-earthquakes.ps1 .EXAMPLE PS> ./list-earthquakes .NOTES diff --git a/Scripts/list-emojis.ps1 b/Scripts/list-emojis.ps1 index 0b10e1ee..6bed6a33 100644 --- a/Scripts/list-emojis.ps1 +++ b/Scripts/list-emojis.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - list-emojis.ps1 -.DESCRIPTION Lists the Emojis of Unicode 13.0 +.DESCRIPTION + list-emojis.ps1 .EXAMPLE PS> ./list-emojis .NOTES diff --git a/Scripts/list-empty-dirs.ps1 b/Scripts/list-empty-dirs.ps1 index 89e2f19f..557dd91d 100755 --- a/Scripts/list-empty-dirs.ps1 +++ b/Scripts/list-empty-dirs.ps1 @@ -1,8 +1,9 @@ <# .SYNOPSIS - list-empty-dirs.ps1 [] + Lists empty subfolders within a directory tree .DESCRIPTION - Lists empty subfolders within the given directory tree + list-empty-dirs.ps1 [] + is the path to the directory tree .EXAMPLE PS> ./list-empty-dirs C:\ .NOTES diff --git a/Scripts/list-empty-files.ps1 b/Scripts/list-empty-files.ps1 index fcf5b49e..41a9eccf 100755 --- a/Scripts/list-empty-files.ps1 +++ b/Scripts/list-empty-files.ps1 @@ -1,8 +1,9 @@ <# .SYNOPSIS - list-empty-files.ps1 [] + Lists empty files within a directory tree .DESCRIPTION - Lists empty files within the given directory tree + list-empty-files.ps1 [] + is the path to the directory tree .EXAMPLE PS> ./list-empty-files C:\ .NOTES diff --git a/Scripts/list-environment-variables.ps1 b/Scripts/list-environment-variables.ps1 index 9fdf9aaf..0511e42f 100755 --- a/Scripts/list-environment-variables.ps1 +++ b/Scripts/list-environment-variables.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - list-environment-variables.ps1 -.DESCRIPTION Lists all environment variables +.DESCRIPTION + list-environment-variables.ps1 .EXAMPLE PS> ./list-environment-variables diff --git a/Scripts/list-exchange-rates.ps1 b/Scripts/list-exchange-rates.ps1 index b31c8ba7..bb49ba06 100644 --- a/Scripts/list-exchange-rates.ps1 +++ b/Scripts/list-exchange-rates.ps1 @@ -1,8 +1,9 @@ <# .SYNOPSIS - list-exchange-rates.ps1 [] + Lists the exchange rates for a currency .DESCRIPTION - Lists the current exchange rates for the given currency (USD per default) + Lists the current exchange rates for the given currency (USD per default). + list-exchange-rates.ps1 [] .EXAMPLE PS> ./list-exchange-rates EUR .NOTES diff --git a/Scripts/list-files.ps1 b/Scripts/list-files.ps1 index 78c1777f..044dac8e 100755 --- a/Scripts/list-files.ps1 +++ b/Scripts/list-files.ps1 @@ -1,8 +1,9 @@ <# .SYNOPSIS - list-files.ps1 [] + Lists all files in a directory tree .DESCRIPTION - Lists all files in the given directory tree + list-files.ps1 [] + is the path to the directory tree .EXAMPLE PS> ./list-files C:\ .NOTES diff --git a/Scripts/list-fritzbox-calls.ps1 b/Scripts/list-fritzbox-calls.ps1 index 26287482..0f10a85b 100755 --- a/Scripts/list-fritzbox-calls.ps1 +++ b/Scripts/list-fritzbox-calls.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - list-fritzbox-calls.ps1 [] [] -.DESCRIPTION Lists the phone calls of the FRITZ!Box device +.DESCRIPTION + list-fritzbox-calls.ps1 [] [] .EXAMPLE PS> ./list-fritzbox-calls .NOTES diff --git a/Scripts/list-fritzbox-devices.ps1 b/Scripts/list-fritzbox-devices.ps1 index 2bed022e..916a983a 100755 --- a/Scripts/list-fritzbox-devices.ps1 +++ b/Scripts/list-fritzbox-devices.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - list-fritzbox-devices.ps1 [] [] -.DESCRIPTION Lists FRITZ!Box's known devices +.DESCRIPTION + list-fritzbox-devices.ps1 [] [] .EXAMPLE PS> ./list-fritzbox-devices .NOTES diff --git a/Scripts/list-hidden-files.ps1 b/Scripts/list-hidden-files.ps1 index 79153602..d213bb27 100755 --- a/Scripts/list-hidden-files.ps1 +++ b/Scripts/list-hidden-files.ps1 @@ -1,8 +1,9 @@ <# .SYNOPSIS - list-hidden-files.ps1 [] + Lists hidden files in a directory tree .DESCRIPTION - Lists hidden files within the given directory tree + list-hidden-files.ps1 [] + is the path to the directory tree .EXAMPLE PS> ./list-hidden-files C:\ .NOTES diff --git a/Scripts/list-installed-apps.ps1 b/Scripts/list-installed-apps.ps1 index 41f4d4ad..a48408cb 100755 --- a/Scripts/list-installed-apps.ps1 +++ b/Scripts/list-installed-apps.ps1 @@ -1,8 +1,9 @@ <# .SYNOPSIS - list-installed-apps.ps1 + Lists the installed apps .DESCRIPTION - Lists the installed apps (from Windows Store or snaps) + Lists the installed apps (from Windows Store or snaps). + list-installed-apps.ps1 .EXAMPLE PS> ./list-installed-apps .NOTES diff --git a/Scripts/list-installed-software.ps1 b/Scripts/list-installed-software.ps1 index b4083155..bc038d8b 100755 --- a/Scripts/list-installed-software.ps1 +++ b/Scripts/list-installed-software.ps1 @@ -1,8 +1,9 @@ <# .SYNOPSIS - list-installed-software.ps1 + Lists the installed software .DESCRIPTION Lists the installed software (except Windows Store apps) + list-installed-software.ps1 .EXAMPLE PS> ./list-installed-software .NOTES diff --git a/Scripts/list-latest-tag.ps1 b/Scripts/list-latest-tag.ps1 index 51327c49..cef61dca 100755 --- a/Scripts/list-latest-tag.ps1 +++ b/Scripts/list-latest-tag.ps1 @@ -1,8 +1,9 @@ <# .SYNOPSIS - list-latest-tag.ps1 [] -.DESCRIPTION Lists the latest tag on the current branch in a Git repository +.DESCRIPTION + list-latest-tag.ps1 [] + is the path to the repository .EXAMPLE PS> ./list-latest-tag C:\MyRepo .NOTES diff --git a/Scripts/list-latest-tags.ps1 b/Scripts/list-latest-tags.ps1 index fa2cd88f..906e1ab8 100755 --- a/Scripts/list-latest-tags.ps1 +++ b/Scripts/list-latest-tags.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - list-latest-tags.ps1 [] + Lists the latests tags in all Git repositories in a folder .DESCRIPTION - Lists the latests tags in all Git repositories under the current/given directory + list-latest-tags.ps1 [] .EXAMPLE PS> ./list-latest-tags C:\MyRepos .NOTES diff --git a/Scripts/list-memos.ps1 b/Scripts/list-memos.ps1 index 79354c2e..2251b1b3 100755 --- a/Scripts/list-memos.ps1 +++ b/Scripts/list-memos.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - list-memos.ps1 -.DESCRIPTION Lists all memos in $HOME/Memos.csv +.DESCRIPTION + list-memos.ps1 .EXAMPLE PS> ./list-memos .NOTES diff --git a/Scripts/list-modules.ps1 b/Scripts/list-modules.ps1 index a770e15f..e5c6f4eb 100755 --- a/Scripts/list-modules.ps1 +++ b/Scripts/list-modules.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - list-modules.ps1 -.DESCRIPTION Lists all PowerShell modules +.DESCRIPTION + list-modules.ps1 .EXAMPLE PS> ./list-modules diff --git a/Scripts/list-mysql-tables.ps1 b/Scripts/list-mysql-tables.ps1 index 5a2b1dab..8e7614ed 100755 --- a/Scripts/list-mysql-tables.ps1 +++ b/Scripts/list-mysql-tables.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - list-mysql-tables.ps1 + Lists all tables of a MySQL database .DESCRIPTION - Lists the MySQL tables + list-mysql-tables.ps1 .EXAMPLE PS> ./list-mysql-tables .NOTES diff --git a/Scripts/list-network-shares.ps1 b/Scripts/list-network-shares.ps1 index 3d987de1..1a9ce33a 100755 --- a/Scripts/list-network-shares.ps1 +++ b/Scripts/list-network-shares.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - list-network-shares.ps1 -.DESCRIPTION Lists the network shares of the local computer +.DESCRIPTION + list-network-shares.ps1 .EXAMPLE PS> ./list-network-shares diff --git a/Scripts/list-news.ps1 b/Scripts/list-news.ps1 index 5a4d0686..4a18e7ae 100755 --- a/Scripts/list-news.ps1 +++ b/Scripts/list-news.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - list-news.ps1 [] [] -.DESCRIPTION Lists the latest news +.DESCRIPTION + list-news.ps1 [] [] .EXAMPLE PS> ./list-news .NOTES diff --git a/Scripts/list-os-releases.ps1 b/Scripts/list-os-releases.ps1 index d989ef5d..b785e784 100755 --- a/Scripts/list-os-releases.ps1 +++ b/Scripts/list-os-releases.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - list-os-releases.ps1 -.DESCRIPTION Lists OS releases and download URL +.DESCRIPTION + list-os-releases.ps1 .EXAMPLE PS> ./list-os-releases .NOTES diff --git a/Scripts/list-os-updates.ps1 b/Scripts/list-os-updates.ps1 index 79b6314b..6ca58ee6 100755 --- a/Scripts/list-os-updates.ps1 +++ b/Scripts/list-os-updates.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - list-os-updates.ps1 [] [] -.DESCRIPTION Lists the latest operating system updates +.DESCRIPTION + list-os-updates.ps1 [] [] .EXAMPLE PS> ./list-os-updates .NOTES diff --git a/Scripts/list-passwords.ps1 b/Scripts/list-passwords.ps1 index bfa9f2d3..aaf4a6d3 100755 --- a/Scripts/list-passwords.ps1 +++ b/Scripts/list-passwords.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - list-passwords.ps1 [] [] [] -.DESCRIPTION Prints a list of random passwords +.DESCRIPTION + list-passwords.ps1 [] [] [] .EXAMPLE PS> ./list-passwords .NOTES diff --git a/Scripts/list-pins.ps1 b/Scripts/list-pins.ps1 index 0a6322a5..9e17a171 100755 --- a/Scripts/list-pins.ps1 +++ b/Scripts/list-pins.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - list-pins.ps1 [] [] [] -.DESCRIPTION Prints a list of random PIN's +.DESCRIPTION + list-pins.ps1 [] [] [] .EXAMPLE PS> ./list-pins .NOTES diff --git a/Scripts/list-print-jobs.ps1 b/Scripts/list-print-jobs.ps1 index 4526105c..9ac38507 100755 --- a/Scripts/list-print-jobs.ps1 +++ b/Scripts/list-print-jobs.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - list-print-jobs.ps1 + Lists all jobs of all printers .DESCRIPTION - Lists all jobs from all printers + list-print-jobs.ps1 .EXAMPLE PS> ./list-print-jobs .NOTES diff --git a/Scripts/list-printers.ps1 b/Scripts/list-printers.ps1 index cbaca824..6d0fdf6b 100755 --- a/Scripts/list-printers.ps1 +++ b/Scripts/list-printers.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - list-printers.ps1 + Lists all printers known to the local computer .DESCRIPTION - Lists all printer known to the local computer + list-printers.ps1 .EXAMPLE PS> ./list-printers .NOTES diff --git a/Scripts/list-processes.ps1 b/Scripts/list-processes.ps1 index db8611d1..ec656133 100755 --- a/Scripts/list-processes.ps1 +++ b/Scripts/list-processes.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - list-processes.ps1 -.DESCRIPTION Lists all local computer processes +.DESCRIPTION + list-processes.ps1 .EXAMPLE PS> ./list-processes diff --git a/Scripts/list-profiles.ps1 b/Scripts/list-profiles.ps1 index 888209d1..ec26e9cd 100755 --- a/Scripts/list-profiles.ps1 +++ b/Scripts/list-profiles.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - list-profiles.ps1 + Lists the user's PowerShell profiles .DESCRIPTION - Lists your PowerShell profiles. + list-profiles.ps1 .EXAMPLE PS> ./list-profiles diff --git a/Scripts/list-recycle-bin.ps1 b/Scripts/list-recycle-bin.ps1 index 97ec17b5..d42344cb 100755 --- a/Scripts/list-recycle-bin.ps1 +++ b/Scripts/list-recycle-bin.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - list-recycle-bin.ps1 -.DESCRIPTION Lists the content of the recycle bin folder +.DESCRIPTION + list-recycle-bin.ps1 .EXAMPLE PS> ./list-recycle-bin .NOTES diff --git a/Scripts/list-repos.ps1 b/Scripts/list-repos.ps1 index 84091cad..7db00477 100644 --- a/Scripts/list-repos.ps1 +++ b/Scripts/list-repos.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - list-repos.ps1 [] + Lists the details of all Git repositories in a folder .DESCRIPTION - Lists the details of all Git repositories under a directory + list-repos.ps1 [] .EXAMPLE PS> ./list-repos C:\MyRepos diff --git a/Scripts/list-scripts.ps1 b/Scripts/list-scripts.ps1 index ca20cbe9..ada8f74b 100755 --- a/Scripts/list-scripts.ps1 +++ b/Scripts/list-scripts.ps1 @@ -1,8 +1,9 @@ <# .SYNOPSIS - list-scripts.ps1 + Lists all PowerShell scripts in this repository .DESCRIPTION Lists all PowerShell scripts in this repository (sorted alphabetically) + list-scripts.ps1 .EXAMPLE PS> ./list-scripts .NOTES diff --git a/Scripts/list-services.ps1 b/Scripts/list-services.ps1 index 3287476b..3404928b 100755 --- a/Scripts/list-services.ps1 +++ b/Scripts/list-services.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - list-services.ps1 -.DESCRIPTION Lists the local computer services +.DESCRIPTION + list-services.ps1 .EXAMPLE PS> ./list-services diff --git a/Scripts/list-sql-tables.ps1 b/Scripts/list-sql-tables.ps1 index e513b453..2fcb9713 100755 --- a/Scripts/list-sql-tables.ps1 +++ b/Scripts/list-sql-tables.ps1 @@ -1,8 +1,9 @@ <# .SYNOPSIS - list-sql-tables.ps1 + Lists all tables of a SQL server database .DESCRIPTION Lists all tables in a SQL server database and exports the list as CSV + Install-Module InvokeQuery Run the above command if you do not have this module. .EXAMPLE diff --git a/Scripts/list-submodules.ps1 b/Scripts/list-submodules.ps1 index 43bf15ac..4e6b31e8 100644 --- a/Scripts/list-submodules.ps1 +++ b/Scripts/list-submodules.ps1 @@ -1,8 +1,9 @@ <# .SYNOPSIS - list-submodules.ps1 [] + Lists the submodules of a Git repository .DESCRIPTION - Lists the submodules of the current/given Git repository + list-submodules.ps1 [] + is the path to the repository (current working dir by default) .EXAMPLE PS> ./list-submodules C:\MyRepo .NOTES diff --git a/Scripts/list-system-info.ps1 b/Scripts/list-system-info.ps1 index 668ac0ae..7b2f96c6 100755 --- a/Scripts/list-system-info.ps1 +++ b/Scripts/list-system-info.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - list-system-info.ps1 + Lists system information of the local computer .DESCRIPTION - Lists system information on the local computer + list-system-info.ps1 .EXAMPLE PS> ./list-system-info .NOTES diff --git a/Scripts/list-tags.ps1 b/Scripts/list-tags.ps1 index ec6ca0fa..b83ca536 100755 --- a/Scripts/list-tags.ps1 +++ b/Scripts/list-tags.ps1 @@ -1,8 +1,10 @@ <# .SYNOPSIS - list-tags.ps1 [] [] + Lists all tags in a Git repository .DESCRIPTION - Lists all tags in a Git repository. + list-tags.ps1 [] [] + is the path to the Git repository + is "*" (anything) by default .EXAMPLE PS> ./list-tags C:\MyRepo @@ -16,7 +18,7 @@ https://github.com/fleschutz/PowerShell #> -param([string]$RepoDir = "$PWD", [string]$Pattern="*") +param([string]$RepoDir = "$PWD", [string]$SearchPattern="*") try { if (-not(test-path "$RepoDir" -pathType container)) { throw "Can't access directory: $RepoDir" } @@ -32,7 +34,7 @@ try { "" "Tag Description" "--- -----------" - & git -C "$RepoDir" tag --list "$Pattern" -n + & git -C "$RepoDir" tag --list "$SearchPattern" -n if ($lastExitCode -ne "0") { throw "'git tag --list' failed" } exit 0 # success diff --git a/Scripts/list-tasks.ps1 b/Scripts/list-tasks.ps1 index 916198eb..d9bb43fd 100755 --- a/Scripts/list-tasks.ps1 +++ b/Scripts/list-tasks.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - list-tasks.ps1 -.DESCRIPTION Lists all Windows scheduler tasks +.DESCRIPTION + list-tasks.ps1 .EXAMPLE PS> ./list-tasks diff --git a/Scripts/list-timezone.ps1 b/Scripts/list-timezone.ps1 index 8b11aff8..213daf60 100755 --- a/Scripts/list-timezone.ps1 +++ b/Scripts/list-timezone.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - list-timezone.ps1 -.DESCRIPTION Lists the details of the current time zone +.DESCRIPTION + list-timezone.ps1 .EXAMPLE PS> ./list-timezone diff --git a/Scripts/list-timezones.ps1 b/Scripts/list-timezones.ps1 index 55b92521..c0f4ddee 100755 --- a/Scripts/list-timezones.ps1 +++ b/Scripts/list-timezones.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - list-timezones.ps1 -.DESCRIPTION Lists all available time zones +.DESCRIPTION + list-timezones.ps1 .EXAMPLE PS> ./list-timezones diff --git a/Scripts/list-tiobe-index.ps1 b/Scripts/list-tiobe-index.ps1 index 2cac1b75..dcb305b3 100644 --- a/Scripts/list-tiobe-index.ps1 +++ b/Scripts/list-tiobe-index.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - list-tiobe-index.ps1 -.DESCRIPTION Lists the TIOBE index of top programming languages +.DESCRIPTION + list-tiobe-index.ps1 .EXAMPLE PS> ./list-tiobe-index .NOTES diff --git a/Scripts/list-unused-files.ps1 b/Scripts/list-unused-files.ps1 index c18b1973..0fa2ba7d 100755 --- a/Scripts/list-unused-files.ps1 +++ b/Scripts/list-unused-files.ps1 @@ -1,22 +1,25 @@ <# .SYNOPSIS - list-unused-files.ps1 + Lists unused files in a folder (including subfolders) .DESCRIPTION - Lists files in the with last access time older than + Lists files in a folder with last access time older than + list-unused-files.ps1 + is the path to the directory tree + is the number of days .EXAMPLE - PS> ./list-unused-files C:\ 90 + PS> ./list-unused-files C:\ 100 .NOTES Author: Markus Fleschutz · License: CC0 .LINK https://github.com/fleschutz/PowerShell #> -param([string]$DirTree = "", [int]$NumberOfDaysUnused = 99) +param([string]$DirTree = "", [int]$Days = 100) -write-host "Listing files in $DirTree with last access time older than $NumberOfDaysUnused days" +write-host "Listing files in $DirTree with last access time older than $Days days" try { - $cutOffDate = (Get-Date).AddDays(-$NumberOfDaysUnused) + $cutOffDate = (Get-Date).AddDays(-$Days) Get-ChildItem -path $DirTree -recurse | Where-Object {$_.LastAccessTime -le $cutOffDate} | select fullname diff --git a/Scripts/list-user-groups.ps1 b/Scripts/list-user-groups.ps1 index 4bc8ded6..90624538 100755 --- a/Scripts/list-user-groups.ps1 +++ b/Scripts/list-user-groups.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - list-user-groups.ps1 -.DESCRIPTION Lists the user groups on the local computer +.DESCRIPTION + list-user-groups.ps1 .EXAMPLE PS> ./list-user-groups diff --git a/Scripts/list-voices.ps1 b/Scripts/list-voices.ps1 index be8f6b9d..ec9b1b47 100644 --- a/Scripts/list-voices.ps1 +++ b/Scripts/list-voices.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - list-voices.ps1 -.DESCRIPTION Lists the installed text-to-speech (TTS) voices +.DESCRIPTION + list-voices.ps1 .EXAMPLE PS> ./list-voices diff --git a/Scripts/list-weather.ps1 b/Scripts/list-weather.ps1 index 0aa8c091..da83ee09 100755 --- a/Scripts/list-weather.ps1 +++ b/Scripts/list-weather.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - list-weather.ps1 [] + Lists the hourly weather report .DESCRIPTION - Lists the hourly weather + list-weather.ps1 [] .EXAMPLE PS> ./list-weather .NOTES diff --git a/Scripts/list-workdir.ps1 b/Scripts/list-workdir.ps1 index f9883719..26e0f341 100644 --- a/Scripts/list-workdir.ps1 +++ b/Scripts/list-workdir.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - list-workdir.ps1 -.DESCRIPTION Lists the current working directory +.DESCRIPTION + list-workdir.ps1 .EXAMPLE PS> ./list-workdir .NOTES diff --git a/Scripts/locate-city.ps1 b/Scripts/locate-city.ps1 index b29ea0a7..6e3b2ccf 100755 --- a/Scripts/locate-city.ps1 +++ b/Scripts/locate-city.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - locate-city.ps1 [] -.DESCRIPTION Prints the geographic location of the given city +.DESCRIPTION + locate-city.ps1 [] .EXAMPLE PS> ./locate-city Paris .NOTES diff --git a/Scripts/locate-ipaddress.ps1 b/Scripts/locate-ipaddress.ps1 index 58391781..ea562346 100755 --- a/Scripts/locate-ipaddress.ps1 +++ b/Scripts/locate-ipaddress.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - locate-ipaddress.ps1 [] -.DESCRIPTION Prints the geographic location of the given IP address +.DESCRIPTION + locate-ipaddress.ps1 [] .EXAMPLE PS> ./locate-ipaddress 177.144.67.98 .NOTES @@ -11,12 +11,12 @@ https://github.com/fleschutz/PowerShell #> -param([string]$IPaddr = "") +param([string]$IPaddress= "") try { - if ($IPaddr -eq "" ) { $IPaddr = read-host "Enter IP address to locate" } + if ($IPaddress -eq "" ) { $IPaddress = read-host "Enter IP address to locate" } - $result = Invoke-RestMethod -Method Get -Uri "http://ip-api.com/json/$IPaddr" + $result = Invoke-RestMethod -Method Get -Uri "http://ip-api.com/json/$IPaddress" write-output $result exit 0 # success } catch { diff --git a/Scripts/locate-zip-code.ps1 b/Scripts/locate-zip-code.ps1 index ed310414..cbd91df0 100755 --- a/Scripts/locate-zip-code.ps1 +++ b/Scripts/locate-zip-code.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - locate-zip-code.ps1 [] [] -.DESCRIPTION Prints the geographic location of the given zip-code +.DESCRIPTION + locate-zip-code.ps1 [] [] .EXAMPLE PS> ./locate-zip-code .NOTES diff --git a/Scripts/make-install.ps1 b/Scripts/make-install.ps1 index b240e768..47749852 100755 --- a/Scripts/make-install.ps1 +++ b/Scripts/make-install.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - make-install.ps1 -.DESCRIPTION Copies newer EXE's + DLL's from the build directory to the installation directory +.DESCRIPTION + make-install.ps1 .EXAMPLE PS> ./make-install .NOTES diff --git a/Scripts/make-repo.ps1 b/Scripts/make-repo.ps1 index d44350f2..70514c35 100755 --- a/Scripts/make-repo.ps1 +++ b/Scripts/make-repo.ps1 @@ -1,8 +1,9 @@ <# .SYNOPSIS - make-repo.ps1 [] -.DESCRIPTION Builds a Git repository supporting cmake,configure,autogen,Imakefile,Makefile +.DESCRIPTION + make-repo.ps1 [] + is the path to the Git repository .EXAMPLE PS> ./make-repo C:\MyRepo .NOTES diff --git a/Scripts/make-repos.ps1 b/Scripts/make-repos.ps1 index d2b86d0c..54bc8f69 100755 --- a/Scripts/make-repos.ps1 +++ b/Scripts/make-repos.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - make-repos.ps1 [] + Builds all Git repositories in a folder .DESCRIPTION - Builds all Git repositories under the current/given directory + make-repos.ps1 [] .EXAMPLE PS> ./make-repos C:\MyRepos .NOTES diff --git a/Scripts/moon.ps1 b/Scripts/moon.ps1 index 0dff2da4..ef762fec 100755 --- a/Scripts/moon.ps1 +++ b/Scripts/moon.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - moon.ps1 -.DESCRIPTION Prints the current moon phase +.DESCRIPTION + moon.ps1 .EXAMPLE PS> ./moon .NOTES diff --git a/Scripts/mute-audio.ps1 b/Scripts/mute-audio.ps1 index d59cc154..97eb5b72 100755 --- a/Scripts/mute-audio.ps1 +++ b/Scripts/mute-audio.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - mute-audio.ps1 -.DESCRIPTION Mutes the audio output +.DESCRIPTION + mute-audio.ps1 .EXAMPLE PS> ./mute-audio .NOTES diff --git a/Scripts/new-branch.ps1 b/Scripts/new-branch.ps1 index 35bde328..e926906e 100755 --- a/Scripts/new-branch.ps1 +++ b/Scripts/new-branch.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - new-branch.ps1 [] [] -.DESCRIPTION Creates and switches to a new branch in a Git repository +.DESCRIPTION + new-branch.ps1 [] [] .EXAMPLE PS> ./new-branch test123 .NOTES diff --git a/Scripts/new-email.ps1 b/Scripts/new-email.ps1 index 00c42648..8ceaaf2f 100755 --- a/Scripts/new-email.ps1 +++ b/Scripts/new-email.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - new-email.ps1 [
] -.DESCRIPTION Opens the default email client to write a new email +.DESCRIPTION + new-email.ps1 [
] .EXAMPLE PS> ./new-email .NOTES diff --git a/Scripts/new-qrcode.ps1 b/Scripts/new-qrcode.ps1 index 1cee9bb3..891666b5 100755 --- a/Scripts/new-qrcode.ps1 +++ b/Scripts/new-qrcode.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - new-qrcode.ps1 [] [] -.DESCRIPTION Generates a new QR code image file +.DESCRIPTION + new-qrcode.ps1 [] [] .EXAMPLE PS> ./new-qrcode "Fasten seatbelt" 500x500 .NOTES diff --git a/Scripts/new-script.ps1 b/Scripts/new-script.ps1 index a8afdeda..6a90c03d 100755 --- a/Scripts/new-script.ps1 +++ b/Scripts/new-script.ps1 @@ -1,8 +1,9 @@ <# .SYNOPSIS - new-script.ps1 [] + Creates a new PowerShell script file .DESCRIPTION Creates a new PowerShell script file (by using template file ../Data/template.ps1). + new-script.ps1 [] .EXAMPLE PS> ./new-script myscript.ps1 ✔️ created new PowerShell script: myscript.ps1 diff --git a/Scripts/new-shortcut.ps1 b/Scripts/new-shortcut.ps1 index 50880484..08483989 100755 --- a/Scripts/new-shortcut.ps1 +++ b/Scripts/new-shortcut.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - new-shortcut.ps1 [] [] [] -.DESCRIPTION Creates a new shortcut file +.DESCRIPTION + new-shortcut.ps1 [] [] [] .EXAMPLE PS> ./new-shortcut C:\Temp\HDD C:\ .NOTES diff --git a/Scripts/new-symlink.ps1 b/Scripts/new-symlink.ps1 index d79bd701..6a07e8f8 100755 --- a/Scripts/new-symlink.ps1 +++ b/Scripts/new-symlink.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - new-symlink.ps1 [] [] -.DESCRIPTION Creates a new symbolic link file +.DESCRIPTION + new-symlink.ps1 [] [] .EXAMPLE PS> ./new-symlink C:\Temp\HDD C:\ .NOTES diff --git a/Scripts/new-tag.ps1 b/Scripts/new-tag.ps1 index 3262311e..e35d702f 100755 --- a/Scripts/new-tag.ps1 +++ b/Scripts/new-tag.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - new-tag.ps1 [] [] -.DESCRIPTION Creates a new tag in a Git repository +.DESCRIPTION + new-tag.ps1 [] [] .EXAMPLE PS> ./create-tag v1.7 .LINK diff --git a/Scripts/new-zipfile.ps1 b/Scripts/new-zipfile.ps1 index 29101b16..205f069e 100755 --- a/Scripts/new-zipfile.ps1 +++ b/Scripts/new-zipfile.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - new-zipfile.ps1 [] + Creates a new .ZIP file from a folder (including subfolders) .DESCRIPTION - Creates a new .zip file from a directory + new-zipfile.ps1 [] .EXAMPLE PS> ./new-zipfile C:\Windows .NOTES @@ -11,17 +11,17 @@ https://github.com/fleschutz/PowerShell #> -param([string]$directory = "") +param([string]$folder = "") try { - if ($directory -eq "" ) { $directory = read-host "Enter the path to the directory to zip" } + if ($folder -eq "" ) { $folder = read-host "Enter the path to the folder to zip" } $StopWatch = [system.diagnostics.stopwatch]::startNew() - $directory = resolve-path $directory - compress-archive -path $directory -destinationPath $directory.zip + $folder = resolve-path $folder + compress-archive -path $folder -destinationPath $folder.zip [int]$Elapsed = $StopWatch.Elapsed.TotalSeconds - "✔️ created zip file $($directory).zip in $Elapsed sec" + "✔️ created zip file $($folder).zip in $Elapsed sec" exit 0 # success } catch { "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))" diff --git a/Scripts/open-browser.ps1 b/Scripts/open-browser.ps1 index 42ca4b44..c18119b3 100755 --- a/Scripts/open-browser.ps1 +++ b/Scripts/open-browser.ps1 @@ -1,8 +1,9 @@ <# .SYNOPSIS - open-browser.ps1 [] + Opens the default Web browser .DESCRIPTION Opens the default Web browser, optional with given URL + open-browser.ps1 [] .EXAMPLE PS> ./open-browser .NOTES diff --git a/Scripts/open-calculator.ps1 b/Scripts/open-calculator.ps1 index a3ecb806..6f7197e0 100755 --- a/Scripts/open-calculator.ps1 +++ b/Scripts/open-calculator.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - open-calculator.ps1 + Starts the calculator application .DESCRIPTION - Starts the calculator program + open-calculator.ps1 .EXAMPLE PS> ./open-calculator .NOTES diff --git a/Scripts/open-email-client.ps1 b/Scripts/open-email-client.ps1 index c4b740a3..b849f46d 100755 --- a/Scripts/open-email-client.ps1 +++ b/Scripts/open-email-client.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - open-email-client.ps1 -.DESCRIPTION Starts the default email client +.DESCRIPTION + open-email-client.ps1 .EXAMPLE PS> ./open-email-client .NOTES diff --git a/Scripts/open-file-explorer.ps1 b/Scripts/open-file-explorer.ps1 index a48f7180..fa78b44b 100755 --- a/Scripts/open-file-explorer.ps1 +++ b/Scripts/open-file-explorer.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - open-file-explorer.ps1 -.DESCRIPTION Starts the File Explorer +.DESCRIPTION + open-file-explorer.ps1 .EXAMPLE PS> ./open-file-explorer .NOTES diff --git a/Scripts/open-netflix.ps1 b/Scripts/open-netflix.ps1 index 78d741b9..cb5cbc53 100755 --- a/Scripts/open-netflix.ps1 +++ b/Scripts/open-netflix.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - open-netflix.ps1 -.DESCRIPTION Starts the Netflix app (needs to be installed) +.DESCRIPTION + open-netflix.ps1 .EXAMPLE PS> ./open-netflix .NOTES diff --git a/Scripts/open-onedrive.ps1 b/Scripts/open-onedrive.ps1 index 0275aaef..4a26c2be 100755 --- a/Scripts/open-onedrive.ps1 +++ b/Scripts/open-onedrive.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - open-onedrive.ps1 -.DESCRIPTION Opens the user's OneDrive folder +.DESCRIPTION + open-onedrive.ps1 .EXAMPLE PS> ./open-onedrive .NOTES diff --git a/Scripts/open-recycle-bin.ps1 b/Scripts/open-recycle-bin.ps1 index a6e42ae9..d28058d9 100755 --- a/Scripts/open-recycle-bin.ps1 +++ b/Scripts/open-recycle-bin.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - open-recycle-bin.ps1 -.DESCRIPTION Starts the File Explorer with the recycle bin folder +.DESCRIPTION + open-recycle-bin.ps1 .EXAMPLE PS> ./open-recycle-bin .NOTES diff --git a/Scripts/play-beep.ps1 b/Scripts/play-beep.ps1 index a7b4c21f..ac4abf06 100755 --- a/Scripts/play-beep.ps1 +++ b/Scripts/play-beep.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - play-beep.ps1 -.DESCRIPTION Plays a short beep sound +.DESCRIPTION + play-beep.ps1 .EXAMPLE PS> ./play-beep .NOTES diff --git a/Scripts/play-files.ps1 b/Scripts/play-files.ps1 index 6882ce00..a01a9f51 100755 --- a/Scripts/play-files.ps1 +++ b/Scripts/play-files.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - play-files.ps1 [] -.DESCRIPTION Plays the given audio files (supporting MP3 and WAV format) +.DESCRIPTION + play-files.ps1 [] .EXAMPLE PS> ./play-files *.mp3 .NOTES @@ -11,10 +11,10 @@ https://github.com/fleschutz/PowerShell #> -param([string]$Pattern = "*") +param([string]$FilePattern = "*") try { - $Files = (get-childItem -path "$Pattern" -attributes !Directory) + $Files = (get-childItem -path "$FilePattern" -attributes !Directory) "Playing $($Files.Count) files ..." foreach ($File in $Files) { if ("$File" -like "*.mp3") { diff --git a/Scripts/play-happy-birthday.ps1 b/Scripts/play-happy-birthday.ps1 index 0dc98d2a..65890463 100644 --- a/Scripts/play-happy-birthday.ps1 +++ b/Scripts/play-happy-birthday.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - play-happy-birthday.ps1 -.DESCRIPTION Plays the Happy Birthday song +.DESCRIPTION + play-happy-birthday.ps1 .EXAMPLE PS> ./play-happy-birthday .NOTES diff --git a/Scripts/play-imperial-march.ps1 b/Scripts/play-imperial-march.ps1 index 2ccd4f48..9dfb94f2 100755 --- a/Scripts/play-imperial-march.ps1 +++ b/Scripts/play-imperial-march.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - play-imperial-march.ps1 -.DESCRIPTION Plays the Imperial March (Star Wars) +.DESCRIPTION + play-imperial-march.ps1 .EXAMPLE PS> ./play-imperial-march .NOTES diff --git a/Scripts/play-jingle-bells.ps1 b/Scripts/play-jingle-bells.ps1 index 4b9df1ed..d8baa566 100644 --- a/Scripts/play-jingle-bells.ps1 +++ b/Scripts/play-jingle-bells.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - play-jingle-bells.ps1 -.DESCRIPTION Plays Jingle Bells +.DESCRIPTION + play-jingle-bells.ps1 .EXAMPLE PS> ./play-jingle-bells .NOTES diff --git a/Scripts/play-m3u.ps1 b/Scripts/play-m3u.ps1 index 7281dcf6..32061c68 100755 --- a/Scripts/play-m3u.ps1 +++ b/Scripts/play-m3u.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - play-m3u.ps1 [] -.DESCRIPTION Plays the given playlist (in .M3U file format) +.DESCRIPTION + play-m3u.ps1 [] .EXAMPLE PS> ./play-m3u C:\MyPlaylist.m3u .NOTES @@ -11,13 +11,13 @@ https://github.com/fleschutz/PowerShell #> -param([string]$Filename = "") +param([string]$filename = "") try { - if ($Filename -eq "" ) { $Filename = read-host "Enter the M3U playlist filename" } + if ($filename -eq "" ) { $filename = read-host "Enter the M3U playlist filename" } - if (-not(test-path "$Filename" -pathType leaf)) { throw "Can't access playlist file: $Filename" } - $Lines = get-content $Filename + if (-not(test-path "$filename" -pathType leaf)) { throw "Can't access playlist file: $filename" } + $Lines = get-content $filename add-type -assemblyName presentationCore $MediaPlayer = new-object system.windows.media.mediaplayer @@ -27,14 +27,14 @@ try { if ($Line[0] -eq "#") { continue } if (-not(test-path "$Line" -pathType leaf)) { throw "Can't access audio file: $Line" } $FullPath = (get-childItem "$Line").fullname - $Filename = (get-item "$FullPath").name + $filename = (get-item "$FullPath").name do { $MediaPlayer.open("$FullPath") $Milliseconds = $MediaPlayer.NaturalDuration.TimeSpan.TotalMilliseconds } until ($Milliseconds) [int]$Minutes = $Milliseconds / 60000 [int]$Seconds = ($Milliseconds / 1000) % 60 - "▶️Playing 🎵$Filename ($($Minutes.ToString('00')):$($Seconds.ToString('00'))) ..." + "▶️Playing 🎵$filename ($($Minutes.ToString('00')):$($Seconds.ToString('00'))) ..." $MediaPlayer.Volume = 1 $MediaPlayer.play() start-sleep -milliseconds $Milliseconds diff --git a/Scripts/play-mission-impossible.ps1 b/Scripts/play-mission-impossible.ps1 index 02549310..c24ea6ec 100755 --- a/Scripts/play-mission-impossible.ps1 +++ b/Scripts/play-mission-impossible.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - play-mission-impossible.ps1 -.DESCRIPTION Plays the Mission Impossible theme +.DESCRIPTION + play-mission-impossible.ps1 .EXAMPLE PS> ./play-mission-impossible .NOTES diff --git a/Scripts/play-mp3.ps1 b/Scripts/play-mp3.ps1 index 3861e888..20347c8d 100755 --- a/Scripts/play-mp3.ps1 +++ b/Scripts/play-mp3.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - play-mp3.ps1 [] + Plays a sound file (in MP3 file format) .DESCRIPTION - Plays the given sound file (MP3 file format) + play-mp3.ps1 [] .EXAMPLE PS> ./play-mp3 C:\thunder.mp3 .NOTES diff --git a/Scripts/play-super-mario.ps1 b/Scripts/play-super-mario.ps1 index 52364246..e2ec13eb 100755 --- a/Scripts/play-super-mario.ps1 +++ b/Scripts/play-super-mario.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - play-super-mario.ps1 -.DESCRIPTION Plays the Super Mario intro +.DESCRIPTION + play-super-mario.ps1 .EXAMPLE PS> ./play-super-mario .NOTES diff --git a/Scripts/play-tetris-melody.ps1 b/Scripts/play-tetris-melody.ps1 index 35b7eb2d..33798e43 100644 --- a/Scripts/play-tetris-melody.ps1 +++ b/Scripts/play-tetris-melody.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - play-tetris-melody.ps1 -.DESCRIPTION Plays the Tetris melody +.DESCRIPTION + play-tetris-melody.ps1 .EXAMPLE PS> ./play-tetris-melody .NOTES diff --git a/Scripts/poweroff.ps1 b/Scripts/poweroff.ps1 index 5ef42c4e..4f0f802d 100755 --- a/Scripts/poweroff.ps1 +++ b/Scripts/poweroff.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - poweroff.ps1 -.DESCRIPTION Halts the local computer (needs admin rights) +.DESCRIPTION + poweroff.ps1 .EXAMPLE PS> ./poweroff .NOTES diff --git a/Scripts/publish-to-ipfs.ps1 b/Scripts/publish-to-ipfs.ps1 index c1d9f045..771e72be 100755 --- a/Scripts/publish-to-ipfs.ps1 +++ b/Scripts/publish-to-ipfs.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - publish-to-ipfs.ps1 [] [] -.DESCRIPTION Publishes the given files & folders to IPFS +.DESCRIPTION + publish-to-ipfs.ps1 [] [] .EXAMPLE PS> ./publish-to-ipfs C:\MyFile.txt .NOTES diff --git a/Scripts/pull-repo.ps1 b/Scripts/pull-repo.ps1 index 3bb420d6..fa290dce 100755 --- a/Scripts/pull-repo.ps1 +++ b/Scripts/pull-repo.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - pull-repo.ps1 [] -.DESCRIPTION Pulls updates for a local Git repository (including submodules) +.DESCRIPTION + pull-repo.ps1 [] .EXAMPLE PS> ./pull-repo C:\MyRepo .NOTES diff --git a/Scripts/pull-repos.ps1 b/Scripts/pull-repos.ps1 index c4fc5605..7581d029 100755 --- a/Scripts/pull-repos.ps1 +++ b/Scripts/pull-repos.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - pull-repos.ps1 [] + Pulls updates for all Git repositories in a folder (including submodules) .DESCRIPTION - Pulls updates for all Git repositories under the current/given directory (including submodules) + pull-repos.ps1 [] .EXAMPLE PS> ./pull-repos C:\MyRepos .NOTES diff --git a/Scripts/query-smart-data.ps1 b/Scripts/query-smart-data.ps1 index 966dc336..db39c0d7 100755 --- a/Scripts/query-smart-data.ps1 +++ b/Scripts/query-smart-data.ps1 @@ -1,7 +1,8 @@ <# .SYNOPSIS - query-smart-data.ps1 [] + Queries and saves the S.M.A.R.T. data of your HDD's/SSD's .DESCRIPTION + query-smart-data.ps1 [] Queries the S.M.A.R.T. data of your HDD/SSD's and saves it to the current/given directory (use smart-data2csv.ps1 to generate a CSV table for analysis). diff --git a/Scripts/reboot-fritzbox.ps1 b/Scripts/reboot-fritzbox.ps1 index 8c7c3688..a2539281 100755 --- a/Scripts/reboot-fritzbox.ps1 +++ b/Scripts/reboot-fritzbox.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - reboot-fritzbox.ps1 [] [] -.DESCRIPTION Reboots the FRITZ!Box device +.DESCRIPTION + reboot-fritzbox.ps1 [] [] .EXAMPLE PS> ./reboot-fritzbox .NOTES @@ -11,13 +11,10 @@ https://github.com/fleschutz/PowerShell #> -param([string]$USERNAME = "", [string]$PASSWORD = "") -if ($USERNAME -eq "") { - $USERNAME = read-host "Enter username for FRITZ!Box" -} -if ($PASSWORD -eq "") { - $PASSWORD = read-host "Enter password for FRITZ!Box" -} +param([string]$Username = "", [string]$Password = "") + +if ($Username -eq "") { $Username = read-host "Enter username for FRITZ!Box" } +if ($Password -eq "") { $Password = read-host "Enter password for FRITZ!Box" } $FB_FQDN = "fritz.box" if ($PSVersionTable.PSVersion.Major -lt 3) { @@ -41,7 +38,7 @@ function Execute-SOAPRequest { param([Xml]$SOAPRequest, [string]$soapactionheade $wr.Accept = 'text/xml' $wr.Method = 'POST' $wr.PreAuthenticate = $true - $wr.Credentials = [System.Net.NetworkCredential]::new($USERNAME,$PASSWORD) + $wr.Credentials = [System.Net.NetworkCredential]::new($Username,$Password) $requestStream = $wr.GetRequestStream() $SOAPRequest.Save($requestStream) diff --git a/Scripts/reboot.ps1 b/Scripts/reboot.ps1 index 07dcb0f7..a25a91f5 100755 --- a/Scripts/reboot.ps1 +++ b/Scripts/reboot.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - reboot.ps1 -.DESCRIPTION Reboots the local computer (needs admin rights) +.DESCRIPTION + reboot.ps1 .EXAMPLE PS> ./reboot .NOTES diff --git a/Scripts/remind-me.ps1 b/Scripts/remind-me.ps1 index a79b24c4..7a50bcb4 100755 --- a/Scripts/remind-me.ps1 +++ b/Scripts/remind-me.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - remind-me.ps1 + Creates a scheduled task that will display a popup message .DESCRIPTION - Creates a scheduled task that will display a popup message. + remind-me.ps1 .EXAMPLE PS> ./remind-me "Dentist" "4/10/2021 12:00 PM" diff --git a/Scripts/remove-empty-dirs.ps1 b/Scripts/remove-empty-dirs.ps1 index 4ae6846e..52c48bc4 100755 --- a/Scripts/remove-empty-dirs.ps1 +++ b/Scripts/remove-empty-dirs.ps1 @@ -1,8 +1,9 @@ <# .SYNOPSIS - remove-empty-dirs.ps1 [] + Removes all empty subfolders within a directory tree .DESCRIPTION - Removes all empty subfolders within the given directory tree + remove-empty-dirs.ps1 [] + is the path to the directory tree .EXAMPLE PS> ./remove-empty-dirs C:\Temp .NOTES diff --git a/Scripts/remove-print-jobs.ps1 b/Scripts/remove-print-jobs.ps1 index f9b087d1..587a5c11 100755 --- a/Scripts/remove-print-jobs.ps1 +++ b/Scripts/remove-print-jobs.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - remove-print-jobs.ps1 -.DESCRIPTION Removes all jobs from all printers +.DESCRIPTION + remove-print-jobs.ps1 .EXAMPLE PS> ./remove-print-jobs .NOTES diff --git a/Scripts/remove-tag.ps1 b/Scripts/remove-tag.ps1 index de933b6a..e57cc79e 100755 --- a/Scripts/remove-tag.ps1 +++ b/Scripts/remove-tag.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - remove-tag.ps1 [] [] [] -.DESCRIPTION Removes a Git tag (locally, remote, or both) +.DESCRIPTION + remove-tag.ps1 [] [] [] .EXAMPLE PS> ./remove-tag v1.7 locally .LINK diff --git a/Scripts/replace-in-files.ps1 b/Scripts/replace-in-files.ps1 index a9b66af7..538a87d5 100644 --- a/Scripts/replace-in-files.ps1 +++ b/Scripts/replace-in-files.ps1 @@ -1,10 +1,10 @@ <# .SYNOPSIS - replace-in-files.ps1 [] [] [] -.DESCRIPTION Search and replace a pattern in the given files by the replacement +.DESCRIPTION + replace-in-files.ps1 [] [] [] .EXAMPLE - PS> ./replace-in-files IO "Input Output" C:\Temp\*.txt + PS> ./replace-in-files NSA "No Such Agency" C:\Temp\*.txt .NOTES Author: Markus Fleschutz · License: CC0 .LINK diff --git a/Scripts/restart-network-adapters.ps1 b/Scripts/restart-network-adapters.ps1 index 3803509a..075804d3 100644 --- a/Scripts/restart-network-adapters.ps1 +++ b/Scripts/restart-network-adapters.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - restart-network-adapters.ps1 -.DESCRIPTION Restarts all local network adapters (needs admin rights) +.DESCRIPTION + restart-network-adapters.ps1 .EXAMPLE PS> ./restart-network-adapters .NOTES diff --git a/Scripts/scan-ports.ps1 b/Scripts/scan-ports.ps1 index 0f05f5a2..77ebb51d 100755 --- a/Scripts/scan-ports.ps1 +++ b/Scripts/scan-ports.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - scan-ports.ps1 -.DESCRIPTION Scans the network for open/closed ports +.DESCRIPTION + scan-ports.ps1 .EXAMPLE PS> ./scan-ports .NOTES diff --git a/Scripts/search-filename.ps1 b/Scripts/search-filename.ps1 index b4ea1adf..9ec46516 100755 --- a/Scripts/search-filename.ps1 +++ b/Scripts/search-filename.ps1 @@ -1,7 +1,8 @@ <# .SYNOPSIS - search-filename.ps1 + Lists all files and folder names matching a search pattern .DESCRIPTION + search-filename.ps1 [] [] This script serves as a quick Powershell replacement to the search functionality in Windows After you pass in a root folder and a search term, the script will list all files and folders matching that phrase. .EXAMPLE diff --git a/Scripts/search-files.ps1 b/Scripts/search-files.ps1 index 922a51f7..eae80af5 100755 --- a/Scripts/search-files.ps1 +++ b/Scripts/search-files.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - search-files.ps1 [] [] -.DESCRIPTION Searches for a pattern in the given files +.DESCRIPTION + search-files.ps1 [] [] .EXAMPLE PS> ./search-files UFO C:\Temp\*.txt .NOTES diff --git a/Scripts/send-email.ps1 b/Scripts/send-email.ps1 index 336569dd..ed007f66 100755 --- a/Scripts/send-email.ps1 +++ b/Scripts/send-email.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - send-email.ps1 -.DESCRIPTION Sends an email message +.DESCRIPTION + send-email.ps1 .EXAMPLE PS> ./send-email .NOTES diff --git a/Scripts/send-tcp.ps1 b/Scripts/send-tcp.ps1 index c4a5dbf2..82f84486 100755 --- a/Scripts/send-tcp.ps1 +++ b/Scripts/send-tcp.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - send-tcp.ps1 [] [] [] -.DESCRIPTION Sends a TCP message to the given IP address and port +.DESCRIPTION + send-tcp.ps1 [] [] [] .EXAMPLE PS> ./send-tcp 192.168.100.100 8080 "TEST" .NOTES diff --git a/Scripts/send-udp.ps1 b/Scripts/send-udp.ps1 index d5c86b03..f03ab939 100755 --- a/Scripts/send-udp.ps1 +++ b/Scripts/send-udp.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - send-udp.ps1 [] [] [] + Sends a UDP datagram message to an IP address and port .DESCRIPTION - Sends a UDP datagram message to the given IP address and port + send-udp.ps1 [] [] [] .EXAMPLE PS> ./send-udp 192.168.100.100 8080 "TEST" .NOTES diff --git a/Scripts/set-profile.ps1 b/Scripts/set-profile.ps1 index 5dd65b2a..585addf6 100755 --- a/Scripts/set-profile.ps1 +++ b/Scripts/set-profile.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - set-profile.ps1 -.DESCRIPTION Sets the PowerShell profile for the current user +.DESCRIPTION + set-profile.ps1 .EXAMPLE PS> ./set-profile .NOTES diff --git a/Scripts/set-timer.ps1 b/Scripts/set-timer.ps1 index b4910cba..cdd80450 100755 --- a/Scripts/set-timer.ps1 +++ b/Scripts/set-timer.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - set-timer.ps1 [] -.DESCRIPTION Sets a timer for a countdown +.DESCRIPTION + set-timer.ps1 [] .EXAMPLE PS> ./set-timer 60 .NOTES diff --git a/Scripts/set-wallpaper.ps1 b/Scripts/set-wallpaper.ps1 index 2d385bdc..6883dfcf 100755 --- a/Scripts/set-wallpaper.ps1 +++ b/Scripts/set-wallpaper.ps1 @@ -1,7 +1,8 @@ <# .SYNOPSIS - set-wallpaper.ps1 [] [