Update the manual pages

This commit is contained in:
Markus Fleschutz 2023-07-29 09:45:37 +02:00
parent 209fda3588
commit 46dae1445a
513 changed files with 1611 additions and 822 deletions

View File

@ -4,7 +4,7 @@ This PowerShell script adds firewall rules for the given executable. Administrat
## Parameters
```powershell
/home/mf/Repos/PowerShell/Scripts/add-firewall-rules.ps1 [[-PathToExecutables] <String>] [<CommonParameters>]
add-firewall-rules.ps1 [[-PathToExecutables] <String>] [<CommonParameters>]
-PathToExecutables <String>
Specifies the path to the executables

View File

@ -4,7 +4,7 @@ This PowerShell script saves the given memo text to Memos.csv in your home folde
## Parameters
```powershell
/home/mf/Repos/PowerShell/Scripts/add-memo.ps1 [[-text] <String>] [<CommonParameters>]
add-memo.ps1 [[-text] <String>] [<CommonParameters>]
-text <String>
Specifies the text to memorize

View File

@ -4,7 +4,7 @@ This PowerShell script handles and escalates the given alert message.
## Parameters
```powershell
/home/mf/Repos/PowerShell/Scripts/alert.ps1 [[-Message] <String>] [<CommonParameters>]
alert.ps1 [[-Message] <String>] [<CommonParameters>]
-Message <String>
Specifies the alert message

View File

@ -4,7 +4,7 @@ This PowerShell script builds a repository by supporting: cmake, configure, auto
## Parameters
```powershell
/home/mf/Repos/PowerShell/Scripts/build-repo.ps1 [[-RepoDir] <String>] [<CommonParameters>]
build-repo.ps1 [[-RepoDir] <String>] [<CommonParameters>]
-RepoDir <String>
Specifies the path to the Git repository

View File

@ -4,7 +4,7 @@ This PowerShell script builds all Git repositories in a folder.
## Parameters
```powershell
/home/mf/Repos/PowerShell/Scripts/build-repos.ps1 [[-ParentDir] <String>] [<CommonParameters>]
build-repos.ps1 [[-ParentDir] <String>] [<CommonParameters>]
-ParentDir <String>
Specifies the path to the parent folder

View File

@ -4,7 +4,7 @@ This PowerShell script changes the working directory to the user's autostart fol
## Parameters
```powershell
/home/mf/Repos/PowerShell/Scripts/cd-autostart.ps1 [<CommonParameters>]
cd-autostart.ps1 [<CommonParameters>]
[<CommonParameters>]
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,

View File

@ -4,7 +4,7 @@ This PowerShell script changes the working directory to the crash dumps director
## Parameters
```powershell
/home/mf/Repos/PowerShell/Scripts/cd-crashdumps.ps1 [<CommonParameters>]
cd-crashdumps.ps1 [<CommonParameters>]
[<CommonParameters>]
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,

View File

@ -4,7 +4,7 @@ This PowerShell script changes the working directory to the user's desktop folde
## Parameters
```powershell
/home/mf/Repos/PowerShell/Scripts/cd-desktop.ps1 [<CommonParameters>]
cd-desktop.ps1 [<CommonParameters>]
[<CommonParameters>]
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,

View File

@ -4,7 +4,7 @@ This PowerShell script changes the working directory to the documents folder.
## Parameters
```powershell
/home/mf/Repos/PowerShell/Scripts/cd-docs.ps1 [<CommonParameters>]
cd-docs.ps1 [<CommonParameters>]
[<CommonParameters>]
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,

View File

@ -4,7 +4,7 @@ This PowerShell script changes the working directory to the user's downloads fol
## Parameters
```powershell
/home/mf/Repos/PowerShell/Scripts/cd-downloads.ps1 [<CommonParameters>]
cd-downloads.ps1 [<CommonParameters>]
[<CommonParameters>]
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,

View File

@ -4,7 +4,7 @@ This PowerShell script changes the working directory to the user's Dropbox folde
## Parameters
```powershell
/home/mf/Repos/PowerShell/Scripts/cd-dropbox.ps1 [<CommonParameters>]
cd-dropbox.ps1 [<CommonParameters>]
[<CommonParameters>]
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,

61
Docs/cd-etc.md Normal file
View File

@ -0,0 +1,61 @@
## The *cd-etc.ps1* Script
This PowerShell script changes the working directory to the /etc directory.
## Parameters
```powershell
cd-etc.ps1 [<CommonParameters>]
[<CommonParameters>]
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,
WarningVariable, OutBuffer, PipelineVariable, and OutVariable.
```
## Example
```powershell
PS> ./cd-etc
📂C:\Windows\System32\drivers\etc
```
## Notes
Author: Markus Fleschutz | License: CC0
## Related Links
https://github.com/fleschutz/PowerShell
## Source Code
```powershell
<#
.SYNOPSIS
Changes to the /etc directory
.DESCRIPTION
This PowerShell script changes the working directory to the /etc directory.
.EXAMPLE
PS> ./cd-etc
📂C:\Windows\System32\drivers\etc
.LINK
https://github.com/fleschutz/PowerShell
.NOTES
Author: Markus Fleschutz | License: CC0
#>
try {
if ($IsLinx) {
$Path = "/etc"
} else {
$Path = Resolve-Path "$env:WINDIR\System32\drivers\etc"
}
if (-not(Test-Path "$Path" -pathType container)) {
throw "/etc directory at 📂$Path doesn't exist (yet)"
}
Set-Location "$Path"
"📂$Path"
exit 0 # success
} catch {
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}
```
*Generated by convert-ps2md.ps1 using the comment-based help of cd-etc.ps1*

View File

@ -4,7 +4,7 @@ This PowerShell script changes the working directory to the fonts folder.
## Parameters
```powershell
/home/mf/Repos/PowerShell/Scripts/cd-fonts.ps1 [<CommonParameters>]
cd-fonts.ps1 [<CommonParameters>]
[<CommonParameters>]
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,

View File

@ -4,7 +4,7 @@ This PowerShell script changes the working directory to the user's home director
## Parameters
```powershell
/home/mf/Repos/PowerShell/Scripts/cd-home.ps1 [<CommonParameters>]
cd-home.ps1 [<CommonParameters>]
[<CommonParameters>]
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,

48
Docs/cd-logs.md Normal file
View File

@ -0,0 +1,48 @@
## The *cd-logs.ps1* Script
cd-logs.ps1
## Parameters
```powershell
[<CommonParameters>]
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,
WarningVariable, OutBuffer, PipelineVariable, and OutVariable.
```
## Source Code
```powershell
<#
.SYNOPSIS
Sets the working directory to the logs folder
.DESCRIPTION
This PowerShell script changes the current working directory to the logs directory.
.EXAMPLE
PS> ./cd-logs
📂/var/logs
.LINK
https://github.com/fleschutz/PowerShell
.NOTES
Author: Markus Fleschutz | License: CC0
#>
function GetLogsDir {
if ($IsLinux) { return "/var/logs" }
$WinDir = [System.Environment]::GetFolderPath('Windows')
return "$WinDir\Logs"
}
try {
$Path = GetLogsDir
Set-Location "$Path"
"📂$Path"
exit 0 # success
} catch {
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}
```
*Generated by convert-ps2md.ps1 using the comment-based help of cd-logs.ps1*

View File

@ -4,7 +4,7 @@ This PowerShell script changes the working directory to the user's music folder.
## Parameters
```powershell
/home/mf/Repos/PowerShell/Scripts/cd-music.ps1 [<CommonParameters>]
cd-music.ps1 [<CommonParameters>]
[<CommonParameters>]
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,

View File

