Update the manual pages

This commit is contained in:
Markus Fleschutz 2023-10-19 08:12:00 +02:00
parent 7ed57228ac
commit 7e379a79ba
591 changed files with 2101 additions and 1024 deletions

85
Docs/Windefender.md Normal file
View File

@ -0,0 +1,85 @@
*Windefender.ps1*
================
This script can enable disable and show windows defender real time monitoring!
Parameters
----------
```powershell
PS> ./Windefender.ps1 [<CommonParameters>]
[<CommonParameters>]
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,
WarningVariable, OutBuffer, PipelineVariable, and OutVariable.
```
Example
-------
```powershell
PS> ./Windefender.ps1
```
Notes
-----
Author: Dark Master | License: CC0-1,0
Related Links
-------------
https://github.com/pakoti/Awesome_Sysadmin
Script Content
--------------
```powershell
<#
.SYNOPSIS
Windows defender in powershell
.DESCRIPTION
This script can enable disable and show windows defender real time monitoring!
.EXAMPLE
PS> ./Windefender.ps1
.LINK
https://github.com/pakoti/Awesome_Sysadmin
.NOTES
Author: Dark Master | License: CC0-1,0
#>
$defender = Get-MpPreference
$userInput = Read-Host "Enter an option:
[1] Disable real time monitoring
[2] Enable real time monitoring
[3] Check status
"
switch($userInput) {
1 {
$defender.DisableRealtimeMonitoring = $true
$defender | Set-MpPreference
Write-Host "Real-time monitoring of Windows Defender has been disabled."
break
}
2 {
$defender.DisableRealtimeMonitoring = $false
$defender | Set-MpPreference
Write-Host "Real-time monitoring of Windows Defender has been enabled."
break
}
3 {
if($defender.DisableRealtimeMonitoring) {
Write-Host "Real-time monitoring of Windows Defender is currently disabled."
} else {
Write-Host "Real-time monitoring of Windows Defender is currently enabled."
}
break
}
default {
Write-Host "Invalid option selected."
break
}
}
```
*(generated by convert-ps2md.ps1 using the comment-based help of Windefender.ps1 as of 10/19/2023 08:11:43)*

View File

@ -113,4 +113,4 @@ try {
``` ```
*(generated by convert-ps2md.ps1 using the comment-based help of add-firewall-rules.ps1 as of 09/20/2023 17:04:37)* *(generated by convert-ps2md.ps1 using the comment-based help of add-firewall-rules.ps1 as of 10/19/2023 08:11:35)*

View File

@ -79,4 +79,4 @@ try {
} }
``` ```
*(generated by convert-ps2md.ps1 using the comment-based help of add-memo.ps1 as of 09/20/2023 17:04:37)* *(generated by convert-ps2md.ps1 using the comment-based help of add-memo.ps1 as of 10/19/2023 08:11:35)*

View File

@ -71,4 +71,4 @@ try {
} }
``` ```
*(generated by convert-ps2md.ps1 using the comment-based help of alert.ps1 as of 09/20/2023 17:04:37)* *(generated by convert-ps2md.ps1 using the comment-based help of alert.ps1 as of 10/19/2023 08:11:35)*

View File

