diff --git a/Scripts/add-firewall-rules.ps1 b/Scripts/add-firewall-rules.ps1 index 846afb6e..434978a1 100755 --- a/Scripts/add-firewall-rules.ps1 +++ b/Scripts/add-firewall-rules.ps1 @@ -1,10 +1,13 @@ ๏ปฟ<# .SYNOPSIS - add-firewall-rules.ps1 [] + add-firewall-rules.ps1 [] .DESCRIPTION - Adds firewall rules for the given executables (needs administrator rights) + Adds firewall rules for the given executables (needs admin rights) .EXAMPLE PS> ./add-firewall-rules C:\MyApp\bin + Adding firewall rule for C:\MyApp\bin\app1.exe + Adding firewall rule for C:\MyApp\bin\app2.exe + ... .LINK https://github.com/fleschutz/PowerShell .NOTES diff --git a/Scripts/add-memo.ps1 b/Scripts/add-memo.ps1 index ad9a29c6..b52b96af 100755 --- a/Scripts/add-memo.ps1 +++ b/Scripts/add-memo.ps1 @@ -5,6 +5,7 @@ Adds the given memo text to $HOME/Memos.csv .EXAMPLE PS> ./add-memo "Buy apples" + โœ”๏ธ added to ๐Ÿ“„/home/markus/Memos.csv .LINK https://github.com/fleschutz/PowerShell .NOTES diff --git a/Scripts/cd-docs.ps1 b/Scripts/cd-docs.ps1 index c2392b8f..de30cf87 100755 --- a/Scripts/cd-docs.ps1 +++ b/Scripts/cd-docs.ps1 @@ -5,6 +5,7 @@ Change the working directory to the user's documents folder .EXAMPLE PS> ./cd-docs + ๐Ÿ“‚/home/markus/Documents .LINK https://github.com/fleschutz/PowerShell .NOTES diff --git a/Scripts/cd-downloads.ps1 b/Scripts/cd-downloads.ps1 index 7121bc0f..4e67833f 100755 --- a/Scripts/cd-downloads.ps1 +++ b/Scripts/cd-downloads.ps1 @@ -5,6 +5,7 @@ Change the working directory to the user's downloads folder .EXAMPLE PS> ./cd-downloads + ๐Ÿ“‚/home/markus/Downloads .LINK https://github.com/fleschutz/PowerShell .NOTES diff --git a/Scripts/cd-dropbox.ps1 b/Scripts/cd-dropbox.ps1 index cb5f73b0..f1beb6b2 100755 --- a/Scripts/cd-dropbox.ps1 +++ b/Scripts/cd-dropbox.ps1 @@ -5,6 +5,7 @@ Change the working directory to the user's Dropbox folder .EXAMPLE PS> ./cd-dropbox + ๐Ÿ“‚/home/markus/Dropbox .LINK https://github.com/fleschutz/PowerShell .NOTES diff --git a/Scripts/cd-home.ps1 b/Scripts/cd-home.ps1 index ea8204c5..adcf5bdd 100755 --- a/Scripts/cd-home.ps1 +++ b/Scripts/cd-home.ps1 @@ -5,6 +5,7 @@ Change the working directory to the user's home directory .EXAMPLE PS> ./cd-home + ๐Ÿ“‚/home/markus .LINK https://github.com/fleschutz/PowerShell .NOTES diff --git a/Scripts/cd-music.ps1 b/Scripts/cd-music.ps1 index ff6509e9..3ff85ef7 100755 --- a/Scripts/cd-music.ps1 +++ b/Scripts/cd-music.ps1 @@ -5,6 +5,7 @@ Change the working directory to the user's music folder .EXAMPLE PS> ./cd-music + ๐Ÿ“‚/home/markus/Music .LINK https://github.com/fleschutz/PowerShell .NOTES diff --git a/Scripts/cd-onedrive.ps1 b/Scripts/cd-onedrive.ps1 index 1cd43d24..8aa8bee1 100644 --- a/Scripts/cd-onedrive.ps1 +++ b/Scripts/cd-onedrive.ps1 @@ -5,6 +5,7 @@ Change the working directory to the user's OneDrive folder .EXAMPLE PS> ./cd-onedrive + ๐Ÿ“‚/home/markus/OneDrive .LINK https://github.com/fleschutz/PowerShell .NOTES diff --git a/Scripts/cd-pics.ps1 b/Scripts/cd-pics.ps1 index 26a6b7d1..4e757171 100755 --- a/Scripts/cd-pics.ps1 +++ b/Scripts/cd-pics.ps1 @@ -5,6 +5,7 @@ Change the working directory to the user's pictures folder .EXAMPLE PS> ./cd-pics + ๐Ÿ“‚/home/markus/Pictures .LINK https://github.com/fleschutz/PowerShell .NOTES diff --git a/Scripts/cd-recycle-bin.ps1 b/Scripts/cd-recycle-bin.ps1 index 999394bc..9a2d3457 100644 --- a/Scripts/cd-recycle-bin.ps1 +++ b/Scripts/cd-recycle-bin.ps1 @@ -5,6 +5,7 @@ Change the working directory to the user's recycle bin folder .EXAMPLE PS> ./cd-recycle-bin + ๐Ÿ“‚C:\$Recycle.Bin\S-1-5-21-123404-23309-294260-1001 .LINK https://github.com/fleschutz/PowerShell .NOTES diff --git a/Scripts/cd-repos.ps1 b/Scripts/cd-repos.ps1 index 8b4f99f5..7bc0e3a1 100644 --- a/Scripts/cd-repos.ps1 +++ b/Scripts/cd-repos.ps1 @@ -5,6 +5,7 @@ Change the working directory to the user's Git repositories folder .EXAMPLE PS> ./cd-repos + ๐Ÿ“‚/home/markus/Repos .LINK https://github.com/fleschutz/PowerShell .NOTES diff --git a/Scripts/cd-root.ps1 b/Scripts/cd-root.ps1 index 0309329f..eac29ff4 100755 --- a/Scripts/cd-root.ps1 +++ b/Scripts/cd-root.ps1 @@ -5,6 +5,7 @@ Change the working directory to the root directory (C:\ on Windows) .EXAMPLE PS> ./cd-root + ๐Ÿ“‚C:\ .LINK https://github.com/fleschutz/PowerShell .NOTES @@ -14,7 +15,7 @@ if ($IsLinux) { $TargetDir = resolve-path "/" } else { - $TargetDir = resolve-path "C:/" + $TargetDir = resolve-path "C:\" } if (-not(test-path "$TargetDir" -pathType container)) { write-warning "Sorry, the root directory at ๐Ÿ“‚$TargetDir does not exist (yet)" diff --git a/Scripts/cd-scripts.ps1 b/Scripts/cd-scripts.ps1 index d857aeea..c6c65df2 100755 --- a/Scripts/cd-scripts.ps1 +++ b/Scripts/cd-scripts.ps1 @@ -5,6 +5,7 @@ Change the working directory to the PowerShell scripts folder .EXAMPLE PS> ./cd-scripts + ๐Ÿ“‚/home/markus/PowerShell/Scripts .LINK https://github.com/fleschutz/PowerShell .NOTES diff --git a/Scripts/cd-ssh.ps1 b/Scripts/cd-ssh.ps1 index f14aae8b..116273fe 100755 --- a/Scripts/cd-ssh.ps1 +++ b/Scripts/cd-ssh.ps1 @@ -5,6 +5,7 @@ Change the working directory to the user's SSH folder .EXAMPLE PS> ./cd-ssh + ๐Ÿ“‚/home/markus/.ssh .LINK https://github.com/fleschutz/PowerShell .NOTES diff --git a/Scripts/cd-up.ps1 b/Scripts/cd-up.ps1 index a088891a..13646c29 100755 --- a/Scripts/cd-up.ps1 +++ b/Scripts/cd-up.ps1 @@ -5,6 +5,7 @@ Change the working directory to one level up .EXAMPLE PS> .\cd-up + (one level up) .LINK https://github.com/fleschutz/PowerShell .NOTES diff --git a/Scripts/cd-up2.ps1 b/Scripts/cd-up2.ps1 index a4cbf3d2..d3cd25e9 100644 --- a/Scripts/cd-up2.ps1 +++ b/Scripts/cd-up2.ps1 @@ -5,6 +5,7 @@ Change the working directory to two directory levels up .EXAMPLE PS> ./cd-up2 + (two levels up) .LINK https://github.com/fleschutz/PowerShell .NOTES diff --git a/Scripts/cd-up3.ps1 b/Scripts/cd-up3.ps1 index dc87cfc4..2e661414 100644 --- a/Scripts/cd-up3.ps1 +++ b/Scripts/cd-up3.ps1 @@ -5,6 +5,7 @@ Change the working directory to three directory levels up .EXAMPLE PS> ./cd-up3 + (three levels up) .LINK https://github.com/fleschutz/PowerShell .NOTES diff --git a/Scripts/cd-up4.ps1 b/Scripts/cd-up4.ps1 index 2d228f80..3e4119b5 100644 --- a/Scripts/cd-up4.ps1 +++ b/Scripts/cd-up4.ps1 @@ -5,6 +5,7 @@ Change the working directory to four directory levels up .EXAMPLE PS> ./cd-up4 + (four levels up) .LINK https://github.com/fleschutz/PowerShell .NOTES diff --git a/Scripts/cd-videos.ps1 b/Scripts/cd-videos.ps1 index 02da3c9e..d5cce2d9 100755 --- a/Scripts/cd-videos.ps1 +++ b/Scripts/cd-videos.ps1 @@ -5,6 +5,7 @@ Change the working directory to the user's videos folder .EXAMPLE PS> ./cd-videos + ๐Ÿ“‚/home/markus/Videos .LINK https://github.com/fleschutz/PowerShell .NOTES diff --git a/Scripts/check-dns-resolution.ps1 b/Scripts/check-dns-resolution.ps1 index 45a6d847..c682cf80 100755 --- a/Scripts/check-dns-resolution.ps1 +++ b/Scripts/check-dns-resolution.ps1 @@ -5,6 +5,7 @@ Checks the DNS resolution with frequently used domain names .EXAMPLE PS> ./check-dns-resolution + โœ”๏ธ 11.8 domains/sec (177 domains resolved in 15 sec) .LINK https://github.com/fleschutz/PowerShell .NOTES @@ -30,7 +31,7 @@ try { [int]$Elapsed = $StopWatch.Elapsed.TotalSeconds $Average = [math]::round($Count / $Elapsed, 1) - "โœ”๏ธ $Average domains/s ($Count domains resolved in $Elapsed sec)" + "โœ”๏ธ $Average domains/sec ($Count domains resolved in $Elapsed sec)" exit 0 # success } catch { "โš ๏ธ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))" diff --git a/Scripts/check-drive-space.ps1 b/Scripts/check-drive-space.ps1 index 8fae8776..1046895c 100755 --- a/Scripts/check-drive-space.ps1 +++ b/Scripts/check-drive-space.ps1 @@ -5,6 +5,7 @@ Checks a drive for free space left (20 GB by default) .EXAMPLE PS> ./check-drive-space C + โœ”๏ธ 172 GB left on drive C (61 of 233 GB used) .LINK https://github.com/fleschutz/PowerShell .NOTES diff --git a/Scripts/check-file-system.ps1 b/Scripts/check-file-system.ps1 index e4c81570..529f77a2 100755 --- a/Scripts/check-file-system.ps1 +++ b/Scripts/check-file-system.ps1 @@ -5,6 +5,7 @@ Checks the file system of a drive (needs admin rights) .EXAMPLE PS> ./check-file-system C + โœ”๏ธ file system on drive C is clean .LINK https://github.com/fleschutz/PowerShell .NOTES diff --git a/Scripts/check-health.ps1 b/Scripts/check-health.ps1 index b370ec83..52e66491 100755 --- a/Scripts/check-health.ps1 +++ b/Scripts/check-health.ps1 @@ -5,6 +5,12 @@ Checks the health of the local computer .EXAMPLE PS> ./check-health + โœ”๏ธ 1213 GB left for swap space (67 of 1280 GB used) + โœ”๏ธ 172 GB left on drive C (61 of 233 GB used) + โœ”๏ธ 30.3 ยฐC CPU temperature - good + โœ”๏ธ 19.7 domains/s (177 domains resolved in 9 sec) + โœ”๏ธ 29 ms ping average (13 ms min, 110 ms max, 10 hosts) + โœ”๏ธ Windmill is healthy .LINK https://github.com/fleschutz/PowerShell .NOTES @@ -12,9 +18,7 @@ License: CC0 #> -$Hostname = $(hostname) $Healthy = 1 -"Checking $Hostname's health..." & "$PSScriptRoot/check-swap-space.ps1" if ($lastExitCode -ne "0") { $Healthy = 0 } @@ -41,6 +45,7 @@ if ($IsLinux) { if ($lastExitCode -ne "0") { $Healthy = 0 } } +$Hostname = $(hostname) if ($Healthy) { "โœ”๏ธ $Hostname is healthy" exit 0 # success diff --git a/Scripts/check-ipv4-address.ps1 b/Scripts/check-ipv4-address.ps1 index 0240a843..53bb3a29 100755 --- a/Scripts/check-ipv4-address.ps1 +++ b/Scripts/check-ipv4-address.ps1 @@ -1,10 +1,11 @@ ๏ปฟ<# .SYNOPSIS - check-ipv4-address.ps1 [
] + check-ipv4-address.ps1 [
] .DESCRIPTION Checks the given IPv4 address for validity .EXAMPLE PS> ./check-ipv4-address 192.168.11.22 + โœ”๏ธ IPv4 192.168.11.22 is valid .LINK https://github.com/fleschutz/PowerShell .NOTES @@ -26,7 +27,7 @@ try { if ($Address -eq "" ) { $Address = read-host "Enter IPv4 address to validate" } if (IsIPv4AddressValid $Address) { - "โœ”๏ธ IPv4 address $Address is valid" + "โœ”๏ธ IPv4 $Address is valid" exit 0 # success } else { write-warning "Invalid IPv4 address: $Address" diff --git a/Scripts/check-ipv6-address.ps1 b/Scripts/check-ipv6-address.ps1 index 95c4c8e4..2d73b69d 100755 --- a/Scripts/check-ipv6-address.ps1 +++ b/Scripts/check-ipv6-address.ps1 @@ -1,10 +1,11 @@ ๏ปฟ<# .SYNOPSIS - check-ipv6-address.ps1 [
] + check-ipv6-address.ps1 [
] .DESCRIPTION Checks the given IPv6 address for validity .EXAMPLE PS> ./check-ipv6-address fe80::200:5aee:feaa:20a2 + โœ”๏ธ IPv6 fe80::200:5aee:feaa:20a2 is valid .LINK https://github.com/fleschutz/PowerShell .NOTES @@ -40,7 +41,7 @@ try { $Address = read-host "Enter IPv6 address to validate" } if (IsIPv6AddressValid $Address) { - "โœ”๏ธ IPv6 address $Address is valid" + "โœ”๏ธ IPv6 $Address is valid" exit 0 # success } else { write-warning "Invalid IPv6 address: $Address" diff --git a/Scripts/check-mac-address.ps1 b/Scripts/check-mac-address.ps1 index 31a8d105..79264023 100755 --- a/Scripts/check-mac-address.ps1 +++ b/Scripts/check-mac-address.ps1 @@ -5,6 +5,7 @@ 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). .EXAMPLE PS> ./check-mac-address 11:22:33:44:55:66 + โœ”๏ธ MAC address 11:22:33:44:55:66 is valid .LINK https://github.com/fleschutz/PowerShell .NOTES diff --git a/Scripts/check-ping.ps1 b/Scripts/check-ping.ps1 index 6ddbd052..5a6ba763 100755 --- a/Scripts/check-ping.ps1 +++ b/Scripts/check-ping.ps1 @@ -6,6 +6,7 @@ (default is: 'amazon.com,apple.com,bing.com,cnn.com,dropbox.com,facebook.com,google.com,live.com,twitter.com,youtube.com) .EXAMPLE PS> ./check-ping + โœ”๏ธ 36 ms ping average (13 ms min, 109 ms max, 10 hosts) .LINK https://github.com/fleschutz/PowerShell .NOTES @@ -34,7 +35,7 @@ try { } $Avg = $Avg / $Pings.count - "โœ”๏ธ $Avg ms net latency average ($Min ms min, $Max ms max, $($Pings.count) hosts)" + "โœ”๏ธ $Avg ms ping average ($Min ms min, $Max ms max, $($Pings.count) hosts)" exit 0 # success } catch { "โš ๏ธ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))" diff --git a/Scripts/check-subnet-mask.ps1 b/Scripts/check-subnet-mask.ps1 index d388634f..0b296ed2 100755 --- a/Scripts/check-subnet-mask.ps1 +++ b/Scripts/check-subnet-mask.ps1 @@ -5,6 +5,7 @@ Checks the given subnet mask for validity .EXAMPLE PS> ./check-subnet-mask 255.255.255.0 + โœ”๏ธ subnet mask 255.255.255.0 is valid .LINK https://github.com/fleschutz/PowerShell .NOTES diff --git a/Scripts/check-swap-space.ps1 b/Scripts/check-swap-space.ps1 index e375965a..4f76a13c 100755 --- a/Scripts/check-swap-space.ps1 +++ b/Scripts/check-swap-space.ps1 @@ -5,6 +5,7 @@ Checks the free swap space .EXAMPLE PS> ./check-swap-space + โœ”๏ธ 1213 GB left for swap space (67 of 1280 GB used) .LINK https://github.com/fleschutz/PowerShell .NOTES @@ -36,7 +37,7 @@ try { write-warning "Swap space has only $Free GB left to use! ($Used of $Total GB used, minimum is $MinLevel GB)" exit 1 } - "โœ”๏ธ $Free GB left on swap space ($Used of $Total GB used)" + "โœ”๏ธ $Free GB left for swap space ($Used of $Total GB used)" exit 0 # success } catch { "โš ๏ธ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))" diff --git a/Scripts/check-windows-system-files.ps1 b/Scripts/check-windows-system-files.ps1 index 74ff5aec..923ba7bf 100755 --- a/Scripts/check-windows-system-files.ps1 +++ b/Scripts/check-windows-system-files.ps1 @@ -5,6 +5,7 @@ Checks the validity of the Windows system files (requires admin rights) .EXAMPLE PS> ./check-windows-system-files + โœ”๏ธ checked Windows system files .LINK https://github.com/fleschutz/PowerShell .NOTES diff --git a/Scripts/check-xml-file.ps1 b/Scripts/check-xml-file.ps1 index a708377b..73e63028 100755 --- a/Scripts/check-xml-file.ps1 +++ b/Scripts/check-xml-file.ps1 @@ -5,6 +5,7 @@ Checks the given XML file for validity .EXAMPLE PS> ./check-xml-file myfile.xml + โœ”๏ธ XML file is valid .NOTES Author: Markus Fleschutz ยท License: CC0 .LINK diff --git a/Scripts/clean-repo.ps1 b/Scripts/clean-repo.ps1 index 50395cbe..5249fb4e 100755 --- a/Scripts/clean-repo.ps1 +++ b/Scripts/clean-repo.ps1 @@ -5,6 +5,8 @@ Cleans a Git repository from untracked files (including submodules, e.g. for a fresh build) .EXAMPLE PS> ./clean-repo C:\MyRepo + ๐Ÿงน Cleaning Git repository ๐Ÿ“‚C:\MyRepo from untracked files... + โœ”๏ธ cleaned Git repository ๐Ÿ“‚C:\MyRepo in 0 sec .NOTES Author: Markus Fleschutz ยท License: CC0 .LINK diff --git a/Scripts/clear-recycle-bin.ps1 b/Scripts/clear-recycle-bin.ps1 index 3380fa74..be0d893c 100755 --- a/Scripts/clear-recycle-bin.ps1 +++ b/Scripts/clear-recycle-bin.ps1 @@ -6,6 +6,7 @@ NOTE: can not be undo! .EXAMPLE PS> ./clear-recycle-bin + โœ”๏ธ cleared recycle bin .NOTES Author: Markus Fleschutz ยท License: CC0 .LINK diff --git a/Scripts/publish-to-ipfs.ps1 b/Scripts/publish-to-ipfs.ps1 index a5f0841f..c1d9f045 100755 --- a/Scripts/publish-to-ipfs.ps1 +++ b/Scripts/publish-to-ipfs.ps1 @@ -18,27 +18,26 @@ try { $StopWatch = [system.diagnostics.stopwatch]::startNew() - "" - "๐Ÿ‘‰ Step 1/3: Searching IPFS executable..." + "โณ Step 1/3: Searching for IPFS executable..." & ipfs --version if ($lastExitCode -ne "0") { throw "Can't execute 'ipfs' - make sure IPFS is installed and available" } if (test-path "$FilePattern" -pathType container) { "" - "๐Ÿ‘‰ Step 2/3: Publishing folder $FilePattern/..." + "โณ Step 2/3: Publishing folder $FilePattern/..." & ipfs add -r "$FilePattern" > $HashList [int]$Count = 1 "" - "๐Ÿ‘‰ Step 3/3: Calculating digital forensics hashes to $DF_HASHES ..." + "โณ Step 3/3: Calculating digital forensics hashes to $DF_HASHES ..." & nice hashdeep -c md5,sha1,sha256 -r -d -l -j 1 "$FilePattern" > $DF_Hashes } else { $FileList = (get-childItem "$FilePattern") foreach ($File in $FileList) { if (test-path "$FilePattern" -pathType container) { - "๐Ÿ‘‰ Step 2/3: Publishing folder $File/..." + "โณ Step 2/3: Publishing folder $File/..." & ipfs add -r "$File" >> $HashList } else { - "๐Ÿ‘‰ Step 2/3: Publishing file $File..." + "โณ Step 3/3: Publishing file $File..." & ipfs add "$File" >> $HashList } }