@ -4,7 +4,7 @@ This PowerShell script changes the working directory to the user's OneDrive fold
## Parameters
```powershell
/home/mf/Repos/PowerShell/Scripts/cd-onedrive.ps1 [<CommonParameters>]
cd-onedrive.ps1 [<CommonParameters>]
[<CommonParameters>]
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,

View File

@ -4,7 +4,7 @@ This PowerShell script changes the working directory to the user's pictures fold
## Parameters
```powershell
/home/mf/Repos/PowerShell/Scripts/cd-pics.ps1 [<CommonParameters>]
cd-pics.ps1 [<CommonParameters>]
[<CommonParameters>]
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,

View File

@ -4,7 +4,7 @@ This PowerShell script changes the working directory to the Public folder.
## Parameters
```powershell
/home/mf/Repos/PowerShell/Scripts/cd-public.ps1 [<CommonParameters>]
cd-public.ps1 [<CommonParameters>]
[<CommonParameters>]
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,

View File

@ -4,7 +4,7 @@ This PowerShell script changes the working directory to the user's Git repositor
## Parameters
```powershell
/home/mf/Repos/PowerShell/Scripts/cd-repos.ps1 [[-Subpath] <String>] [<CommonParameters>]
cd-repos.ps1 [[-Subpath] <String>] [<CommonParameters>]
-Subpath <String>
Specifies an additional relative subpath (optional)

View File

@ -4,7 +4,7 @@ This PowerShell script changes the current working directory to the root directo
## Parameters
```powershell
/home/mf/Repos/PowerShell/Scripts/cd-root.ps1 [<CommonParameters>]
cd-root.ps1 [<CommonParameters>]
[<CommonParameters>]
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,

View File

@ -4,7 +4,7 @@ This PowerShell script changes the working directory to the PowerShell scripts f
## Parameters
```powershell
/home/mf/Repos/PowerShell/Scripts/cd-scripts.ps1 [<CommonParameters>]
cd-scripts.ps1 [<CommonParameters>]
[<CommonParameters>]
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,

View File

@ -4,7 +4,7 @@ This PowerShell script changes the working directory to the user's SSH folder.
## Parameters
```powershell
/home/mf/Repos/PowerShell/Scripts/cd-ssh.ps1 [<CommonParameters>]
cd-ssh.ps1 [<CommonParameters>]
[<CommonParameters>]
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,

View File

@ -4,7 +4,7 @@ This PowerShell script changes the working directory to the templates folder.
## Parameters
```powershell
/home/mf/Repos/PowerShell/Scripts/cd-templates.ps1 [<CommonParameters>]
cd-templates.ps1 [<CommonParameters>]
[<CommonParameters>]
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,

View File

@ -4,7 +4,7 @@ This PowerShell script changes the working directory to one directory level up.
## Parameters
```powershell
/home/mf/Repos/PowerShell/Scripts/cd-up.ps1 [<CommonParameters>]
cd-up.ps1 [<CommonParameters>]
[<CommonParameters>]
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,

View File

@ -4,7 +4,7 @@ This PowerShell script changes the working directory to two directory level up.
## Parameters
```powershell
/home/mf/Repos/PowerShell/Scripts/cd-up2.ps1 [<CommonParameters>]
cd-up2.ps1 [<CommonParameters>]
[<CommonParameters>]
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,

View File

@ -4,7 +4,7 @@ This PowerShell script changes the working directory to three directory levels u
## Parameters
```powershell
/home/mf/Repos/PowerShell/Scripts/cd-up3.ps1 [<CommonParameters>]
cd-up3.ps1 [<CommonParameters>]
[<CommonParameters>]
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,

View File

@ -4,7 +4,7 @@ This PowerShell script changes the working directory to four directory levels up
## Parameters
```powershell
/home/mf/Repos/PowerShell/Scripts/cd-up4.ps1 [<CommonParameters>]
cd-up4.ps1 [<CommonParameters>]
[<CommonParameters>]
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,

View File

@ -4,7 +4,7 @@ This PowerShell script changes the working directory to the users directory.
## Parameters
```powershell
/home/mf/Repos/PowerShell/Scripts/cd-users.ps1 [<CommonParameters>]
cd-users.ps1 [<CommonParameters>]
[<CommonParameters>]
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,

View File

@ -4,7 +4,7 @@ This PowerShell script changes the working directory to the user's videos folder
## Parameters
```powershell
/home/mf/Repos/PowerShell/Scripts/cd-videos.ps1 [<CommonParameters>]
cd-videos.ps1 [<CommonParameters>]
[<CommonParameters>]
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,

View File

@ -4,7 +4,7 @@ This PowerShell script changes the working directory to the Windows directory.
## Parameters
```powershell
/home/mf/Repos/PowerShell/Scripts/cd-windows.ps1 [<CommonParameters>]
cd-windows.ps1 [<CommonParameters>]
[<CommonParameters>]
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,

View File

@ -4,7 +4,7 @@ This PowerShell script downloads a random photo from Unsplash and sets it as des
## Parameters
```powershell
/home/mf/Repos/PowerShell/Scripts/change-wallpaper.ps1 [[-Category] <String>] [<CommonParameters>]
change-wallpaper.ps1 [[-Category] <String>] [<CommonParameters>]
-Category <String>
Specifies the photo category (beach, city, ...)

View File

@ -4,7 +4,7 @@ This PowerShell script queries the application status and prints it.
## Parameters
```powershell
/home/mf/Repos/PowerShell/Scripts/check-apps.ps1 [<CommonParameters>]
check-apps.ps1 [<CommonParameters>]
[<CommonParameters>]
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,
@ -42,7 +42,8 @@ https://github.com/fleschutz/PowerShell
try {
if ($IsLinux) {
# TODO
$NumSnaps = (snap list).Count - 1
Write-Host "✅ $($NumSnaps) snaps installed"
} else {
Write-Progress "⏳ Querying installed apps and updates..."
$Apps = Get-AppxPackage

View File

@ -4,7 +4,7 @@ This PowerShell script queries the status of the system battery and prints it.
## Parameters
```powershell
/home/mf/Repos/PowerShell/Scripts/check-battery.ps1 [<CommonParameters>]
check-battery.ps1 [<CommonParameters>]
[<CommonParameters>]
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,

View File

@ -4,7 +4,7 @@ This PowerShell script queries the BIOS status and prints it.
## Parameters
```powershell
/home/mf/Repos/PowerShell/Scripts/check-bios.ps1 [<CommonParameters>]
check-bios.ps1 [<CommonParameters>]
[<CommonParameters>]
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,
@ -14,7 +14,7 @@ This PowerShell script queries the BIOS status and prints it.
## Example
```powershell
PS> ./check-bios
✅ BIOS F6 by American Megatrends Inc. (version ALASKA - 1072009, S/N NXA82EV0EBB0760)
✅ BIOS 'F6', release ALASKA - 1072009, S/N NXA82EV0EBB0760 by American Megatrends Inc.
```
@ -33,7 +33,7 @@ https://github.com/fleschutz/PowerShell
This PowerShell script queries the BIOS status and prints it.
.EXAMPLE
PS> ./check-bios
✅ BIOS F6 by American Megatrends Inc. (version ALASKA - 1072009, S/N NXA82EV0EBB0760)
✅ BIOS 'F6', release ALASKA - 1072009, S/N NXA82EV0EBB0760 by American Megatrends Inc.
.LINK
https://github.com/fleschutz/PowerShell
.NOTES
@ -52,14 +52,14 @@ try {
}
Write-Progress -completed "."
} else {
Write-Progress "⏳ Querying BIOS..."
# Write-Progress "⏳ Querying BIOS..."
$BIOS = Get-CimInstance -ClassName Win32_BIOS
$Model = $BIOS.Name.Trim()
$Manufacturer = $BIOS.Manufacturer.Trim()
$Serial = $BIOS.SerialNumber.Trim()
$Version = $BIOS.Version.Trim()
Write-Progress -completed "."
Write-Host "✅ BIOS $Model by $Manufacturer (version $Version, S/N $Serial)"
# Write-Progress -completed "."
Write-Host "✅ BIOS '$Model', release $Version, S/N $Serial by $Manufacturer"
}
exit 0 # success
} catch {

View File

@ -67,10 +67,10 @@ try {
$Temp = "no temp"
} elseif ($Celsius -gt 50) {
$Temp = "$($Celsius)°C"
$Status = "⚠"
$Status = "⚠"
} elseif ($Celsius -lt 0) {
$Temp = "$($Celsius)°C"
$Status = "⚠"
$Status = "⚠"
} else {
$Temp = "$($Celsius)°C"
}

View File

@ -4,7 +4,7 @@ This PowerShell script determines and speaks the current day by text-to-speech (
## Parameters
```powershell
/home/mf/Repos/PowerShell/Scripts/check-day.ps1 [<CommonParameters>]
check-day.ps1 [<CommonParameters>]
[<CommonParameters>]
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,