@ -1,15 +1,15 @@
*build-repo.ps1* *build-repo.ps1*
================ ================
This PowerShell script builds a repository by supporting: cmake, configure, autogen, Imakefile, and Makefile. This PowerShell script builds a Git repository by supporting build systems such as: autogen, cmake, configure, Gradle, Imakefile, Makefile, and Meson.
Parameters Parameters
---------- ----------
```powershell ```powershell
PS> ./build-repo.ps1 [[-RepoDir] <String>] [<CommonParameters>] PS> ./build-repo.ps1 [[-path] <String>] [<CommonParameters>]
-RepoDir <String> -path <String>
Specifies the path to the Git repository Specifies the path to the Git repository (current working dir by default)
Required? false Required? false
Position? 1 Position? 1
@ -25,7 +25,10 @@ PS> ./build-repo.ps1 [[-RepoDir] <String>] [<CommonParameters>]
Example Example
------- -------
```powershell ```powershell
PS> ./build-repo.ps1 C:\MyRepo PS> ./build-repo.ps1 C:\Repos\ninja
⏳ Building 📂ninja using CMakeLists.txt into 📂ninja/_My_Build...
...
✔️ Built 📂ninja in 47 sec
``` ```
@ -44,27 +47,30 @@ Script Content
.SYNOPSIS .SYNOPSIS
Builds a repository Builds a repository
.DESCRIPTION .DESCRIPTION
This PowerShell script builds a repository by supporting: cmake, configure, autogen, Imakefile, and Makefile. This PowerShell script builds a Git repository by supporting build systems such as: autogen, cmake, configure, Gradle, Imakefile, Makefile, and Meson.
.PARAMETER RepoDir .PARAMETER path
Specifies the path to the Git repository Specifies the path to the Git repository (current working dir by default)
.EXAMPLE .EXAMPLE
PS> ./build-repo.ps1 C:\MyRepo PS> ./build-repo.ps1 C:\Repos\ninja
⏳ Building 📂ninja using CMakeLists.txt into 📂ninja/_My_Build...
...
✔️ Built 📂ninja in 47 sec
.LINK .LINK
https://github.com/fleschutz/PowerShell https://github.com/fleschutz/PowerShell
.NOTES .NOTES
Author: Markus Fleschutz | License: CC0 Author: Markus Fleschutz | License: CC0
#> #>
param([string]$RepoDir = "$PWD") param([string]$path = "$PWD")
function BuildInDir { param($Path) function BuildInDir([string]$path) {
$DirName = (Get-Item "$Path").Name $dirName = (Get-Item "$path").Name
if (Test-Path "$Path/CMakeLists.txt" -pathType leaf) { if (Test-Path "$path/CMakeLists.txt" -pathType leaf) {
"⏳ Building repo 📂$DirName using CMakeLists.txt into subfolder _My_Build ..." "⏳ Building 📂$dirName by using CMake into 📂$dirName/_My_Build..."
if (-not(Test-Path "$Path/_My_Build/" -pathType container)) { if (-not(Test-Path "$path/_My_Build/" -pathType container)) {
& mkdir "$Path/_My_Build/" & mkdir "$path/_My_Build/"
} }
Set-Location "$Path/_My_Build/" Set-Location "$path/_My_Build/"
& cmake .. & cmake ..
if ($lastExitCode -ne "0") { throw "Executing 'cmake ..' has failed" } if ($lastExitCode -ne "0") { throw "Executing 'cmake ..' has failed" }
@ -75,9 +81,9 @@ function BuildInDir { param($Path)
& make test & make test
if ($lastExitCode -ne "0") { throw "Executing 'make test' has failed" } if ($lastExitCode -ne "0") { throw "Executing 'make test' has failed" }
} elseif (Test-Path "$Path/configure" -pathType leaf) { } elseif (Test-Path "$path/configure" -pathType leaf) {
"⏳ Building repo 📂$DirName using 'configure'..." "⏳ Building 📂$dirName by using 'configure'..."
Set-Location "$Path/" Set-Location "$path/"
& ./configure & ./configure
#if ($lastExitCode -ne "0") { throw "Script 'configure' exited with error code $lastExitCode" } #if ($lastExitCode -ne "0") { throw "Script 'configure' exited with error code $lastExitCode" }
@ -88,9 +94,9 @@ function BuildInDir { param($Path)
& make test & make test
if ($lastExitCode -ne "0") { throw "Executing 'make test' has failed" } if ($lastExitCode -ne "0") { throw "Executing 'make test' has failed" }
} elseif (Test-Path "$Path/autogen.sh" -pathType leaf) { } elseif (Test-Path "$path/autogen.sh" -pathType leaf) {
"⏳ Building repo 📂$DirName using 'autogen.sh'..." "⏳ Building 📂$dirName by using 'autogen.sh'..."
Set-Location "$Path/" Set-Location "$path/"
& ./autogen.sh & ./autogen.sh
if ($lastExitCode -ne "0") { throw "Script 'autogen.sh' exited with error code $lastExitCode" } if ($lastExitCode -ne "0") { throw "Script 'autogen.sh' exited with error code $lastExitCode" }
@ -98,9 +104,9 @@ function BuildInDir { param($Path)
& make -j4 & make -j4
if ($lastExitCode -ne "0") { throw "Executing 'make -j4' has failed" } if ($lastExitCode -ne "0") { throw "Executing 'make -j4' has failed" }
} elseif (Test-Path "$Path/build.gradle" -pathType leaf) { } elseif (Test-Path "$path/build.gradle" -pathType leaf) {
"⏳ Building repo 📂$DirName using build.gradle..." "⏳ Building 📂$dirName by using Gradle..."
Set-Location "$Path" Set-Location "$path"
& gradle build & gradle build
if ($lastExitCode -ne "0") { throw "'gradle build' has failed" } if ($lastExitCode -ne "0") { throw "'gradle build' has failed" }
@ -108,9 +114,15 @@ function BuildInDir { param($Path)
& gradle test & gradle test
if ($lastExitCode -ne "0") { throw "'gradle test' has failed" } if ($lastExitCode -ne "0") { throw "'gradle test' has failed" }
} elseif (Test-Path "$Path/Imakefile" -pathType leaf) { } elseif (Test-Path "$path/meson.build" -pathType leaf) {
"⏳ Building repo 📂$DirName using Imakefile..." "⏳ Building 📂$dirName by using Meson..."
Set-Location "$RepoDir/" Set-Location "$path"
& meson . build --prefix=/usr/local
if ($lastExitCode -ne "0") { throw "'meson . build' has failed" }
} elseif (Test-Path "$path/Imakefile" -pathType leaf) {
"⏳ Building 📂$dirName by using Imakefile..."
Set-Location "$path/"
& xmkmf & xmkmf
if ($lastExitCode -ne "0") { throw "Executing 'xmkmf' has failed" } if ($lastExitCode -ne "0") { throw "Executing 'xmkmf' has failed" }
@ -118,23 +130,23 @@ function BuildInDir { param($Path)
& make -j4 & make -j4
if ($lastExitCode -ne "0") { throw "Executing 'make -j4' has failed" } if ($lastExitCode -ne "0") { throw "Executing 'make -j4' has failed" }
} elseif (Test-Path "$Path/Makefile" -pathType leaf) { } elseif (Test-Path "$path/Makefile" -pathType leaf) {
"⏳ Building repo 📂$DirName using Makefile..." "⏳ Building 📂$dirName by using Makefile..."
Set-Location "$Path" Set-Location "$path"
& make -j4 & make -j4
if ($lastExitCode -ne "0") { throw "Executing 'make -j4' has failed" } if ($lastExitCode -ne "0") { throw "Executing 'make -j4' has failed" }
} elseif (Test-Path "$Path/makefile" -pathType leaf) { } elseif (Test-Path "$path/makefile" -pathType leaf) {
"⏳ Building repo 📂$DirName using makefile..." "⏳ Building 📂$dirName by using makefile..."
Set-Location "$Path" Set-Location "$path"
& make -j4 & make -j4
if ($lastExitCode -ne "0") { throw "Executing 'make -j4' has failed" } if ($lastExitCode -ne "0") { throw "Executing 'make -j4' has failed" }
} elseif (Test-Path "$Path/compile.sh" -pathType leaf) { } elseif (Test-Path "$path/compile.sh" -pathType leaf) {
"⏳ Building repo 📂$DirName using 'compile.sh'..." "⏳ Building 📂$dirName by using 'compile.sh'..."
Set-Location "$Path/" Set-Location "$path/"
& ./compile.sh & ./compile.sh
if ($lastExitCode -ne "0") { throw "Script 'compile.sh' exited with error code $lastExitCode" } if ($lastExitCode -ne "0") { throw "Script 'compile.sh' exited with error code $lastExitCode" }
@ -142,34 +154,34 @@ function BuildInDir { param($Path)
& make -j4 & make -j4
if ($lastExitCode -ne "0") { throw "Executing 'make -j4' has failed" } if ($lastExitCode -ne "0") { throw "Executing 'make -j4' has failed" }
} elseif (Test-Path "$Path/attower/src/build/DevBuild/build.bat" -pathType leaf) { } elseif (Test-Path "$path/attower/src/build/DevBuild/build.bat" -pathType leaf) {
"⏳ Building repo 📂$DirName using build.bat ..." "⏳ Building 📂$dirName by using build.bat ..."
Set-Location "$Path/attower/src/build/DevBuild/" Set-Location "$path/attower/src/build/DevBuild/"
& ./build.bat build-all-release & ./build.bat build-all-release
if ($lastExitCode -ne "0") { throw "Script 'build.bat' exited with error code $lastExitCode" } if ($lastExitCode -ne "0") { throw "Script 'build.bat' exited with error code $lastExitCode" }
} elseif (Test-Path "$Path/$DirName" -pathType container) { } elseif (Test-Path "$path/$dirName" -pathType container) {
"⏳ No make rule found, trying subfolder 📂$($DirName)..." "⏳ No make rule found, trying subfolder 📂$($dirName)..."
BuildInDir "$Path/$DirName" BuildInDir "$path/$dirName"
} else { } else {
Write-Warning "Sorry, no make rule applies to: 📂$DirName" Write-Warning "Sorry, no make rule applies to: 📂$dirName"
exit 0 # success exit 0 # success
} }
} }
try { try {
$StopWatch = [system.diagnostics.stopwatch]::startNew() $stopWatch = [system.diagnostics.stopwatch]::startNew()
if (-not(Test-Path "$RepoDir" -pathType container)) { throw "Can't access directory: $RepoDir" } if (-not(Test-Path "$path" -pathType container)) { throw "Can't access directory: $path" }
$RepoDirName = (Get-Item "$RepoDir").Name
$PreviousPath = Get-Location $previousPath = Get-Location
BuildInDir "$RepoDir" BuildInDir "$path"
Set-Location "$PreviousPath" Set-Location "$previousPath"
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds $repoDirName = (Get-Item "$path").Name
"✔️ built repo 📂$RepoDirName in $Elapsed sec" [int]$elapsed = $stopWatch.Elapsed.TotalSeconds
"✔️ Built 📂$repoDirName in $elapsed sec"
exit 0 # success exit 0 # success
} catch { } catch {
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
@ -177,4 +189,4 @@ try {
} }
``` ```
*(generated by convert-ps2md.ps1 using the comment-based help of build-repo.ps1 as of 09/20/2023 17:04:37)* *(generated by convert-ps2md.ps1 using the comment-based help of build-repo.ps1 as of 10/19/2023 08:11:35)*

View File

@ -82,4 +82,4 @@ try {
} }
``` ```
*(generated by convert-ps2md.ps1 using the comment-based help of build-repos.ps1 as of 09/20/2023 17:04:37)* *(generated by convert-ps2md.ps1 using the comment-based help of build-repos.ps1 as of 10/19/2023 08:11:35)*

View File

@ -60,4 +60,4 @@ try {
} }
``` ```
*(generated by convert-ps2md.ps1 using the comment-based help of cd-autostart.ps1 as of 09/20/2023 17:04:37)* *(generated by convert-ps2md.ps1 using the comment-based help of cd-autostart.ps1 as of 10/19/2023 08:11:35)*

View File

@ -1,7 +1,7 @@
*cd-crashdumps.ps1* *cd-crashdumps.ps1*
================ ================
This PowerShell script changes the working directory to the crash dumps directory (Windows only). This PowerShell script changes the working directory to the crash dumps directory (Windows only). Whenever a software crashes and crash dumps are enabled(!) a crash dump file is written. This file helps to identify the reason for the crash.
Parameters Parameters
---------- ----------
@ -36,7 +36,7 @@ Script Content
.SYNOPSIS .SYNOPSIS
Change to the crash dumps folder Change to the crash dumps folder
.DESCRIPTION .DESCRIPTION
This PowerShell script changes the working directory to the crash dumps directory (Windows only). This PowerShell script changes the working directory to the crash dumps directory (Windows only). Whenever a software crashes and crash dumps are enabled(!) a crash dump file is written. This file helps to identify the reason for the crash.
.EXAMPLE .EXAMPLE
PS> ./cd-crashdumps PS> ./cd-crashdumps
📂C:\Users\Markus\AppData\Local\CrashDumps 📂C:\Users\Markus\AppData\Local\CrashDumps
@ -47,12 +47,15 @@ Script Content
#> #>
try { try {
[string]$Path = Resolve-Path -Path "~" if ($IsLinux) { throw "Sorry, Windows only" }
if (!(Test-Path $Path)) { throw "Home directory at $Path doesn't exist (yet)" }
$Path += "\AppData\Local\CrashDumps" [string]$path = Resolve-Path -Path "~"
if (!(Test-Path $Path)) { throw "Crashdumps directory at $Path doesn't exist (yet)" } if (!(Test-Path "$path" -pathType container)) { throw "Home directory at $path doesn't exist (yet)" }
$path += "\AppData\Local\CrashDumps"
if (!(Test-Path "$path" -pathType container)) { throw "Crashdumps directory at $path doesn't exist (yet)" }
Set-Location "$Path" Set-Location "$Path"
"📂$Path" "📂$path"
exit 0 # success exit 0 # success
} catch { } catch {
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
@ -60,4 +63,4 @@ try {
} }
``` ```
*(generated by convert-ps2md.ps1 using the comment-based help of cd-crashdumps.ps1 as of 09/20/2023 17:04:37)* *(generated by convert-ps2md.ps1 using the comment-based help of cd-crashdumps.ps1 as of 10/19/2023 08:11:35)*

View File

@ -64,4 +64,4 @@ try {
} }
``` ```
*(generated by convert-ps2md.ps1 using the comment-based help of cd-desktop.ps1 as of 09/20/2023 17:04:37)* *(generated by convert-ps2md.ps1 using the comment-based help of cd-desktop.ps1 as of 10/19/2023 08:11:35)*

View File

@ -64,4 +64,4 @@ try {
} }
``` ```
*(generated by convert-ps2md.ps1 using the comment-based help of cd-docs.ps1 as of 09/20/2023 17:04:37)* *(generated by convert-ps2md.ps1 using the comment-based help of cd-docs.ps1 as of 10/19/2023 08:11:35)*

View File

@ -64,4 +64,4 @@ try {
} }
``` ```
*(generated by convert-ps2md.ps1 using the comment-based help of cd-downloads.ps1 as of 09/20/2023 17:04:37)* *(generated by convert-ps2md.ps1 using the comment-based help of cd-downloads.ps1 as of 10/19/2023 08:11:35)*

View File

@ -60,4 +60,4 @@ try {
} }
``` ```
*(generated by convert-ps2md.ps1 using the comment-based help of cd-dropbox.ps1 as of 09/20/2023 17:04:37)* *(generated by convert-ps2md.ps1 using the comment-based help of cd-dropbox.ps1 as of 10/19/2023 08:11:35)*

View File

@ -64,4 +64,4 @@ try {
} }
``` ```
*(generated by convert-ps2md.ps1 using the comment-based help of cd-etc.ps1 as of 09/20/2023 17:04:37)* *(generated by convert-ps2md.ps1 using the comment-based help of cd-etc.ps1 as of 10/19/2023 08:11:35)*

View File

@ -60,4 +60,4 @@ try {
} }
``` ```
*(generated by convert-ps2md.ps1 using the comment-based help of cd-fonts.ps1 as of 09/20/2023 17:04:37)* *(generated by convert-ps2md.ps1 using the comment-based help of cd-fonts.ps1 as of 10/19/2023 08:11:35)*

View File

@ -60,4 +60,4 @@ try {
} }
``` ```
*(generated by convert-ps2md.ps1 using the comment-based help of cd-home.ps1 as of 09/20/2023 17:04:37)* *(generated by convert-ps2md.ps1 using the comment-based help of cd-home.ps1 as of 10/19/2023 08:11:35)*

View File

@ -48,4 +48,4 @@ try {
} }
``` ```
*(generated by convert-ps2md.ps1 using the comment-based help of cd-logs.ps1 as of 09/20/2023 17:04:37)* *(generated by convert-ps2md.ps1 using the comment-based help of cd-logs.ps1 as of 10/19/2023 08:11:35)*

View File

@ -64,4 +64,4 @@ try {
} }
``` ```
*(generated by convert-ps2md.ps1 using the comment-based help of cd-music.ps1 as of 09/20/2023 17:04:37)* *(generated by convert-ps2md.ps1 using the comment-based help of cd-music.ps1 as of 10/19/2023 08:11:35)*

View File

@ -60,4 +60,4 @@ try {
} }
``` ```
*(generated by convert-ps2md.ps1 using the comment-based help of cd-onedrive.ps1 as of 09/20/2023 17:04:37)* *(generated by convert-ps2md.ps1 using the comment-based help of cd-onedrive.ps1 as of 10/19/2023 08:11:35)*

View File

@ -62,4 +62,4 @@ try {
} }
``` ```
*(generated by convert-ps2md.ps1 using the comment-based help of cd-pics.ps1 as of 09/20/2023 17:04:37)* *(generated by convert-ps2md.ps1 using the comment-based help of cd-pics.ps1 as of 10/19/2023 08:11:35)*

View File

@ -62,4 +62,4 @@ try {
} }
``` ```
*(generated by convert-ps2md.ps1 using the comment-based help of cd-public.ps1 as of 09/20/2023 17:04:37)* *(generated by convert-ps2md.ps1 using the comment-based help of cd-public.ps1 as of 10/19/2023 08:11:35)*

View File

@ -53,4 +53,4 @@ try {
} }
``` ```
*(generated by convert-ps2md.ps1 using the comment-based help of cd-recycle-bin.ps1 as of 09/20/2023 17:04:37)* *(generated by convert-ps2md.ps1 using the comment-based help of cd-recycle-bin.ps1 as of 10/19/2023 08:11:35)*

View File

@ -80,4 +80,4 @@ try {
} }
``` ```
*(generated by convert-ps2md.ps1 using the comment-based help of cd-repos.ps1 as of 09/20/2023 17:04:37)* *(generated by convert-ps2md.ps1 using the comment-based help of cd-repos.ps1 as of 10/19/2023 08:11:35)*

View File

@ -57,4 +57,4 @@ try {
} }
``` ```
*(generated by convert-ps2md.ps1 using the comment-based help of cd-root.ps1 as of 09/20/2023 17:04:37)* *(generated by convert-ps2md.ps1 using the comment-based help of cd-root.ps1 as of 10/19/2023 08:11:35)*

View File

@ -55,4 +55,4 @@ try {
} }
``` ```
*(generated by convert-ps2md.ps1 using the comment-based help of cd-screenshots.ps1 as of 09/20/2023 17:04:37)* *(generated by convert-ps2md.ps1 using the comment-based help of cd-screenshots.ps1 as of 10/19/2023 08:11:35)*

View File

@ -58,4 +58,4 @@ try {
} }
``` ```
*(generated by convert-ps2md.ps1 using the comment-based help of cd-scripts.ps1 as of 09/20/2023 17:04:37)* *(generated by convert-ps2md.ps1 using the comment-based help of cd-scripts.ps1 as of 10/19/2023 08:11:35)*

View File

@ -58,4 +58,4 @@ try {
} }
``` ```
*(generated by convert-ps2md.ps1 using the comment-based help of cd-ssh.ps1 as of 09/20/2023 17:04:37)* *(generated by convert-ps2md.ps1 using the comment-based help of cd-ssh.ps1 as of 10/19/2023 08:11:35)*

View File

@ -50,4 +50,4 @@ try {
} }
``` ```
*(generated by convert-ps2md.ps1 using the comment-based help of cd-temp.ps1 as of 09/20/2023 17:04:37)* *(generated by convert-ps2md.ps1 using the comment-based help of cd-temp.ps1 as of 10/19/2023 08:11:35)*

View File

@ -62,4 +62,4 @@ try {
} }
``` ```
*(generated by convert-ps2md.ps1 using the comment-based help of cd-templates.ps1 as of 09/20/2023 17:04:37)* *(generated by convert-ps2md.ps1 using the comment-based help of cd-templates.ps1 as of 10/19/2023 08:11:35)*

View File

@ -53,4 +53,4 @@ try {
} }
``` ```
*(generated by convert-ps2md.ps1 using the comment-based help of cd-trash.ps1 as of 09/20/2023 17:04:37)* *(generated by convert-ps2md.ps1 using the comment-based help of cd-trash.ps1 as of 10/19/2023 08:11:35)*

View File

@ -58,4 +58,4 @@ try {
} }
``` ```
*(generated by convert-ps2md.ps1 using the comment-based help of cd-up.ps1 as of 09/20/2023 17:04:37)* *(generated by convert-ps2md.ps1 using the comment-based help of cd-up.ps1 as of 10/19/2023 08:11:35)*

View File

@ -58,4 +58,4 @@ try {
} }
``` ```
*(generated by convert-ps2md.ps1 using the comment-based help of cd-up2.ps1 as of 09/20/2023 17:04:37)* *(generated by convert-ps2md.ps1 using the comment-based help of cd-up2.ps1 as of 10/19/2023 08:11:35)*

View File

@ -58,4 +58,4 @@ try {
} }
``` ```
*(generated by convert-ps2md.ps1 using the comment-based help of cd-up3.ps1 as of 09/20/2023 17:04:37)* *(generated by convert-ps2md.ps1 using the comment-based help of cd-up3.ps1 as of 10/19/2023 08:11:35)*

View File

@ -58,4 +58,4 @@ try {
} }
``` ```
*(generated by convert-ps2md.ps1 using the comment-based help of cd-up4.ps1 as of 09/20/2023 17:04:37)* *(generated by convert-ps2md.ps1 using the comment-based help of cd-up4.ps1 as of 10/19/2023 08:11:35)*

View File

@ -58,4 +58,4 @@ try {
} }
``` ```
*(generated by convert-ps2md.ps1 using the comment-based help of cd-users.ps1 as of 09/20/2023 17:04:37)* *(generated by convert-ps2md.ps1 using the comment-based help of cd-users.ps1 as of 10/19/2023 08:11:35)*

View File

@ -62,4 +62,4 @@ try {
} }
``` ```
*(generated by convert-ps2md.ps1 using the comment-based help of cd-videos.ps1 as of 09/20/2023 17:04:37)* *(generated by convert-ps2md.ps1 using the comment-based help of cd-videos.ps1 as of 10/19/2023 08:11:35)*

View File

@ -58,4 +58,4 @@ try {
} }
``` ```
*(generated by convert-ps2md.ps1 using the comment-based help of cd-windows.ps1 as of 09/20/2023 17:04:37)* *(generated by convert-ps2md.ps1 using the comment-based help of cd-windows.ps1 as of 10/19/2023 08:11:35)*

View File

@ -79,4 +79,4 @@ try {
} }
``` ```
*(generated by convert-ps2md.ps1 using the comment-based help of change-wallpaper.ps1 as of 09/20/2023 17:04:37)* *(generated by convert-ps2md.ps1 using the comment-based help of change-wallpaper.ps1 as of 10/19/2023 08:11:35)*

70
Docs/check-admin.md Normal file
View File

@ -0,0 +1,70 @@
*check-admin.ps1*
================
This PowerShell script checks if the user has administrator rights.
Parameters
----------
```powershell
PS> ./check-admin.ps1 [<CommonParameters>]
[<CommonParameters>]
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,
WarningVariable, OutBuffer, PipelineVariable, and OutVariable.
```
Example
-------
```powershell
PS> ./check-admin.ps1
✅ Yes
```
Notes
-----
Author: Markus Fleschutz | License: CC0
Related Links
-------------
https://github.com/fleschutz/PowerShell
Script Content
--------------
```powershell
<#
.SYNOPSIS
Check for admin rights
.DESCRIPTION
This PowerShell script checks if the user has administrator rights.
.EXAMPLE
PS> ./check-admin.ps1
✅ Yes
.LINK
https://github.com/fleschutz/PowerShell
.NOTES
Author: Markus Fleschutz | License: CC0
#>
try {
if ($IsLinux) {
# todo
} else {
$user = [Security.Principal.WindowsIdentity]::GetCurrent()
$principal = (New-Object Security.Principal.WindowsPrincipal $user)
if ($principal.IsInRole([Security.Principal.WindowsBuiltinRole]::Administrator)) {
"✅ Yes"
} elseif ($principal.IsInRole([Security.Principal.WindowsBuiltinRole]::Guest)) {
"⚠️ No, guest rights only"
} else {
"⚠️ No, normal user rights only"
}
}
exit 0 # success
} catch {
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}
```
*(generated by convert-ps2md.ps1 using the comment-based help of check-admin.ps1 as of 10/19/2023 08:11:35)*

View File

@ -75,4 +75,4 @@ try {
} }
``` ```
*(generated by convert-ps2md.ps1 using the comment-based help of check-apps.ps1 as of 09/20/2023 17:04:37)* *(generated by convert-ps2md.ps1 using the comment-based help of check-apps.ps1 as of 10/19/2023 08:11:35)*

View File