View File

@ -4,7 +4,7 @@ This PowerShell script measures and prints the DNS resolution speed by using 200
## Parameters
```powershell
/home/mf/Repos/PowerShell/Scripts/check-dns.ps1 [<CommonParameters>]
check-dns.ps1 [<CommonParameters>]
[<CommonParameters>]
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,

View File

@ -4,7 +4,7 @@ This PowerShell script checks a drive for free space left (20 GB by default).
## Parameters
```powershell
/home/mf/Repos/PowerShell/Scripts/check-drive-space.ps1 [[-Drive] <String>] [[-MinLevel] <Int32>] [<CommonParameters>]
check-drive-space.ps1 [[-Drive] <String>] [[-MinLevel] <Int32>] [<CommonParameters>]
-Drive <String>
Specifies the drive to check

View File

@ -4,7 +4,7 @@ This PowerShell script checks all drives for free space left.
## Parameters
```powershell
/home/mf/Repos/PowerShell/Scripts/check-drives.ps1 [[-MinLevel] <Int32>] [<CommonParameters>]
check-drives.ps1 [[-MinLevel] <Int32>] [<CommonParameters>]
-MinLevel <Int32>
Specifies the minimum warning level (10 GB by default)

View File

@ -4,7 +4,7 @@ This PowerShell script checks the time until Easter Sunday and replies by text-t
## Parameters
```powershell
/home/mf/Repos/PowerShell/Scripts/check-easter-sunday.ps1 [<CommonParameters>]
check-easter-sunday.ps1 [<CommonParameters>]
[<CommonParameters>]
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,

View File

@ -4,7 +4,7 @@ This PowerShell script checks the file system of a drive. It needs admin rights.
## Parameters
```powershell
/home/mf/Repos/PowerShell/Scripts/check-file-system.ps1 [[-Drive] <String>] [<CommonParameters>]
check-file-system.ps1 [[-Drive] <String>] [<CommonParameters>]
-Drive <String>
Specifies the drive to check

View File

@ -4,7 +4,7 @@ This PowerShell script determines and prints the file type of the given file.
## Parameters
```powershell
/home/mf/Repos/PowerShell/Scripts/check-file.ps1 [[-Path] <String>] [<CommonParameters>]
check-file.ps1 [[-Path] <String>] [<CommonParameters>]
-Path <String>
Specifies the path to the file

View File

@ -4,7 +4,7 @@ This PowerShell script queries the status of the firewall and prints it.
## Parameters
```powershell
/home/mf/Repos/PowerShell/Scripts/check-firewall.ps1 [<CommonParameters>]
check-firewall.ps1 [<CommonParameters>]
[<CommonParameters>]
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,

60
Docs/check-hardware.md Normal file
View File

@ -0,0 +1,60 @@
## The *check-hardware.ps1* Script
This PowerShell script queries the hardware details of the local computer and prints it.
## Parameters
```powershell
check-hardware.ps1 [<CommonParameters>]
[<CommonParameters>]
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,
WarningVariable, OutBuffer, PipelineVariable, and OutVariable.
```
## Example
```powershell
PS> ./check-hardware.ps1
H A R D W A R E
✅ Intel(R) Core(TM) i5-6400 CPU @ 2.70GHz (CPU0, 2701MHz, socket U3E1, 30.1°C)
...
```
## Notes
Author: Markus Fleschutz | License: CC0
## Related Links
https://github.com/fleschutz/PowerShell
## Source Code
```powershell
<#
.SYNOPSIS
Checks the hardware
.DESCRIPTION
This PowerShell script queries the hardware details of the local computer and prints it.
.EXAMPLE
PS> ./check-hardware.ps1
H A R D W A R E
✅ Intel(R) Core(TM) i5-6400 CPU @ 2.70GHz (CPU0, 2701MHz, socket U3E1, 30.1°C)
...
.LINK
https://github.com/fleschutz/PowerShell
.NOTES
Author: Markus Fleschutz | License: CC0
#>
" "
& "$PSScriptRoot/write-green.ps1" " H A R D W A R E"
& "$PSScriptRoot/check-cpu.ps1"
& "$PSScriptRoot/check-ram.ps1"
& "$PSScriptRoot/check-gpu.ps1"
& "$PSScriptRoot/check-smart-devices.ps1"
& "$PSScriptRoot/check-drives.ps1"
& "$PSScriptRoot/check-battery.ps1"
exit 0 # success
```
*Generated by convert-ps2md.ps1 using the comment-based help of check-hardware.ps1*

View File

@ -1,10 +1,10 @@
## The *check-health.ps1* Script
This PowerShell script checks and prints the system health of the local computer.
This PowerShell script queries the system health of the local computer (hardware, software, and network) and prints it.
## Parameters
```powershell
/home/mf/Repos/PowerShell/Scripts/check-health.ps1 [<CommonParameters>]
check-health.ps1 [<CommonParameters>]
[<CommonParameters>]
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,
@ -13,7 +13,8 @@ This PowerShell script checks and prints the system health of the local computer
## Example
```powershell
PS> ./check-health
PS> ./check-health.ps1
H A R D W A R E
✅ Intel(R) Core(TM) i5-6400 CPU @ 2.70GHz (CPU0, 2701MHz, socket U3E1, 30.1°C)
...
@ -32,9 +33,10 @@ https://github.com/fleschutz/PowerShell
.SYNOPSIS
Checks the system health
.DESCRIPTION
This PowerShell script checks and prints the system health of the local computer.
This PowerShell script queries the system health of the local computer (hardware, software, and network) and prints it.
.EXAMPLE
PS> ./check-health
PS> ./check-health.ps1
H A R D W A R E
✅ Intel(R) Core(TM) i5-6400 CPU @ 2.70GHz (CPU0, 2701MHz, socket U3E1, 30.1°C)
...
@ -44,30 +46,9 @@ https://github.com/fleschutz/PowerShell
Author: Markus Fleschutz | License: CC0
#>
" "
& "$PSScriptRoot/write-green.ps1" " H A R D W A R E"
& "$PSScriptRoot/check-cpu.ps1"
& "$PSScriptRoot/check-ram.ps1"
& "$PSScriptRoot/check-gpu.ps1"
& "$PSScriptRoot/check-smart-devices.ps1"
& "$PSScriptRoot/check-drives.ps1"
& "$PSScriptRoot/check-battery.ps1"
" "
& "$PSScriptRoot/write-green.ps1" " S O F T W A R E"
& "$PSScriptRoot/check-bios.ps1"
& "$PSScriptRoot/check-os.ps1"
& "$PSScriptRoot/check-powershell.ps1"
& "$PSScriptRoot/check-apps.ps1"
& "$PSScriptRoot/check-uptime.ps1"
& "$PSScriptRoot/check-time-zone.ps1"
& "$PSScriptRoot/check-swap-space.ps1"
& "$PSScriptRoot/check-pending-reboot.ps1"
" "
& "$PSScriptRoot/write-green.ps1" " N E T W O R K"
& "$PSScriptRoot/check-firewall"
& "$PSScriptRoot/check-ping.ps1"
& "$PSScriptRoot/check-dns.ps1"
& "$PSScriptRoot/check-vpn.ps1"
& "$PSScriptRoot/check-hardware.ps1"
& "$PSScriptRoot/check-software.ps1"
& "$PSScriptRoot/check-network.ps1"
exit 0 # success
```