@ -76,4 +76,4 @@ try {
} }
``` ```
*(generated by convert-ps2md.ps1 using the comment-based help of check-bios.ps1 as of 09/20/2023 17:04:37)* *(generated by convert-ps2md.ps1 using the comment-based help of check-bios.ps1 as of 10/19/2023 08:11:35)*

View File

@ -21,31 +21,31 @@ Script Content
.SYNOPSIS .SYNOPSIS
Checks the CPU status Checks the CPU status
.DESCRIPTION .DESCRIPTION
This PowerShell script queries the CPU status and prints it (name, type, speed, temperature, etc). This PowerShell script queries the CPU status (name, type, speed, temperature, etc) and prints it.
.EXAMPLE .EXAMPLE
PS> ./check-cpu.ps1 PS> ./check-cpu.ps1
AMD Ryzen 5 5500U with Radeon Graphics (CPU0, 2100MHz, 31.3°C) Intel(R) Core(TM) i9-10900X CPU @ 3.70GHz (AMD64, 20 cores, CPU0, 3696MHz, CPU0 socket, 31.3°C)
.LINK .LINK
https://github.com/fleschutz/PowerShell https://github.com/fleschutz/PowerShell
.NOTES .NOTES
Author: Markus Fleschutz | License: CC0 Author: Markus Fleschutz | License: CC0
#> #>
function GetCPUTemperatureInCelsius { function GetProcessorTemperature {
$Temp = 99999.9 # unsupported $temp = 99999.9 # unsupported
if ($IsLinux) { if ($IsLinux) {
if (Test-Path "/sys/class/thermal/thermal_zone0/temp" -pathType leaf) { if (Test-Path "/sys/class/thermal/thermal_zone0/temp" -pathType leaf) {
[int]$IntTemp = Get-Content "/sys/class/thermal/thermal_zone0/temp" [int]$IntTemp = Get-Content "/sys/class/thermal/thermal_zone0/temp"
$Temp = [math]::round($IntTemp / 1000.0, 1) $temp = [math]::round($IntTemp / 1000.0, 1)
} }
} else { } else {
$Objects = Get-WmiObject -Query "SELECT * FROM Win32_PerfFormattedData_Counters_ThermalZoneInformation" -Namespace "root/CIMV2" $objects = Get-WmiObject -Query "SELECT * FROM Win32_PerfFormattedData_Counters_ThermalZoneInformation" -Namespace "root/CIMV2"
foreach ($Obj in $Objects) { foreach ($object in $objects) {
$HiPrec = $Obj.HighPrecisionTemperature $highPrec = $object.HighPrecisionTemperature
$Temp = [math]::round($HiPrec / 100.0, 1) $temp = [math]::round($highPrec / 100.0, 1)
} }
} }
return $Temp; return $temp
} }
function GetProcessorArchitecture { function GetProcessorArchitecture {
@ -63,39 +63,39 @@ function GetProcessorArchitecture {
} }
try { try {
Write-Progress "⏳ Querying CPU details..." Write-Progress "⏳ Querying CPU status... "
$Status = "✅" $status = "✅"
$Celsius = GetCPUTemperatureInCelsius $celsius = GetProcessorTemperature
if ($Celsius -eq 99999.9) { if ($celsius -eq 99999.9) {
$Temp = "no temp" $temp = "no temp"
} elseif ($Celsius -gt 50) { } elseif ($celsius -gt 50) {
$Temp = "$($Celsius)°C" $temp = "$($celsius)°C"
$Status = "⚠️" $status = "⚠️"
} elseif ($Celsius -lt 0) { } elseif ($celsius -lt 0) {
$Temp = "$($Celsius)°C" $temp = "$($celsius)°C"
$Status = "⚠️" $status = "⚠️"
} else { } else {
$Temp = "$($Celsius)°C" $temp = "$($celsius)°C"
} }
$Arch = GetProcessorArchitecture $arch = GetProcessorArchitecture
if ($IsLinux) { if ($IsLinux) {
$CPUName = "$Arch CPU" $cpuName = "$arch CPU"
$Arch = "" $arch = ""
$DeviceID = "" $deviceID = ""
$Speed = "" $speed = ""
$Socket = "" $socket = ""
} else { } else {
$Details = Get-WmiObject -Class Win32_Processor $details = Get-WmiObject -Class Win32_Processor
$CPUName = $Details.Name.trim() $cpuName = $details.Name.trim()
$Arch = "$Arch, " $arch = "$arch, "
$DeviceID = "$($Details.DeviceID), " $deviceID = "$($details.DeviceID), "
$Speed = "$($Details.MaxClockSpeed)MHz, " $speed = "$($details.MaxClockSpeed)MHz, "
$Socket = "$($Details.SocketDesignation) socket, " $socket = "$($details.SocketDesignation) socket, "
} }
$Cores = [System.Environment]::ProcessorCount $cores = [System.Environment]::ProcessorCount
Write-Progress -completed "done." Write-Progress -completed " "
Write-Host "$Status $CPUName ($($Arch)$Cores cores, $($DeviceID)$($Speed)$($Socket)$Temp)" Write-Host "$status $cpuName ($($arch)$cores cores, $($deviceID)$($speed)$($socket)$temp)"
exit 0 # success exit 0 # success
} catch { } catch {
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
@ -103,4 +103,4 @@ try {
} }
``` ```
*(generated by convert-ps2md.ps1 using the comment-based help of check-cpu.ps1 as of 09/20/2023 17:04:37)* *(generated by convert-ps2md.ps1 using the comment-based help of check-cpu.ps1 as of 10/19/2023 08:11:35)*

View File

@ -57,4 +57,4 @@ try {
} }
``` ```
*(generated by convert-ps2md.ps1 using the comment-based help of check-day.ps1 as of 09/20/2023 17:04:37)* *(generated by convert-ps2md.ps1 using the comment-based help of check-day.ps1 as of 10/19/2023 08:11:35)*

View File

@ -47,9 +47,9 @@ Script Content
#> #>
try { try {
Write-Progress "⏳ Measuring DNS resolution..."
$table = Import-CSV "$PSScriptRoot/../Data/popular-domains.csv" $table = Import-CSV "$PSScriptRoot/../Data/popular-domains.csv"
$numRows = $table.Length $numRows = $table.Length
Write-Progress "⏳ Resolving $numRows domain names..."
$stopWatch = [system.diagnostics.stopwatch]::startNew() $stopWatch = [system.diagnostics.stopwatch]::startNew()
if ($IsLinux) { if ($IsLinux) {
@ -57,13 +57,14 @@ try {
} else { } else {
foreach($row in $table){$nop=Resolve-DNSName $row.Domain} foreach($row in $table){$nop=Resolve-DNSName $row.Domain}
} }
Write-Progress -completed "."
[float]$elapsed = $stopWatch.Elapsed.TotalSeconds [float]$elapsed = $stopWatch.Elapsed.TotalSeconds
Write-Progress -completed " "
$average = [math]::round($numRows / $elapsed, 1) $average = [math]::round($numRows / $elapsed, 1)
if ($average -lt 10.0) { if ($average -lt 10.0) {
Write-Output "⚠️ DNS resolves $average domains per second only" Write-Host "⚠️ DNS resolves $average domains per second only"
} else { } else {
Write-Output "✅ DNS resolves $average domains per second" Write-Host "✅ DNS resolves $average domains per second"
} }
exit 0 # success exit 0 # success
} catch { } catch {
@ -72,4 +73,4 @@ try {
} }
``` ```
*(generated by convert-ps2md.ps1 using the comment-based help of check-dns.ps1 as of 09/20/2023 17:04:37)* *(generated by convert-ps2md.ps1 using the comment-based help of check-dns.ps1 as of 10/19/2023 08:11:35)*

View File

@ -91,4 +91,4 @@ try {
} }
``` ```
*(generated by convert-ps2md.ps1 using the comment-based help of check-drive-space.ps1 as of 09/20/2023 17:04:37)* *(generated by convert-ps2md.ps1 using the comment-based help of check-drive-space.ps1 as of 10/19/2023 08:11:35)*

View File

@ -26,8 +26,8 @@ Example
------- -------
```powershell ```powershell
PS> ./check-drives.ps1 PS> ./check-drives.ps1
✅ Drive C: uses 49% of 1TB, 512GB free ✅ Drive C: uses 49%, 512GB free of 1TB
✅ Drive D: uses 84% of 4TB, 641GB free ✅ Drive D: uses 84%, 641GB free of 4TB
``` ```
@ -51,8 +51,8 @@ Script Content
Specifies the minimum warning level (10 GB by default) Specifies the minimum warning level (10 GB by default)
.EXAMPLE .EXAMPLE
PS> ./check-drives.ps1 PS> ./check-drives.ps1
✅ Drive C: uses 49% of 1TB, 512GB free ✅ Drive C: uses 49%, 512GB free of 1TB
✅ Drive D: uses 84% of 4TB, 641GB free ✅ Drive D: uses 84%, 641GB free of 4TB
.LINK .LINK
https://github.com/fleschutz/PowerShell https://github.com/fleschutz/PowerShell
.NOTES .NOTES
@ -95,7 +95,7 @@ try {
Write-Host "⚠️ Drive $name with $(Bytes2String $total) is nearly full, $(Bytes2String $free) free" Write-Host "⚠️ Drive $name with $(Bytes2String $total) is nearly full, $(Bytes2String $free) free"
} else { } else {
[int]$percent = ($used * 100) / $total [int]$percent = ($used * 100) / $total
Write-Host "✅ Drive $name uses $percent% of $(Bytes2String $total), $(Bytes2String $free) free" Write-Host "✅ Drive $name uses $percent%, $(Bytes2String $free) free of $(Bytes2String $total)"
} }
} }
exit 0 # success exit 0 # success
@ -105,4 +105,4 @@ try {
} }
``` ```
*(generated by convert-ps2md.ps1 using the comment-based help of check-drives.ps1 as of 09/20/2023 17:04:37)* *(generated by convert-ps2md.ps1 using the comment-based help of check-drives.ps1 as of 10/19/2023 08:11:35)*

View File

@ -63,4 +63,4 @@ try {
} }
``` ```
*(generated by convert-ps2md.ps1 using the comment-based help of check-dusk.ps1 as of 09/20/2023 17:04:37)* *(generated by convert-ps2md.ps1 using the comment-based help of check-dusk.ps1 as of 10/19/2023 08:11:35)*

View File

@ -61,4 +61,4 @@ try {
} }
``` ```
*(generated by convert-ps2md.ps1 using the comment-based help of check-easter-sunday.ps1 as of 09/20/2023 17:04:37)* *(generated by convert-ps2md.ps1 using the comment-based help of check-easter-sunday.ps1 as of 10/19/2023 08:11:35)*

View File

@ -75,4 +75,4 @@ try {
} }
``` ```
*(generated by convert-ps2md.ps1 using the comment-based help of check-file-system.ps1 as of 09/20/2023 17:04:37)* *(generated by convert-ps2md.ps1 using the comment-based help of check-file-system.ps1 as of 10/19/2023 08:11:35)*

View File

@ -170,4 +170,4 @@ function Check-Header { param( $path )
Check-Header $Path Check-Header $Path
``` ```
*(generated by convert-ps2md.ps1 using the comment-based help of check-file.ps1 as of 09/20/2023 17:04:37)* *(generated by convert-ps2md.ps1 using the comment-based help of check-file.ps1 as of 10/19/2023 08:11:35)*

View File

@ -65,4 +65,4 @@ try {
} }
``` ```
*(generated by convert-ps2md.ps1 using the comment-based help of check-firewall.ps1 as of 09/20/2023 17:04:37)* *(generated by convert-ps2md.ps1 using the comment-based help of check-firewall.ps1 as of 10/19/2023 08:11:35)*

View File

@ -24,7 +24,7 @@ Script Content
This PowerShell script queries the GPU status and prints it. This PowerShell script queries the GPU status and prints it.
.EXAMPLE .EXAMPLE
PS> ./check-gpu.ps1 PS> ./check-gpu.ps1
✅ NVIDIA Quadro P400 GPU (2GB RAM, 3840x2160 pixels, 32 bit, 59 Hz, driver 31.0.15.1740, status OK) ✅ NVIDIA Quadro P400 GPU (2GB RAM, 3840x2160 pixels, 32-bit, 59Hz, driver 31.0.15.1740, status OK)
.LINK .LINK
https://github.com/fleschutz/PowerShell https://github.com/fleschutz/PowerShell
.NOTES .NOTES
@ -56,7 +56,7 @@ try {
$RefreshRate = $Details.CurrentRefreshRate $RefreshRate = $Details.CurrentRefreshRate
$DriverVersion = $Details.DriverVersion $DriverVersion = $Details.DriverVersion
$Status = $Details.Status $Status = $Details.Status
Write-Host "✅ $Model GPU ($(Bytes2String $RAMSize) RAM, $($ResWidth)x$($ResHeight) pixels, $BitsPerPixel bit, $RefreshRate Hz, driver $DriverVersion, status $Status)" Write-Host "✅ $Model GPU ($(Bytes2String $RAMSize) RAM, $($ResWidth)x$($ResHeight) pixels, $($BitsPerPixel)-bit, $($RefreshRate)Hz, driver $DriverVersion, status $Status)"
} }
exit 0 # success exit 0 # success
} catch { } catch {
@ -65,4 +65,4 @@ try {
} }
``` ```
*(generated by convert-ps2md.ps1 using the comment-based help of check-gpu.ps1 as of 09/20/2023 17:04:38)* *(generated by convert-ps2md.ps1 using the comment-based help of check-gpu.ps1 as of 10/19/2023 08:11:35)*

View File

@ -63,4 +63,4 @@ Script Content
exit 0 # success exit 0 # success
``` ```
*(generated by convert-ps2md.ps1 using the comment-based help of check-hardware.ps1 as of 09/20/2023 17:04:38)* *(generated by convert-ps2md.ps1 using the comment-based help of check-hardware.ps1 as of 10/19/2023 08:11:36)*

View File

@ -58,4 +58,4 @@ Script Content
exit 0 # success exit 0 # success
``` ```
*(generated by convert-ps2md.ps1 using the comment-based help of check-health.ps1 as of 09/20/2023 17:04:38)* *(generated by convert-ps2md.ps1 using the comment-based help of check-health.ps1 as of 10/19/2023 08:11:36)*

View File

@ -61,4 +61,4 @@ try {
} }
``` ```
*(generated by convert-ps2md.ps1 using the comment-based help of check-independence-day.ps1 as of 09/20/2023 17:04:38)* *(generated by convert-ps2md.ps1 using the comment-based help of check-independence-day.ps1 as of 10/19/2023 08:11:36)*

View File

@ -84,4 +84,4 @@ try {
} }
``` ```
*(generated by convert-ps2md.ps1 using the comment-based help of check-ipv4-address.ps1 as of 09/20/2023 17:04:38)* *(generated by convert-ps2md.ps1 using the comment-based help of check-ipv4-address.ps1 as of 10/19/2023 08:11:36)*

View File

@ -98,4 +98,4 @@ try {
} }
``` ```
*(generated by convert-ps2md.ps1 using the comment-based help of check-ipv6-address.ps1 as of 09/20/2023 17:04:38)* *(generated by convert-ps2md.ps1 using the comment-based help of check-ipv6-address.ps1 as of 10/19/2023 08:11:36)*

View File

@ -55,4 +55,4 @@ try {
} }
``` ```
*(generated by convert-ps2md.ps1 using the comment-based help of check-iss-position.ps1 as of 09/20/2023 17:04:38)* *(generated by convert-ps2md.ps1 using the comment-based help of check-iss-position.ps1 as of 10/19/2023 08:11:36)*

View File

@ -87,4 +87,4 @@ try {
} }
``` ```
*(generated by convert-ps2md.ps1 using the comment-based help of check-mac-address.ps1 as of 09/20/2023 17:04:38)* *(generated by convert-ps2md.ps1 using the comment-based help of check-mac-address.ps1 as of 10/19/2023 08:11:36)*

View File

@ -60,4 +60,4 @@ try {
} }
``` ```
*(generated by convert-ps2md.ps1 using the comment-based help of check-midnight.ps1 as of 09/20/2023 17:04:38)* *(generated by convert-ps2md.ps1 using the comment-based help of check-midnight.ps1 as of 10/19/2023 08:11:36)*

View File

@ -57,4 +57,4 @@ try {
} }
``` ```
*(generated by convert-ps2md.ps1 using the comment-based help of check-month.ps1 as of 09/20/2023 17:04:38)* *(generated by convert-ps2md.ps1 using the comment-based help of check-month.ps1 as of 10/19/2023 08:11:36)*

View File

@ -76,4 +76,4 @@ try {
} }
``` ```
*(generated by convert-ps2md.ps1 using the comment-based help of check-moon-phase.ps1 as of 09/20/2023 17:04:38)* *(generated by convert-ps2md.ps1 using the comment-based help of check-moon-phase.ps1 as of 10/19/2023 08:11:36)*

View File

@ -64,4 +64,4 @@ Script Content
exit 0 # success exit 0 # success
``` ```
*(generated by convert-ps2md.ps1 using the comment-based help of check-network.ps1 as of 09/20/2023 17:04:38)* *(generated by convert-ps2md.ps1 using the comment-based help of check-network.ps1 as of 10/19/2023 08:11:36)*

View File

@ -60,4 +60,4 @@ try {
} }
``` ```
*(generated by convert-ps2md.ps1 using the comment-based help of check-new-year.ps1 as of 09/20/2023 17:04:38)* *(generated by convert-ps2md.ps1 using the comment-based help of check-new-year.ps1 as of 10/19/2023 08:11:36)*

View File

@ -59,4 +59,4 @@ try {
} }
``` ```
*(generated by convert-ps2md.ps1 using the comment-based help of check-noon.ps1 as of 09/20/2023 17:04:38)* *(generated by convert-ps2md.ps1 using the comment-based help of check-noon.ps1 as of 10/19/2023 08:11:36)*

View File

@ -73,4 +73,4 @@ try {
} }
``` ```
*(generated by convert-ps2md.ps1 using the comment-based help of check-os.ps1 as of 09/20/2023 17:04:38)* *(generated by convert-ps2md.ps1 using the comment-based help of check-os.ps1 as of 10/19/2023 08:11:36)*

View File

@ -65,4 +65,4 @@ try {
} }
``` ```
*(generated by convert-ps2md.ps1 using the comment-based help of check-outlook.ps1 as of 09/20/2023 17:04:38)* *(generated by convert-ps2md.ps1 using the comment-based help of check-outlook.ps1 as of 10/19/2023 08:11:36)*

View File

@ -94,4 +94,4 @@ try {
} }
``` ```
*(generated by convert-ps2md.ps1 using the comment-based help of check-password.ps1 as of 09/20/2023 17:04:38)* *(generated by convert-ps2md.ps1 using the comment-based help of check-password.ps1 as of 10/19/2023 08:11:36)*

View File

@ -92,4 +92,4 @@ try {
} }
``` ```
*(generated by convert-ps2md.ps1 using the comment-based help of check-pending-reboot.ps1 as of 09/20/2023 17:04:38)* *(generated by convert-ps2md.ps1 using the comment-based help of check-pending-reboot.ps1 as of 10/19/2023 08:11:36)*

View File