View File

@ -4,7 +4,7 @@ This PowerShell script checks the time until Indepence Day and replies by text-t
## Parameters
```powershell
/home/mf/Repos/PowerShell/Scripts/check-independence-day.ps1 [<CommonParameters>]
check-independence-day.ps1 [<CommonParameters>]
[<CommonParameters>]
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,

View File

@ -4,7 +4,7 @@ This PowerShell script checks the given IPv4 address for validity.
## Parameters
```powershell
/home/mf/Repos/PowerShell/Scripts/check-ipv4-address.ps1 [[-Address] <String>] [<CommonParameters>]
check-ipv4-address.ps1 [[-Address] <String>] [<CommonParameters>]
-Address <String>
Specifies the IPv4 address to check

View File

@ -4,7 +4,7 @@ This PowerShell script checks the given IPv6 address for validity
## Parameters
```powershell
/home/mf/Repos/PowerShell/Scripts/check-ipv6-address.ps1 [[-Address] <String>] [<CommonParameters>]
check-ipv6-address.ps1 [[-Address] <String>] [<CommonParameters>]
-Address <String>
Specifies the IPv6 address to check

View File

@ -4,7 +4,7 @@ This PowerShell script queries the position of the International Space Station (
## Parameters
```powershell
/home/mf/Repos/PowerShell/Scripts/check-iss-position.ps1 [<CommonParameters>]
check-iss-position.ps1 [<CommonParameters>]
[<CommonParameters>]
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,

View File

@ -5,7 +5,7 @@ Supported MAC address formats are: 00:00:00:00:00:00 or 00-00-00-00-00-00 or 000
## Parameters
```powershell
/home/mf/Repos/PowerShell/Scripts/check-mac-address.ps1 [[-MAC] <String>] [<CommonParameters>]
check-mac-address.ps1 [[-MAC] <String>] [<CommonParameters>]
-MAC <String>
Specifies the MAC address to check

View File

@ -4,7 +4,7 @@ This PowerShell script determines and speaks the current month name by text-to-s
## Parameters
```powershell
/home/mf/Repos/PowerShell/Scripts/check-month.ps1 [<CommonParameters>]
check-month.ps1 [<CommonParameters>]
[<CommonParameters>]
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,

View File