@ -62,28 +62,26 @@ param([string]$hosts = "bing.com,cnn.com,dropbox.com,github.com,google.com,ibm.c
try { try {
$hostsArray = $hosts.Split(",") $hostsArray = $hosts.Split(",")
$parallelTasks = $hostsArray | foreach { $parallelTasks = $hostsArray | foreach {
(New-Object Net.NetworkInformation.Ping).SendPingAsync($_, 500) (New-Object Net.NetworkInformation.Ping).SendPingAsync($_,750)
} }
[int]$min = 9999999 [int]$min = 9999999
[int]$max = [int]$avg = [int]$successCount = [int]$lossCount = 0 [int]$max = [int]$avg = [int]$success = 0
[int]$totalCount = $hostsArray.Count [int]$total = $hostsArray.Count
[Threading.Tasks.Task]::WaitAll($parallelTasks) [Threading.Tasks.Task]::WaitAll($parallelTasks)
foreach($ping in $parallelTasks.Result) { foreach($ping in $parallelTasks.Result) {
if ($ping.Status -eq "Success") { if ($ping.Status -ne "Success") { continue }
[int]$latency = $ping.RoundtripTime $success++
if ($latency -lt $min) { $min = $latency } [int]$latency = $ping.RoundtripTime
if ($latency -gt $max) { $max = $latency } $avg += $latency
$avg += $latency if ($latency -lt $min) { $min = $latency }
$successCount++ if ($latency -gt $max) { $max = $latency }
} else {
$lossCount++
}
} }
if ($successCount -ne 0) { [int]$loss = $total - $success
$avg /= $successCount if ($success -ne 0) {
Write-Host "✅ Online with $($avg)ms latency average ($($min)ms...$($max)ms, $lossCount/$totalCount ping loss)" $avg /= $success
Write-Host "✅ Online with $($avg)ms latency average ($($min)ms...$($max)ms, $loss/$total ping loss)"
} else { } else {
Write-Host "⚠️ Offline ($lossCount/$totalCount ping loss)" Write-Host "⚠️ Offline ($loss/$total ping loss)"
} }
exit 0 # success exit 0 # success
} catch { } catch {
@ -92,4 +90,4 @@ try {
} }
``` ```
*(generated by convert-ps2md.ps1 using the comment-based help of check-ping.ps1 as of 09/20/2023 17:04:38)* *(generated by convert-ps2md.ps1 using the comment-based help of check-ping.ps1 as of 10/19/2023 08:11:36)*

View File

@ -17,7 +17,7 @@ Example
------- -------
```powershell ```powershell
PS> ./check-power.ps1 PS> ./check-power.ps1
⚠️ Battery at 9% (54 min remaining) with power scheme: HP Optimized ⚠️ Battery at 9% · 54 min remaining · power scheme 'HP Optimized'
``` ```
@ -39,7 +39,7 @@ Script Content
This PowerShell script queries the power status and prints it. This PowerShell script queries the power status and prints it.
.EXAMPLE .EXAMPLE
PS> ./check-power.ps1 PS> ./check-power.ps1
⚠️ Battery at 9% (54 min remaining) with power scheme: HP Optimized ⚠️ Battery at 9% · 54 min remaining · power scheme 'HP Optimized'
.LINK .LINK
https://github.com/fleschutz/PowerShell https://github.com/fleschutz/PowerShell
.NOTES .NOTES
@ -48,41 +48,43 @@ Script Content
try { try {
if ($IsLinux) { if ($IsLinux) {
$Reply = "✅ AC powered" # TODO, just guessing :-) $reply = "✅ AC powered" # TODO, just guessing :-)
} else { } else {
Add-Type -Assembly System.Windows.Forms Add-Type -Assembly System.Windows.Forms
$Details = [System.Windows.Forms.SystemInformation]::PowerStatus $details = [System.Windows.Forms.SystemInformation]::PowerStatus
[int]$Percent = 100 * $Details.BatteryLifePercent [int]$percent = 100 * $details.BatteryLifePercent
[int]$Remaining = $Details.BatteryLifeRemaining / 60 [int]$remaining = $details.BatteryLifeRemaining / 60
if ($Details.PowerLineStatus -eq "Online") { if ($details.PowerLineStatus -eq "Online") {
if ($Details.BatteryChargeStatus -eq "NoSystemBattery") { if ($details.BatteryChargeStatus -eq "NoSystemBattery") {
$Reply = "✅ AC powered" $reply = "✅ AC powered"
} elseif ($Percent -ge 95) { } elseif ($percent -ge 95) {
$Reply = "✅ Battery fully charged ($Percent%)" $reply = "✅ Battery $percent% fully charged"
} else { } else {
$Reply = "✅ Battery charging... ($Percent%)" $reply = "✅ Battery charging... ($percent%)"
} }
} else { # must be offline } else { # must be offline
if ($Remaining -eq 0) { if (($remaining -eq 0) -and ($percent -ge 60)) {
$Reply = "✅ Battery at $Percent%" $reply = "✅ Battery $percent% full"
} elseif ($Remaining -le 5) { } elseif ($remaining -eq 0) {
$Reply = "⚠️ Battery at $Percent%, ONLY $Remaining MIN remaining" $reply = "✅ Battery at $percent%"
} elseif ($Remaining -le 30) { } elseif ($remaining -le 5) {
$Reply = "⚠️ Battery at $Percent%, only $Remaining min remaining" $reply = "⚠️ Battery at $percent% · ONLY $($remaining)min remaining"
} elseif ($Percent -lt 10) { } elseif ($remaining -le 30) {
$Reply = "⚠️ Battery at $Percent% with $Remaining min remaining" $reply = "⚠️ Battery at $percent% · only $($remaining)min remaining"
} elseif ($Percent -ge 80) { } elseif ($percent -lt 10) {
$Reply = "✅ Battery $Percent% full with $Remaining min remaining" $reply = "⚠️ Battery at $percent% · $($remaining)min remaining"
} elseif ($percent -ge 60) {
$reply = "✅ Battery $percent% full · $($remaining)min remaining"
} else { } else {
$Reply = "✅ Battery at $Percent% with $Remaining min remaining" $reply = "✅ Battery at $percent% · $($remaining)min remaining"
} }
} }
$PowerScheme = (powercfg /getactivescheme) $powerScheme = (powercfg /getactivescheme)
$PowerScheme = $PowerScheme -Replace "^(.*) \(","" $powerScheme = $powerScheme -Replace "^(.*) \(",""
$PowerScheme = $PowerScheme -Replace "\)$","" $powerScheme = $powerScheme -Replace "\)$",""
$Reply += ", power scheme is '$PowerScheme'" $reply += " · power scheme '$powerScheme'"
} }
Write-Output $Reply Write-Output $reply
exit 0 # success exit 0 # success
} catch { } catch {
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
@ -90,4 +92,4 @@ try {
} }
``` ```
*(generated by convert-ps2md.ps1 using the comment-based help of check-power.ps1 as of 09/20/2023 17:04:38)* *(generated by convert-ps2md.ps1 using the comment-based help of check-power.ps1 as of 10/19/2023 08:11:36)*

View File

@ -64,4 +64,4 @@ try {
} }
``` ```
*(generated by convert-ps2md.ps1 using the comment-based help of check-powershell.ps1 as of 09/20/2023 17:04:38)* *(generated by convert-ps2md.ps1 using the comment-based help of check-powershell.ps1 as of 10/19/2023 08:11:36)*

View File

@ -76,4 +76,4 @@ try {
} }
``` ```
*(generated by convert-ps2md.ps1 using the comment-based help of check-ps1-file.ps1 as of 09/20/2023 17:04:38)* *(generated by convert-ps2md.ps1 using the comment-based help of check-ps1-file.ps1 as of 10/19/2023 08:11:36)*

View File

@ -98,4 +98,4 @@ try {
} }
``` ```
*(generated by convert-ps2md.ps1 using the comment-based help of check-ram.ps1 as of 09/20/2023 17:04:38)* *(generated by convert-ps2md.ps1 using the comment-based help of check-ram.ps1 as of 10/19/2023 08:11:36)*

View File

@ -128,4 +128,4 @@ try {
} }
``` ```
*(generated by convert-ps2md.ps1 using the comment-based help of check-repo.ps1 as of 09/20/2023 17:04:38)* *(generated by convert-ps2md.ps1 using the comment-based help of check-repo.ps1 as of 10/19/2023 08:11:36)*

View File

@ -56,4 +56,4 @@ try {
} }
``` ```
*(generated by convert-ps2md.ps1 using the comment-based help of check-santa.ps1 as of 09/20/2023 17:04:38)* *(generated by convert-ps2md.ps1 using the comment-based help of check-santa.ps1 as of 10/19/2023 08:11:36)*

View File

@ -95,4 +95,4 @@ try {
} }
``` ```
*(generated by convert-ps2md.ps1 using the comment-based help of check-smart-devices.ps1 as of 09/20/2023 17:04:38)* *(generated by convert-ps2md.ps1 using the comment-based help of check-smart-devices.ps1 as of 10/19/2023 08:11:36)*

View File

@ -1,7 +1,7 @@
*check-software.ps1* *check-software.ps1*
================ ================
This PowerShell script queries the software details of the local computer and prints it. This PowerShell script queries the software status of the local computer and prints it.
Parameters Parameters
---------- ----------
@ -42,7 +42,7 @@ Script Content
.SYNOPSIS .SYNOPSIS
Checks the software Checks the software
.DESCRIPTION .DESCRIPTION
This PowerShell script queries the software details of the local computer and prints it. This PowerShell script queries the software status of the local computer and prints it.
.EXAMPLE .EXAMPLE
PS> ./check-software.ps1 PS> ./check-software.ps1
@ -60,13 +60,13 @@ Script Content
& "$PSScriptRoot/write-green.ps1" " S O F T W A R E" & "$PSScriptRoot/write-green.ps1" " S O F T W A R E"
& "$PSScriptRoot/check-bios.ps1" & "$PSScriptRoot/check-bios.ps1"
& "$PSScriptRoot/check-os.ps1" & "$PSScriptRoot/check-os.ps1"
& "$PSScriptRoot/check-uptime.ps1"
& "$PSScriptRoot/check-apps.ps1" & "$PSScriptRoot/check-apps.ps1"
& "$PSScriptRoot/check-powershell.ps1" & "$PSScriptRoot/check-powershell.ps1"
& "$PSScriptRoot/check-uptime.ps1"
& "$PSScriptRoot/check-time-zone.ps1" & "$PSScriptRoot/check-time-zone.ps1"
& "$PSScriptRoot/check-swap-space.ps1" & "$PSScriptRoot/check-swap-space.ps1"
& "$PSScriptRoot/check-pending-reboot.ps1" & "$PSScriptRoot/check-pending-reboot.ps1"
exit 0 # success exit 0 # success
``` ```
*(generated by convert-ps2md.ps1 using the comment-based help of check-software.ps1 as of 09/20/2023 17:04:38)* *(generated by convert-ps2md.ps1 using the comment-based help of check-software.ps1 as of 10/19/2023 08:11:36)*

View File

@ -84,4 +84,4 @@ try {
} }
``` ```
*(generated by convert-ps2md.ps1 using the comment-based help of check-subnet-mask.ps1 as of 09/20/2023 17:04:38)* *(generated by convert-ps2md.ps1 using the comment-based help of check-subnet-mask.ps1 as of 10/19/2023 08:11:36)*

View File

@ -1,7 +1,7 @@
*check-swap-space.ps1* *check-swap-space.ps1*
================ ================
This PowerShell script queries the status of the swap space and prints it. This PowerShell script queries the current status of the swap space and prints it.
Parameters Parameters
---------- ----------
@ -26,7 +26,7 @@ Example
------- -------
```powershell ```powershell
PS> ./check-swap-space.ps1 PS> ./check-swap-space.ps1
✅ Swap space uses 42% of 1GB, 748MB free ✅ Swap space uses 42%, 748MB free of 1GB
``` ```
@ -43,14 +43,14 @@ Script Content
```powershell ```powershell
<# <#
.SYNOPSIS .SYNOPSIS
Checks the swap space status Checks the swap space
.DESCRIPTION .DESCRIPTION
This PowerShell script queries the status of the swap space and prints it. This PowerShell script queries the current status of the swap space and prints it.
.PARAMETER minLevel .PARAMETER minLevel
Specifies the minimum level in GB (10 GB by default) Specifies the minimum level in GB (10 GB by default)
.EXAMPLE .EXAMPLE
PS> ./check-swap-space.ps1 PS> ./check-swap-space.ps1
✅ Swap space uses 42% of 1GB, 748MB free ✅ Swap space uses 42%, 748MB free of 1GB
.LINK .LINK
https://github.com/fleschutz/PowerShell https://github.com/fleschutz/PowerShell
.NOTES .NOTES
@ -96,7 +96,7 @@ try {
Write-Output "✅ Swap space of $(MB2String $Total) reserved" Write-Output "✅ Swap space of $(MB2String $Total) reserved"
} else { } else {
[int]$Percent = ($Used * 100) / $Total [int]$Percent = ($Used * 100) / $Total
Write-Output "✅ Swap space uses $Percent% of $(MB2String $Total), $(MB2String $Free) free" Write-Output "✅ Swap space uses $Percent%, $(MB2String $Free) free of $(MB2String $Total)"
} }
exit 0 # success exit 0 # success
} catch { } catch {
@ -105,4 +105,4 @@ try {
} }
``` ```
*(generated by convert-ps2md.ps1 using the comment-based help of check-swap-space.ps1 as of 09/20/2023 17:04:38)* *(generated by convert-ps2md.ps1 using the comment-based help of check-swap-space.ps1 as of 10/19/2023 08:11:36)*

View File

@ -100,4 +100,4 @@ try {
} }
``` ```
*(generated by convert-ps2md.ps1 using the comment-based help of check-symlinks.ps1 as of 09/20/2023 17:04:38)* *(generated by convert-ps2md.ps1 using the comment-based help of check-symlinks.ps1 as of 10/19/2023 08:11:36)*

View File

@ -65,4 +65,4 @@ try {
} }
``` ```
*(generated by convert-ps2md.ps1 using the comment-based help of check-time-zone.ps1 as of 09/20/2023 17:04:38)* *(generated by convert-ps2md.ps1 using the comment-based help of check-time-zone.ps1 as of 10/19/2023 08:11:36)*

View File

@ -1,34 +1,19 @@
*check-uptime.ps1* *check-uptime.ps1*
================ ================
This PowerShell script queries the computer's uptime and prints it. check-uptime.ps1
Parameters Parameters
---------- ----------
```powershell ```powershell
PS> ./check-uptime.ps1 [<CommonParameters>]
[<CommonParameters>] [<CommonParameters>]
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,
WarningVariable, OutBuffer, PipelineVariable, and OutVariable. WarningVariable, OutBuffer, PipelineVariable, and OutVariable.
``` ```
Example
-------
```powershell
PS> ./check-uptime.ps1
✅ Up for 2 days, 20 hours, 10 minutes
```
Notes
-----
Author: Markus Fleschutz | License: CC0
Related Links
-------------
https://github.com/fleschutz/PowerShell
Script Content Script Content
-------------- --------------
```powershell ```powershell
@ -36,7 +21,7 @@ Script Content
.SYNOPSIS .SYNOPSIS
Checks the uptime Checks the uptime
.DESCRIPTION .DESCRIPTION
This PowerShell script queries the computer's uptime and prints it. This PowerShell script queries the computer's uptime (time between now and last boot up time) and prints it.
.EXAMPLE .EXAMPLE
PS> ./check-uptime.ps1 PS> ./check-uptime.ps1
✅ Up for 2 days, 20 hours, 10 minutes ✅ Up for 2 days, 20 hours, 10 minutes
@ -46,35 +31,29 @@ Script Content
Author: Markus Fleschutz | License: CC0 Author: Markus Fleschutz | License: CC0
#> #>
function TimeSpan2String([TimeSpan]$uptime)
{
[int]$days = $uptime.Days
[int]$hours = $days * 24 + $uptime.Hours
if ($days -gt 2) {
return "$days days"
} elseif ($hours -gt 1) {
return "$hours hours"
} else {
return "$($uptime.Minutes)min"
}
}
try { try {
if ($IsLinux) { if ($IsLinux) {
$Uptime = (Get-Uptime) $uptime = (Get-Uptime)
Write-Host "✅ Up for $(TimeSpan2String $uptime)"
} else { } else {
$BootTime = Get-WinEvent -ProviderName eventlog | Where-Object {$_.Id -eq 6005} | Select-Object TimeCreated -First 1 [system.threading.thread]::currentthread.currentculture = [system.globalization.cultureinfo]"en-US"
$Uptime = New-TimeSpan -Start $BootTime.TimeCreated.Date -End (Get-Date) $lastBootTime = (Get-CimInstance Win32_OperatingSystem).LastBootUpTime
$uptime = New-TimeSpan -Start $lastBootTime -End (Get-Date)
Write-Host "✅ Up for $(TimeSpan2String $uptime) since $($lastBootTime.ToShortDateString())"
} }
$Reply = "✅ Up for "
$Days = $Uptime.Days
if ($Days -eq "1") {
$Reply += "1 day, "
} elseif ($Days -ne "0") {
$Reply += "$Days days, "
}
$Hours = $Uptime.Hours
if ($Hours -eq "1") {
$Reply += "1 hour, "
} elseif ($Hours -ne "0") {
$Reply += "$Hours hours, "
}
$Minutes = $Uptime.Minutes
if ($Minutes -eq "1") {
$Reply += "1 minute"
} else {
$Reply += "$Minutes minutes"
}
Write-Host $Reply
exit 0 # success exit 0 # success
} catch { } catch {
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
@ -82,4 +61,4 @@ try {
} }
``` ```
*(generated by convert-ps2md.ps1 using the comment-based help of check-uptime.ps1 as of 09/20/2023 17:04:38)* *(generated by convert-ps2md.ps1 using the comment-based help of check-uptime.ps1 as of 10/19/2023 08:11:36)*

View File

@ -65,4 +65,4 @@ try {
} }
``` ```
*(generated by convert-ps2md.ps1 using the comment-based help of check-vpn.ps1 as of 09/20/2023 17:04:38)* *(generated by convert-ps2md.ps1 using the comment-based help of check-vpn.ps1 as of 10/19/2023 08:11:36)*

View File

@ -81,4 +81,4 @@ try {
} }
``` ```
*(generated by convert-ps2md.ps1 using the comment-based help of check-weather.ps1 as of 09/20/2023 17:04:38)* *(generated by convert-ps2md.ps1 using the comment-based help of check-weather.ps1 as of 10/19/2023 08:11:36)*

View File

@ -54,4 +54,4 @@ try {
} }
``` ```
*(generated by convert-ps2md.ps1 using the comment-based help of check-week.ps1 as of 09/20/2023 17:04:38)* *(generated by convert-ps2md.ps1 using the comment-based help of check-week.ps1 as of 10/19/2023 08:11:36)*

View File

@ -72,4 +72,4 @@ try {
} }
``` ```
*(generated by convert-ps2md.ps1 using the comment-based help of check-wind.ps1 as of 09/20/2023 17:04:38)* *(generated by convert-ps2md.ps1 using the comment-based help of check-wind.ps1 as of 10/19/2023 08:11:36)*

View File

@ -60,4 +60,4 @@ try {
} }
``` ```
*(generated by convert-ps2md.ps1 using the comment-based help of check-windows-system-files.ps1 as of 09/20/2023 17:04:38)* *(generated by convert-ps2md.ps1 using the comment-based help of check-windows-system-files.ps1 as of 10/19/2023 08:11:36)*

View File