@ -4,7 +4,7 @@ This PowerShell script determines the Moon phase and answers by text-to-speech (
## Parameters
```powershell
/home/mf/Repos/PowerShell/Scripts/check-moon-phase.ps1 [<CommonParameters>]
check-moon-phase.ps1 [<CommonParameters>]
[<CommonParameters>]
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,

60
Docs/check-network.md Normal file
View File

@ -0,0 +1,60 @@
## The *check-network.ps1* Script
This PowerShell script queries the network details of the local computer and prints it.
## Parameters
```powershell
check-network.ps1 [<CommonParameters>]
[<CommonParameters>]
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,
WarningVariable, OutBuffer, PipelineVariable, and OutVariable.
```
## Example
```powershell
PS> ./check-network.ps1
N E T W O R K
✅ Firewall enabled
...
```
## Notes
Author: Markus Fleschutz | License: CC0
## Related Links
https://github.com/fleschutz/PowerShell
## Source Code
```powershell
<#
.SYNOPSIS
Checks the network details
.DESCRIPTION
This PowerShell script queries the network details of the local computer and prints it.
.EXAMPLE
PS> ./check-network.ps1
N E T W O R K
✅ Firewall enabled
...
.LINK
https://github.com/fleschutz/PowerShell
.NOTES
Author: Markus Fleschutz | License: CC0
#>
" "
& "$PSScriptRoot/write-green.ps1" " N E T W O R K"
& "$PSScriptRoot/check-firewall"
& "$PSScriptRoot/check-ping.ps1"
& "$PSScriptRoot/check-dns.ps1"
& "$PSScriptRoot/check-vpn.ps1"
exit 0 # success
```
*Generated by convert-ps2md.ps1 using the comment-based help of check-network.ps1*

View File

@ -4,7 +4,7 @@ This PowerShell script checks the time until New Year and replies by text-to-spe
## Parameters
```powershell
/home/mf/Repos/PowerShell/Scripts/check-new-year.ps1 [<CommonParameters>]
check-new-year.ps1 [<CommonParameters>]
[<CommonParameters>]
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,

View File

@ -4,7 +4,7 @@ This PowerShell script queries the operating system status and prints it.
## Parameters
```powershell
/home/mf/Repos/PowerShell/Scripts/check-os.ps1 [<CommonParameters>]
check-os.ps1 [<CommonParameters>]
[<CommonParameters>]
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,

View File

@ -4,7 +4,7 @@ This PowerShell script checks the inbox of Outlook for new/unread mails.
## Parameters
```powershell
/home/mf/Repos/PowerShell/Scripts/check-outlook.ps1 [<CommonParameters>]
check-outlook.ps1 [<CommonParameters>]
[<CommonParameters>]
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,

View File

@ -4,7 +4,7 @@ This PowerShell script checks the security status of the given password by havei
## Parameters
```powershell
/home/mf/Repos/PowerShell/Scripts/check-password.ps1 [[-password] <String>] [<CommonParameters>]
check-password.ps1 [[-password] <String>] [<CommonParameters>]
-password <String>

View File

@ -18,7 +18,7 @@ check-pending-reboot.ps1
.SYNOPSIS
Check for pending reboots
.DESCRIPTION
This PowerShell script queries pending reboots and prints it.
This PowerShell script queries pending operating system reboots and prints it.
.EXAMPLE
./check-pending-reboot.ps1
.LINK
@ -40,23 +40,24 @@ try {
$Reason = ""
if ($IsLinux) {
if (Test-Path "/var/run/reboot-required") {
$Reason = "found /var/run/reboot-required"
$Reason = "found: /var/run/reboot-required"
Write-Host "⚠️ Pending reboot ($Reason)"
}
} else {
if (Test-Path -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\RebootRequired") {
$Reason += ", '...\WindowsUpdate\Auto Update\RebootRequired'"
$Reason += ", ...\Auto Update\RebootRequired"
}
if (Test-Path -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\PostRebootReporting") {
$Reason += ", '...\WindowsUpdate\Auto Update\PostRebootReporting'"
$Reason += ", ...\Auto Update\PostRebootReporting"
}
if (Test-Path -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\RebootPending") {
$Reason += ", '...\Component Based Servicing\RebootPending'"
$Reason += ", ...\Component Based Servicing\RebootPending"
}
if (Test-Path -Path "HKLM:\SOFTWARE\Microsoft\ServerManager\CurrentRebootAttempts") {
$Reason += ", '...\ServerManager\CurrentRebootAttempts'"
$Reason += ", ...\ServerManager\CurrentRebootAttempts"
}
if (Test-RegistryValue -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Component Based Servicing" -Value "RebootInProgress") {
$Reason += ", '...\CurrentVersion\Component Based Servicing' with 'RebootInProgress'"
$Reason += ", ...\CurrentVersion\Component Based Servicing with 'RebootInProgress'"
}
if (Test-RegistryValue -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Component Based Servicing" -Value "PackagesPending") {
$Reason += ", '...\CurrentVersion\Component Based Servicing' with 'PackagesPending'"
@ -73,10 +74,11 @@ try {
if (Test-RegistryValue -Path "HKLM:\SYSTEM\CurrentControlSet\Services\Netlogon" -Value "AvoidSpnSet") {
$Reason += ", '...\CurrentControlSet\Services\Netlogon' with 'AvoidSpnSet'"
}
if ($Reason -ne "") {
Write-Host "⚠️ Pending reboot (registry contains $($Reason.substring(2)))"
}
}
if ($Reason -ne "") {
Write-Host "⚠️ Pending reboot (found $($Reason.substring(2)) in registry)"
} else {
if ($Reason -eq "") {
Write-Host "✅ No pending reboot"
}
exit 0 # success

View File

@ -1,17 +1,17 @@
## The *check-ping.ps1* Script
This PowerShell script checks the ping latency from the local computer to 9 popular hosts.
This PowerShell script measures the ping roundtrip times from the local computer to 10 Internet servers.
## Parameters
```powershell
/home/mf/Repos/PowerShell/Scripts/check-ping.ps1 [[-hosts] <String>] [<CommonParameters>]
check-ping.ps1 [[-hosts] <String>] [<CommonParameters>]
-hosts <String>
Specifies the hosts to check, seperated by commata (default is: amazon.com,bing.com,cnn.com,dropbox.com,facebook.com,google.com,live.com,twitter.com,youtube.com)
Specifies the hosts to check, seperated by commata (default is: amazon.com,bing.com,cnn.com,dropbox.com,facebook.com,github.com,google.com,live.com,twitter.com,youtube.com)
Required? false
Position? 1
Default value amazon.com,bing.com,cnn.com,dropbox.com,facebook.com,google.com,live.com,twitter.com,youtube.com
Default value amazon.com,bing.com,cnn.com,dropbox.com,facebook.com,github.com,google.com,live.com,twitter.com,youtube.com
Accept pipeline input? false
Accept wildcard characters? false
@ -23,7 +23,7 @@ This PowerShell script checks the ping latency from the local computer to 9 popu
## Example
```powershell
PS> ./check-ping
✅ Ping latency is 13ms...109ms with 25ms average.
✅ Ping latency is 29ms average (13ms...109ms, 0 loss)
```
@ -39,37 +39,42 @@ https://github.com/fleschutz/PowerShell
.SYNOPSIS
Checks the ping latency
.DESCRIPTION
This PowerShell script checks the ping latency from the local computer to 9 popular hosts.
This PowerShell script measures the ping roundtrip times from the local computer to 10 Internet servers.
.PARAMETER hosts
Specifies the hosts to check, seperated by commata (default is: amazon.com,bing.com,cnn.com,dropbox.com,facebook.com,google.com,live.com,twitter.com,youtube.com)
Specifies the hosts to check, seperated by commata (default is: amazon.com,bing.com,cnn.com,dropbox.com,facebook.com,github.com,google.com,live.com,twitter.com,youtube.com)
.EXAMPLE
PS> ./check-ping
✅ Ping latency is 13ms...109ms with 25ms average.
✅ Ping latency is 29ms average (13ms...109ms, 0 loss)
.LINK
https://github.com/fleschutz/PowerShell
.NOTES
Author: Markus Fleschutz | License: CC0
#>
param([string]$hosts = "amazon.com,bing.com,cnn.com,dropbox.com,facebook.com,google.com,live.com,twitter.com,youtube.com")
param([string]$hosts = "amazon.com,bing.com,cnn.com,dropbox.com,facebook.com,github.com,google.com,live.com,twitter.com,youtube.com")
try {
Write-Progress "⏳ Sending a ping to 9 popular hosts..."
$HostsArray = $hosts.Split(",")
$Pings = Test-Connection -computerName $HostsArray -count 1
[int]$Min = 9999999
[int]$Max = [int]$Avg = 0
foreach($Ping in $Pings) {
if ($IsLinux) { [int]$Latency = $Ping.latency } else { [int]$Latency = $Ping.ResponseTime }
if ($Latency -lt $Min) { $Min = $Latency }
if ($Latency -gt $Max) { $Max = $Latency }
$Avg += $Latency
Write-Host "✅ Ping latency is" -noNewline
$hostsArray = $hosts.Split(",")
$t = $hostsArray | foreach {
(New-Object Net.NetworkInformation.Ping).SendPingAsync($_, 250)
}
$Avg /= $Pings.count
Write-Progress -Completed "."
Write-Host "✅ Ping latency is $($Min)ms...$($Max)ms with $($Avg)ms average"
[Threading.Tasks.Task]::WaitAll($t)
[int]$min = 9999999
[int]$max = [int]$avg = [int]$successCount = [int]$lossCount = 0
foreach($ping in $t.Result) {
if ($ping.Status -eq "Success") {
[int]$latency = $ping.RoundtripTime
if ($latency -lt $min) { $min = $Latency }
if ($latency -gt $max) { $max = $Latency }
$avg += $latency
$successCount++
} else {
$lossCount++
}
}
$avg /= $successCount
Write-Host " $($avg)ms average ($($min)ms...$($max)ms, $lossCount loss)"
exit 0 # success
} catch {
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"

View File

@ -4,7 +4,7 @@ This PowerShell script queries the PowerShell status and prints it.
## Parameters
```powershell
/home/mf/Repos/PowerShell/Scripts/check-powershell.ps1 [<CommonParameters>]
check-powershell.ps1 [<CommonParameters>]
[<CommonParameters>]
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,

View File

@ -1,10 +1,10 @@
## The *check-ps1-file.ps1* Script
This PowerShell script checks the given PowerShell file(s) for validity.
This PowerShell script checks the given PowerShell script file(s) for validity.
## Parameters
```powershell
/home/mf/Repos/PowerShell/Scripts/check-ps1-file.ps1 [[-filePattern] <String>] [<CommonParameters>]
check-ps1-file.ps1 [[-filePattern] <String>] [<CommonParameters>]
-filePattern <String>
Specifies the file pattern to the PowerShell file(s)
@ -39,7 +39,7 @@ https://github.com/fleschutz/PowerShell
.SYNOPSIS
Checks PowerShell file(s) for validity
.DESCRIPTION
This PowerShell script checks the given PowerShell file(s) for validity.
This PowerShell script checks the given PowerShell script file(s) for validity.
.PARAMETER filePattern
Specifies the file pattern to the PowerShell file(s)
.EXAMPLE
@ -55,13 +55,13 @@ param([string]$filePattern = "")
try {
if ($filePattern -eq "" ) { $path = Read-Host "Enter the file pattern to the PowerShell file(s)" }
$files = Get-ChildItem $filePattern
$files = Get-ChildItem -path "$filePattern" -attributes !Directory
foreach ($file in $files) {
$syntaxError = @()
[void][System.Management.Automation.Language.Parser]::ParseFile($file, [ref]$null, [ref]$syntaxError)
if ("$syntaxError" -ne "") { throw "$syntaxError" }
$basename = (Get-Item "$file").Basename
"✔️ Valid PowerShell in $basename"
"✔️ Valid PowerShell in $($file.Name)"
}
exit 0 # success
} catch {

View File

@ -4,10 +4,10 @@ This PowerShell script verifies the integrity of a local Git repository.
## Parameters
```powershell
/home/mf/Repos/PowerShell/Scripts/check-repo.ps1 [[-RepoDir] <String>] [<CommonParameters>]
check-repo.ps1 [[-RepoDir] <String>] [<CommonParameters>]
-RepoDir <String>
Specifies the path to the Git repository (current working dir by default)
Specifies the path to the Git repository (current working directory by default)
Required? false
Position? 1
@ -22,7 +22,15 @@ This PowerShell script verifies the integrity of a local Git repository.
## Example
```powershell
PS> ./check-repo C:\MyRepo
PS> ./check-repo.ps1 C:\MyRepo
⏳ (1/10) Searching for Git executable... git version 2.41.0.windows.3
⏳ (2/10) Checking local folder... 📂C:\MyRepo
⏳ (3/10) Querying remote URL... git@github.com:fleschutz/PowerShell.git
⏳ (4/10) Querying current branch... main
⏳ (5/10) Fetching remote updates...
⏳ (6/10) Querying latest tag... v0.8 (commit 02171a401d83b01a0cda0af426840b605e617f08)
⏳ (7/10) Verifying data integrity...
...
```
@ -40,9 +48,17 @@ https://github.com/fleschutz/PowerShell
.DESCRIPTION
This PowerShell script verifies the integrity of a local Git repository.
.PARAMETER RepoDir
Specifies the path to the Git repository (current working dir by default)
Specifies the path to the Git repository (current working directory by default)
.EXAMPLE
PS> ./check-repo C:\MyRepo
PS> ./check-repo.ps1 C:\MyRepo
⏳ (1/10) Searching for Git executable... git version 2.41.0.windows.3
⏳ (2/10) Checking local folder... 📂C:\MyRepo
⏳ (3/10) Querying remote URL... git@github.com:fleschutz/PowerShell.git
⏳ (4/10) Querying current branch... main
⏳ (5/10) Fetching remote updates...
⏳ (6/10) Querying latest tag... v0.8 (commit 02171a401d83b01a0cda0af426840b605e617f08)
⏳ (7/10) Verifying data integrity...
...
.LINK
https://github.com/fleschutz/PowerShell
.NOTES
@ -58,7 +74,7 @@ try {
& git --version
if ($lastExitCode -ne "0") { throw "Can't execute 'git' - make sure Git is installed and available" }
Write-Host "⏳ (2/10) Checking repository... " -noNewline
Write-Host "⏳ (2/10) Checking local folder... " -noNewline
$FullPath = Resolve-Path "$RepoDir"
if (!(Test-Path "$FullPath" -pathType Container)) { throw "Can't access folder: $FullPath" }
"📂$FullPath"
@ -71,9 +87,9 @@ try {
& git -C "$FullPath" branch --show-current
if ($lastExitCode -ne "0") { throw "'git branch --show-current' failed with exit code $lastExitCode" }
Write-Host "⏳ (5/10) Fetching updates..."
Write-Host "⏳ (5/10) Fetching remote updates..."
& git -C "$FullPath" fetch
if ($lastExitCode -ne "0") { throw "'git branch --show-current' failed with exit code $lastExitCode" }
if ($lastExitCode -ne "0") { throw "'git fetch' failed with exit code $lastExitCode" }
Write-Host "⏳ (6/10) Querying latest tag... " -noNewline
$LatestTagCommitID = (git -C "$FullPath" rev-list --tags --max-count=1)
@ -98,7 +114,7 @@ try {
$RepoDirName = (Get-Item "$FullPath").Name
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
"✔️ successfully checked repo 📂$RepoDirName in $Elapsed sec"
"✔️ checked Git repository 📂$RepoDirName in $Elapsed sec"
exit 0 # success
} catch {
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"

View File

@ -4,7 +4,7 @@ This PowerShell script checks the time until Saint Nicholas Day and replies by t
## Parameters
```powershell
/home/mf/Repos/PowerShell/Scripts/check-santa.ps1 [<CommonParameters>]
check-santa.ps1 [<CommonParameters>]
[<CommonParameters>]
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,

64
Docs/check-software.md Normal file
View File

@ -0,0 +1,64 @@
## The *check-software.ps1* Script
This PowerShell script queries the software details of the local computer and prints it.
## Parameters
```powershell
check-software.ps1 [<CommonParameters>]
[<CommonParameters>]
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,
WarningVariable, OutBuffer, PipelineVariable, and OutVariable.
```
## Example
```powershell
PS> ./check-software.ps1
S O F T W A R E
✅ BIOS 'P62 v02.67', release HPQOEM - 0, S/N CZC448B9C1 by HP
...
```
## Notes
Author: Markus Fleschutz | License: CC0
## Related Links
https://github.com/fleschutz/PowerShell
## Source Code
```powershell
<#
.SYNOPSIS
Checks the software
.DESCRIPTION
This PowerShell script queries the software details of the local computer and prints it.
.EXAMPLE
PS> ./check-software.ps1
S O F T W A R E
✅ BIOS 'P62 v02.67', release HPQOEM - 0, S/N CZC448B9C1 by HP
...
.LINK
https://github.com/fleschutz/PowerShell
.NOTES
Author: Markus Fleschutz | License: CC0
#>
" "
& "$PSScriptRoot/write-green.ps1" " S O F T W A R E"
& "$PSScriptRoot/check-bios.ps1"
& "$PSScriptRoot/check-os.ps1"
& "$PSScriptRoot/check-powershell.ps1"
& "$PSScriptRoot/check-apps.ps1"
& "$PSScriptRoot/check-uptime.ps1"
& "$PSScriptRoot/check-time-zone.ps1"
& "$PSScriptRoot/check-swap-space.ps1"
& "$PSScriptRoot/check-pending-reboot.ps1"
exit 0 # success
```
*Generated by convert-ps2md.ps1 using the comment-based help of check-software.ps1*

View File

@ -4,7 +4,7 @@ This PowerShell script checks the given subnet mask for validity.
## Parameters
```powershell
/home/mf/Repos/PowerShell/Scripts/check-subnet-mask.ps1 [[-address] <String>] [<CommonParameters>]
check-subnet-mask.ps1 [[-address] <String>] [<CommonParameters>]
-address <String>
Specifies the subnet mask to check

View File

@ -4,7 +4,7 @@ This PowerShell script queries the status of the swap space and prints it.
## Parameters
```powershell
/home/mf/Repos/PowerShell/Scripts/check-swap-space.ps1 [[-MinLevel] <Int32>] [<CommonParameters>]
check-swap-space.ps1 [[-MinLevel] <Int32>] [<CommonParameters>]
-MinLevel <Int32>
Specifies the minimum level (10 GB by default)

View File

@ -5,7 +5,7 @@ It returns the number of broken symlinks as exit value.
## Parameters
```powershell
/home/mf/Repos/PowerShell/Scripts/check-symlinks.ps1 [[-Folder] <String>] [<CommonParameters>]
check-symlinks.ps1 [[-Folder] <String>] [<CommonParameters>]
-Folder <String>
Specifies the path to the folder

View File

@ -4,7 +4,7 @@ This PowerShell script queries the time zone and prints it.
## Parameters
```powershell
/home/mf/Repos/PowerShell/Scripts/check-time-zone.ps1 [<CommonParameters>]
check-time-zone.ps1 [<CommonParameters>]
[<CommonParameters>]
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,
@ -14,7 +14,7 @@ This PowerShell script queries the time zone and prints it.
## Example
```powershell
PS> ./check-time-zone
✅ 11:13 AM (UTC + 01:00:00 W. Europe Standard Time + 01:00:00 daylight saving time)
✅ 11:13 AM W. Europe Summer Time (UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna (+01:00 DST)
```
@ -33,7 +33,7 @@ https://github.com/fleschutz/PowerShell
This PowerShell script queries the time zone and prints it.
.EXAMPLE
PS> ./check-time-zone
✅ 11:13 AM (UTC + 01:00:00 W. Europe Standard Time + 01:00:00 daylight saving time)
✅ 11:13 AM W. Europe Summer Time (UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna (+01:00 DST)
.LINK
https://github.com/fleschutz/PowerShell
.NOTES
@ -44,8 +44,14 @@ try {
[system.threading.thread]::currentThread.currentCulture = [system.globalization.cultureInfo]"en-US"
$Time = $((Get-Date).ToShortTimeString())
$TZ = (Get-Timezone)
if ($TZ.SupportsDaylightSavingTime) { $DST="+ 01:00:00 daylight saving time" } else { $DST="" }
Write-Host "✅ $Time (UTC + $($TZ.BaseUtcOffset) $($TZ.Id) $DST)"
if ($TZ.SupportsDaylightSavingTime) {
$TZName = $TZ.DaylightName
$DST=" (+01:00 DST)"
} else {
$TZName = $TZ.StandardName
$DST=""
}
Write-Host "✅ $Time $TZName $($TZ.DisplayName)$($DST)"
exit 0 # success
} catch {
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"

View File

@ -4,7 +4,7 @@ This PowerShell script queries the computer's uptime and prints it.
## Parameters
```powershell
/home/mf/Repos/PowerShell/Scripts/check-uptime.ps1 [<CommonParameters>]
check-uptime.ps1 [<CommonParameters>]
[<CommonParameters>]
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,

View File

@ -1,10 +1,10 @@
## The *check-vpn.ps1* Script
This PowerShell script queries the status of the VPN connections and prints it.
This PowerShell script queries and prints the status of the VPN connection(s).
## Parameters
```powershell
/home/mf/Repos/PowerShell/Scripts/check-vpn.ps1 [<CommonParameters>]
check-vpn.ps1 [<CommonParameters>]
[<CommonParameters>]
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,
@ -13,8 +13,8 @@ This PowerShell script queries the status of the VPN connections and prints it.
## Example
```powershell
PS> ./check-vpn
Disconnected VPN 'NASA L2TP'
PS> ./check-vpn.ps1
VPN to NASA L2TP is disconnected
```
@ -30,10 +30,10 @@ https://github.com/fleschutz/PowerShell
.SYNOPSIS
Checks the VPN status
.DESCRIPTION
This PowerShell script queries the status of the VPN connections and prints it.
This PowerShell script queries and prints the status of the VPN connection(s).
.EXAMPLE
PS> ./check-vpn
Disconnected VPN 'NASA L2TP'
PS> ./check-vpn.ps1
VPN to NASA L2TP is disconnected
.LINK
https://github.com/fleschutz/PowerShell
.NOTES
@ -47,11 +47,11 @@ try {
} else {
$Connections = Get-VPNConnection
foreach($Connection in $Connections) {
"✅ $($Connection.ConnectionStatus) VPN '$($Connection.Name)'"
Write-Host "✅ VPN to $($Connection.Name) is $($Connection.ConnectionStatus.ToLower())"
$NoVPN = $false
}
}
if ($NoVPN) { "⚠️ No VPN" }
if ($NoVPN) { Write-Host "⚠️ No VPN configured" }
exit 0 # success
} catch {
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"

View File

@ -4,7 +4,7 @@ This PowerShell script checks the current weather report.
## Parameters
```powershell
/home/mf/Repos/PowerShell/Scripts/check-weather.ps1 [[-location] <String>] [<CommonParameters>]
check-weather.ps1 [[-location] <String>] [<CommonParameters>]
-location <String>
Specifies the location to use (determined automatically per default)

View File

@ -4,7 +4,7 @@ This PowerShell script determines and speaks the current week number by text-to-
## Parameters
```powershell
/home/mf/Repos/PowerShell/Scripts/check-week.ps1 [<CommonParameters>]
check-week.ps1 [<CommonParameters>]
[<CommonParameters>]
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,

View File

@ -4,7 +4,7 @@ This PowerShell script determines the current wind conditions and replies by tex
## Parameters
```powershell
/home/mf/Repos/PowerShell/Scripts/check-wind.ps1 [[-location] <String>] [<CommonParameters>]
check-wind.ps1 [[-location] <String>] [<CommonParameters>]
-location <String>
Specifies the location to use (determined automatically per default)

View File

@ -4,7 +4,7 @@ This PowerShell script checks the validity of the Windows system files. It requi
## Parameters
```powershell
/home/mf/Repos/PowerShell/Scripts/check-windows-system-files.ps1 [<CommonParameters>]
check-windows-system-files.ps1 [<CommonParameters>]
[<CommonParameters>]
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,

View File

@ -4,7 +4,7 @@ This PowerShell script checks the given XML file for validity.
## Parameters
```powershell
/home/mf/Repos/PowerShell/Scripts/check-xml-file.ps1 [[-file] <String>] [<CommonParameters>]
check-xml-file.ps1 [[-file] <String>] [<CommonParameters>]
-file <String>
Specifies the path to the XML file to check

View File

@ -5,7 +5,7 @@ NOTE: To be used with care! This cannot be undone!
## Parameters
```powershell
/home/mf/Repos/PowerShell/Scripts/clean-repo.ps1 [[-RepoDir] <String>] [<CommonParameters>]
clean-repo.ps1 [[-RepoDir] <String>] [<CommonParameters>]
-RepoDir <String>
Specifies the file path to the local Git repository
@ -56,15 +56,15 @@ param([string]$RepoDir = "$PWD")
try {
$StopWatch = [system.diagnostics.stopwatch]::startNew()
Write-Host "⏳ (1/4) Searching for Git executable... " -noNewline
Write-Host "⏳ (1/4) Searching for Git executable... " -noNewline
& git --version
if ($lastExitCode -ne "0") { throw "Can't execute 'git' - make sure Git is installed and available" }
"⏳ (2/4) Checking repository... 📂$RepoDir"
"⏳ (2/4) Checking local repository... 📂$RepoDir"
if (-not(Test-Path "$RepoDir" -pathType container)) { throw "Can't access folder '$RepoDir' - maybe a typo or missing folder permissions?" }
$RepoDirName = (Get-Item "$RepoDir").Name
"⏳ (3/4) Removing repo's untracked files..."
"⏳ (3/4) Removing untracked files in repository..."
& git -C "$RepoDir" clean -xfd -f # to delete all untracked files in the main repo
if ($lastExitCode -ne "0") {
Write-Warning "'git clean' failed with exit code $lastExitCode, retrying once..."
@ -72,7 +72,7 @@ try {
if ($lastExitCode -ne "0") { throw "'git clean' failed with exit code $lastExitCode" }
}
"⏳ (4/4) Removing submodules' untracked files..."
"⏳ (4/4) Removing untracked files in submodules..."
& git -C "$RepoDir" submodule foreach --recursive git clean -xfd -f # to delete all untracked files in the submodules
if ($lastExitCode -ne "0") { throw "'git clean' in the submodules failed with exit code $lastExitCode" }

View File

@ -4,7 +4,7 @@ This PowerShell script cleans all Git repositories in a folder from untracked fi
## Parameters
```powershell
/home/mf/Repos/PowerShell/Scripts/clean-repos.ps1 [[-ParentDir] <String>] [<CommonParameters>]
clean-repos.ps1 [[-ParentDir] <String>] [<CommonParameters>]
-ParentDir <String>
Specifies the path to the parent folder

View File

@ -4,7 +4,7 @@ This PowerShell script clears the DNS client cache of the local computer.
## Parameters
```powershell
/home/mf/Repos/PowerShell/Scripts/clear-dns-cache.ps1 [<CommonParameters>]
clear-dns-cache.ps1 [<CommonParameters>]
[<CommonParameters>]
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,

View File

@ -5,7 +5,7 @@ IMPORTANT NOTE: this cannot be undo!
## Parameters
```powershell
/home/mf/Repos/PowerShell/Scripts/clear-recycle-bin.ps1 [<CommonParameters>]
clear-recycle-bin.ps1 [<CommonParameters>]
[<CommonParameters>]
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,

View File

@ -4,7 +4,7 @@ This PowerShell script clones popular Git repositories into a target directory.
## Parameters
```powershell
/home/mf/Repos/PowerShell/Scripts/clone-repos.ps1 [[-TargetDir] <String>] [<CommonParameters>]
clone-repos.ps1 [[-TargetDir] <String>] [<CommonParameters>]
-TargetDir <String>
Specifies the file path to the target directory (current working directory by default)

View File

@ -4,7 +4,7 @@ This PowerShell script closes the calculator application gracefully.
## Parameters
```powershell
/home/mf/Repos/PowerShell/Scripts/close-calculator.ps1 [<CommonParameters>]
close-calculator.ps1 [<CommonParameters>]
[<CommonParameters>]
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,

View File

@ -4,7 +4,7 @@ This PowerShell script closes the Google Chrome Web browser gracefully.
## Parameters
```powershell
/home/mf/Repos/PowerShell/Scripts/close-chrome.ps1 [<CommonParameters>]
close-chrome.ps1 [<CommonParameters>]
[<CommonParameters>]
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,

View File

@ -4,7 +4,7 @@ This PowerShell script closes Microsoft's Cortana application gracefully.
## Parameters
```powershell
/home/mf/Repos/PowerShell/Scripts/close-cortana.ps1 [<CommonParameters>]
close-cortana.ps1 [<CommonParameters>]
[<CommonParameters>]
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,

View File

@ -4,7 +4,7 @@ This PowerShell script closes the Microsoft Edge Web browser gracefully.
## Parameters
```powershell
/home/mf/Repos/PowerShell/Scripts/close-edge.ps1 [<CommonParameters>]
close-edge.ps1 [<CommonParameters>]
[<CommonParameters>]
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,

View File

@ -4,7 +4,7 @@ This PowerShell script closes the Microsoft File Explorer application gracefully
## Parameters
```powershell
/home/mf/Repos/PowerShell/Scripts/close-file-explorer.ps1 [<CommonParameters>]
close-file-explorer.ps1 [<CommonParameters>]
[<CommonParameters>]
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,

View File

@ -4,7 +4,7 @@ This PowerShell script closes the Mozilla Firefox Web browser gracefully.
## Parameters
```powershell
/home/mf/Repos/PowerShell/Scripts/close-firefox.ps1 [<CommonParameters>]
close-firefox.ps1 [<CommonParameters>]
[<CommonParameters>]
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,

View File

@ -4,7 +4,7 @@ This PowerShell script closes the Git Extensions application gracefully.
## Parameters
```powershell
/home/mf/Repos/PowerShell/Scripts/close-git-extensions.ps1 [<CommonParameters>]
close-git-extensions.ps1 [<CommonParameters>]
[<CommonParameters>]
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,

View File

@ -4,7 +4,7 @@ This PowerShell script closes the Windows Screen Magnifier application gracefull
## Parameters
```powershell
/home/mf/Repos/PowerShell/Scripts/close-magnifier.ps1 [<CommonParameters>]
close-magnifier.ps1 [<CommonParameters>]
[<CommonParameters>]
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,

View File

@ -4,7 +4,7 @@ This PowerShell script closes the Microsoft Paint application gracefully.
## Parameters
```powershell
/home/mf/Repos/PowerShell/Scripts/close-microsoft-paint.ps1 [<CommonParameters>]
close-microsoft-paint.ps1 [<CommonParameters>]
[<CommonParameters>]
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,

View File

@ -4,7 +4,7 @@ This PowerShell script closes the Microsoft Store application gracefully.
## Parameters
```powershell
/home/mf/Repos/PowerShell/Scripts/close-microsoft-store.ps1 [<CommonParameters>]
close-microsoft-store.ps1 [<CommonParameters>]
[<CommonParameters>]
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,

View File

@ -4,7 +4,7 @@ This PowerShell script closes the Netflix application gracefully.
## Parameters
```powershell
/home/mf/Repos/PowerShell/Scripts/close-netflix.ps1 [<CommonParameters>]
close-netflix.ps1 [<CommonParameters>]
[<CommonParameters>]
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,

View File

@ -4,7 +4,7 @@ This PowerShell script closes the Notepad application gracefully.
## Parameters
```powershell
/home/mf/Repos/PowerShell/Scripts/close-note-pad.ps1 [<CommonParameters>]
close-note-pad.ps1 [<CommonParameters>]
[<CommonParameters>]
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,

View File

@ -4,7 +4,7 @@ This PowerShell script closes the OBS Studio application gracefully.
## Parameters
```powershell
/home/mf/Repos/PowerShell/Scripts/close-obs-studio.ps1 [<CommonParameters>]
close-obs-studio.ps1 [<CommonParameters>]
[<CommonParameters>]
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,

View File

@ -4,7 +4,7 @@ This PowerShell script closes the OneCalendar application gracefully.
## Parameters
```powershell
/home/mf/Repos/PowerShell/Scripts/close-one-calendar.ps1 [<CommonParameters>]
close-one-calendar.ps1 [<CommonParameters>]
[<CommonParameters>]
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,

View File

@ -4,7 +4,7 @@ This PowerShell script closes the Microsoft Outlook email application gracefully
## Parameters
```powershell
/home/mf/Repos/PowerShell/Scripts/close-outlook.ps1 [<CommonParameters>]
close-outlook.ps1 [<CommonParameters>]
[<CommonParameters>]
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,

View File

@ -4,7 +4,7 @@ This PowerShell script closes the Paint 3D application gracefully.
## Parameters
```powershell
/home/mf/Repos/PowerShell/Scripts/close-paint-three-d.ps1 [<CommonParameters>]
close-paint-three-d.ps1 [<CommonParameters>]
[<CommonParameters>]
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,

View File

@ -4,7 +4,7 @@ This PowerShell script closes a program's processes gracefully.
## Parameters
```powershell
/home/mf/Repos/PowerShell/Scripts/close-program.ps1 [[-FullProgramName] <String>] [[-ProgramName] <String>] [[-ProgramAliasName] <String>] [<CommonParameters>]
close-program.ps1 [[-FullProgramName] <String>] [[-ProgramName] <String>] [[-ProgramAliasName] <String>] [<CommonParameters>]
-FullProgramName <String>
Specifies the full program name

View File

@ -4,7 +4,7 @@ This PowerShell script closes the Serenade.ai application gracefully.
## Parameters
```powershell
/home/mf/Repos/PowerShell/Scripts/close-serenade.ps1 [<CommonParameters>]
close-serenade.ps1 [<CommonParameters>]
[<CommonParameters>]
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,

View File

@ -4,7 +4,7 @@ This PowerShell script closes the Snipping Tool application gracefully.
## Parameters
```powershell
/home/mf/Repos/PowerShell/Scripts/close-snipping-tool.ps1 [<CommonParameters>]
close-snipping-tool.ps1 [<CommonParameters>]
[<CommonParameters>]
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,

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