@ -88,4 +88,4 @@ try {
} }
``` ```
*(generated by convert-ps2md.ps1 using the comment-based help of check-xml-file.ps1 as of 09/20/2023 17:04:38)* *(generated by convert-ps2md.ps1 using the comment-based help of check-xml-file.ps1 as of 10/19/2023 08:11:36)*

View File

@ -101,4 +101,4 @@ try {
} }
``` ```
*(generated by convert-ps2md.ps1 using the comment-based help of clean-repo.ps1 as of 09/20/2023 17:04:38)* *(generated by convert-ps2md.ps1 using the comment-based help of clean-repo.ps1 as of 10/19/2023 08:11:36)*

View File

@ -6,10 +6,10 @@ This PowerShell script cleans all Git repositories in a folder from untracked fi
Parameters Parameters
---------- ----------
```powershell ```powershell
PS> ./clean-repos.ps1 [[-ParentDir] <String>] [<CommonParameters>] PS> ./clean-repos.ps1 [[-parentDir] <String>] [<CommonParameters>]
-ParentDir <String> -parentDir <String>
Specifies the path to the parent folder Specifies the path to the parent folder (current working dir by default)
Required? false Required? false
Position? 1 Position? 1
@ -25,7 +25,11 @@ PS> ./clean-repos.ps1 [[-ParentDir] <String>] [<CommonParameters>]
Example Example
------- -------
```powershell ```powershell
PS> ./clean-repos C:\MyRepos PS> ./clean-repos.ps1 C:\MyRepos
⏳ (1) Searching for Git executable... git version 2.40.1
⏳ (2) Checking parent folder 📂Repos... 28 subfolders found
⏳ (3/30) Cleaning 📂base256unicode...
...
``` ```
@ -45,46 +49,50 @@ Script Content
Cleans all Git repositories in a folder from untracked files Cleans all Git repositories in a folder from untracked files
.DESCRIPTION .DESCRIPTION
This PowerShell script cleans all Git repositories in a folder from untracked files (including submodules). This PowerShell script cleans all Git repositories in a folder from untracked files (including submodules).
.PARAMETER ParentDir .PARAMETER parentDir
Specifies the path to the parent folder Specifies the path to the parent folder (current working dir by default)
.EXAMPLE .EXAMPLE
PS> ./clean-repos C:\MyRepos PS> ./clean-repos.ps1 C:\MyRepos
⏳ (1) Searching for Git executable... git version 2.40.1
⏳ (2) Checking parent folder 📂Repos... 28 subfolders found
⏳ (3/30) Cleaning 📂base256unicode...
...
.LINK .LINK
https://github.com/fleschutz/PowerShell https://github.com/fleschutz/PowerShell
.NOTES .NOTES
Author: Markus Fleschutz | License: CC0 Author: Markus Fleschutz | License: CC0
#> #>
param([string]$ParentDir = "$PWD") param([string]$parentDir = "$PWD")
try { try {
$StopWatch = [system.diagnostics.stopwatch]::startNew() $stopWatch = [system.diagnostics.stopwatch]::startNew()
Write-Host "⏳ (1) Searching for Git executable... " -noNewline Write-Host "⏳ (1) Searching for Git executable... " -noNewline
& git --version & git --version
if ($lastExitCode -ne "0") { throw "Can't execute 'git' - make sure Git is installed and available" } if ($lastExitCode -ne "0") { throw "Can't execute 'git' - make sure Git is installed and available" }
$ParentDirName = (Get-Item "$ParentDir").Name $parentDirName = (Get-Item "$ParentDir").Name
Write-Host "⏳ (2) Checking parent folder 📂$ParentDirName... " -noNewline Write-Host "⏳ (2) Checking parent folder 📂$parentDirName... " -noNewline
if (-not(Test-Path "$ParentDir" -pathType container)) { throw "Can't access folder: $ParentDir" } if (-not(Test-Path "$ParentDir" -pathType container)) { throw "Can't access folder: $ParentDir" }
$Folders = (Get-ChildItem "$ParentDir" -attributes Directory) $folders = (Get-ChildItem "$ParentDir" -attributes Directory)
$NumFolders = $Folders.Count $numFolders = $folders.Count
Write-Host "$NumFolders subfolders found" Write-Host "$numFolders subfolders found"
[int]$Step = 2 [int]$Step = 2
foreach ($Folder in $Folders) { foreach ($folder in $folders) {
$FolderName = (Get-Item "$Folder").Name $FolderName = (Get-Item "$folder").Name
$Step++ $Step++
"⏳ ($Step/$($NumFolders + 2)) Cleaning 📂$FolderName..." "⏳ ($Step/$($numFolders + 2)) Cleaning 📂$FolderName..."
& git -C "$Folder" clean -xfd -f # force + recurse into dirs + don't use the standard ignore rules & git -C "$folder" clean -xfd -f # force + recurse into dirs + don't use the standard ignore rules
if ($lastExitCode -ne "0") { throw "'git clean -xfd -f' failed with exit code $lastExitCode" } if ($lastExitCode -ne "0") { throw "'git clean -xfd -f' failed with exit code $lastExitCode" }
& git -C "$Folder" submodule foreach --recursive git clean -xfd -f & git -C "$folder" submodule foreach --recursive git clean -xfd -f
if ($lastExitCode -ne "0") { throw "'git clean -xfd -f' in submodules failed with exit code $lastExitCode" } if ($lastExitCode -ne "0") { throw "'git clean -xfd -f' in submodules failed with exit code $lastExitCode" }
} }
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds [int]$elapsed = $stopWatch.Elapsed.TotalSeconds
"✔️ cleaned $NumFolders Git repositories at 📂$ParentDirName in $Elapsed sec." "✔️ Cleaned $numFolders Git repos under 📂$parentDirName in $elapsed sec"
exit 0 # success exit 0 # success
} catch { } catch {
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
@ -92,4 +100,4 @@ try {
} }
``` ```
*(generated by convert-ps2md.ps1 using the comment-based help of clean-repos.ps1 as of 09/20/2023 17:04:38)* *(generated by convert-ps2md.ps1 using the comment-based help of clean-repos.ps1 as of 10/19/2023 08:11:36)*

View File

@ -60,4 +60,4 @@ try {
} }
``` ```
*(generated by convert-ps2md.ps1 using the comment-based help of clear-dns-cache.ps1 as of 09/20/2023 17:04:38)* *(generated by convert-ps2md.ps1 using the comment-based help of clear-dns-cache.ps1 as of 10/19/2023 08:11:36)*

View File

@ -58,4 +58,4 @@ try {
} }
``` ```
*(generated by convert-ps2md.ps1 using the comment-based help of clear-recycle-bin.ps1 as of 09/20/2023 17:04:38)* *(generated by convert-ps2md.ps1 using the comment-based help of clear-recycle-bin.ps1 as of 10/19/2023 08:11:36)*

View File

@ -119,4 +119,4 @@ try {
} }
``` ```
*(generated by convert-ps2md.ps1 using the comment-based help of clone-repos.ps1 as of 09/20/2023 17:04:38)* *(generated by convert-ps2md.ps1 using the comment-based help of clone-repos.ps1 as of 10/19/2023 08:11:36)*

View File

@ -48,4 +48,4 @@ Stop-Process -name "CalculatorApp"
exit 0 # success exit 0 # success
``` ```
*(generated by convert-ps2md.ps1 using the comment-based help of close-calculator.ps1 as of 09/20/2023 17:04:38)* *(generated by convert-ps2md.ps1 using the comment-based help of close-calculator.ps1 as of 10/19/2023 08:11:36)*

View File

@ -48,4 +48,4 @@ Script Content
exit 0 # success exit 0 # success
``` ```
*(generated by convert-ps2md.ps1 using the comment-based help of close-chrome.ps1 as of 09/20/2023 17:04:38)* *(generated by convert-ps2md.ps1 using the comment-based help of close-chrome.ps1 as of 10/19/2023 08:11:36)*

View File

@ -48,4 +48,4 @@ Script Content
exit 0 # success exit 0 # success
``` ```
*(generated by convert-ps2md.ps1 using the comment-based help of close-cortana.ps1 as of 09/20/2023 17:04:38)* *(generated by convert-ps2md.ps1 using the comment-based help of close-cortana.ps1 as of 10/19/2023 08:11:36)*

View File

@ -52,4 +52,4 @@ if ($lastExitCode -ne "0") {
exit 0 # success exit 0 # success
``` ```
*(generated by convert-ps2md.ps1 using the comment-based help of close-edge.ps1 as of 09/20/2023 17:04:38)* *(generated by convert-ps2md.ps1 using the comment-based help of close-edge.ps1 as of 10/19/2023 08:11:36)*

View File

@ -48,4 +48,4 @@ Script Content
exit 0 # success exit 0 # success
``` ```
*(generated by convert-ps2md.ps1 using the comment-based help of close-file-explorer.ps1 as of 09/20/2023 17:04:38)* *(generated by convert-ps2md.ps1 using the comment-based help of close-file-explorer.ps1 as of 10/19/2023 08:11:36)*

View File

@ -48,4 +48,4 @@ Script Content
exit 0 # success exit 0 # success
``` ```
*(generated by convert-ps2md.ps1 using the comment-based help of close-firefox.ps1 as of 09/20/2023 17:04:38)* *(generated by convert-ps2md.ps1 using the comment-based help of close-firefox.ps1 as of 10/19/2023 08:11:36)*

View File

@ -52,4 +52,4 @@ if ($lastExitCode -ne "0") {
exit 0 # success exit 0 # success
``` ```
*(generated by convert-ps2md.ps1 using the comment-based help of close-git-extensions.ps1 as of 09/20/2023 17:04:38)* *(generated by convert-ps2md.ps1 using the comment-based help of close-git-extensions.ps1 as of 10/19/2023 08:11:36)*

Some files were not shown because too many files have changed in this diff Show More