mirror of
https://github.com/fleschutz/PowerShell.git
synced 2024-11-21 15:33:15 +01:00
Updated the Markdown manuals
This commit is contained in:
parent
27ca36b317
commit
46a49b5291
@ -113,4 +113,4 @@ try {
|
||||
|
||||
```
|
||||
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of add-firewall-rules.ps1 as of 01/03/2024 12:10:43)*
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of add-firewall-rules.ps1 as of 01/25/2024 13:28:31)*
|
||||
|
@ -79,4 +79,4 @@ try {
|
||||
}
|
||||
```
|
||||
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of add-memo.ps1 as of 01/03/2024 12:10:43)*
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of add-memo.ps1 as of 01/25/2024 13:28:31)*
|
||||
|
@ -71,4 +71,4 @@ try {
|
||||
}
|
||||
```
|
||||
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of alert.ps1 as of 01/03/2024 12:10:43)*
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of alert.ps1 as of 01/25/2024 13:28:31)*
|
||||
|
@ -192,4 +192,4 @@ try {
|
||||
}
|
||||
```
|
||||
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of build-repo.ps1 as of 01/03/2024 12:10:43)*
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of build-repo.ps1 as of 01/25/2024 13:28:31)*
|
||||
|
@ -82,4 +82,4 @@ try {
|
||||
}
|
||||
```
|
||||
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of build-repos.ps1 as of 01/03/2024 12:10:43)*
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of build-repos.ps1 as of 01/25/2024 13:28:31)*
|
||||
|
@ -60,4 +60,4 @@ try {
|
||||
}
|
||||
```
|
||||
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of cd-autostart.ps1 as of 01/03/2024 12:10:43)*
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of cd-autostart.ps1 as of 01/25/2024 13:28:31)*
|
||||
|
@ -63,4 +63,4 @@ try {
|
||||
}
|
||||
```
|
||||
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of cd-crashdumps.ps1 as of 01/03/2024 12:10:43)*
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of cd-crashdumps.ps1 as of 01/25/2024 13:28:31)*
|
||||
|
@ -64,4 +64,4 @@ try {
|
||||
}
|
||||
```
|
||||
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of cd-desktop.ps1 as of 01/03/2024 12:10:43)*
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of cd-desktop.ps1 as of 01/25/2024 13:28:31)*
|
||||
|
@ -64,4 +64,4 @@ try {
|
||||
}
|
||||
```
|
||||
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of cd-docs.ps1 as of 01/03/2024 12:10:43)*
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of cd-docs.ps1 as of 01/25/2024 13:28:31)*
|
||||
|
@ -64,4 +64,4 @@ try {
|
||||
}
|
||||
```
|
||||
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of cd-downloads.ps1 as of 01/03/2024 12:10:43)*
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of cd-downloads.ps1 as of 01/25/2024 13:28:31)*
|
||||
|
@ -60,4 +60,4 @@ try {
|
||||
}
|
||||
```
|
||||
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of cd-dropbox.ps1 as of 01/03/2024 12:10:43)*
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of cd-dropbox.ps1 as of 01/25/2024 13:28:31)*
|
||||
|
@ -64,4 +64,4 @@ try {
|
||||
}
|
||||
```
|
||||
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of cd-etc.ps1 as of 01/03/2024 12:10:43)*
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of cd-etc.ps1 as of 01/25/2024 13:28:31)*
|
||||
|
@ -60,4 +60,4 @@ try {
|
||||
}
|
||||
```
|
||||
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of cd-fonts.ps1 as of 01/03/2024 12:10:43)*
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of cd-fonts.ps1 as of 01/25/2024 13:28:31)*
|
||||
|
@ -60,4 +60,4 @@ try {
|
||||
}
|
||||
```
|
||||
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of cd-home.ps1 as of 01/03/2024 12:10:43)*
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of cd-home.ps1 as of 01/25/2024 13:28:31)*
|
||||
|
@ -48,4 +48,4 @@ try {
|
||||
}
|
||||
```
|
||||
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of cd-logs.ps1 as of 01/03/2024 12:10:43)*
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of cd-logs.ps1 as of 01/25/2024 13:28:31)*
|
||||
|
@ -64,4 +64,4 @@ try {
|
||||
}
|
||||
```
|
||||
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of cd-music.ps1 as of 01/03/2024 12:10:43)*
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of cd-music.ps1 as of 01/25/2024 13:28:31)*
|
||||
|
@ -60,4 +60,4 @@ try {
|
||||
}
|
||||
```
|
||||
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of cd-onedrive.ps1 as of 01/03/2024 12:10:43)*
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of cd-onedrive.ps1 as of 01/25/2024 13:28:31)*
|
||||
|
@ -62,4 +62,4 @@ try {
|
||||
}
|
||||
```
|
||||
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of cd-pics.ps1 as of 01/03/2024 12:10:43)*
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of cd-pics.ps1 as of 01/25/2024 13:28:31)*
|
||||
|
@ -62,4 +62,4 @@ try {
|
||||
}
|
||||
```
|
||||
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of cd-public.ps1 as of 01/03/2024 12:10:43)*
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of cd-public.ps1 as of 01/25/2024 13:28:31)*
|
||||
|
@ -53,4 +53,4 @@ try {
|
||||
}
|
||||
```
|
||||
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of cd-recycle-bin.ps1 as of 01/03/2024 12:10:43)*
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of cd-recycle-bin.ps1 as of 01/25/2024 13:28:31)*
|
||||
|
@ -80,4 +80,4 @@ try {
|
||||
}
|
||||
```
|
||||
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of cd-repos.ps1 as of 01/03/2024 12:10:43)*
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of cd-repos.ps1 as of 01/25/2024 13:28:31)*
|
||||
|
@ -57,4 +57,4 @@ try {
|
||||
}
|
||||
```
|
||||
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of cd-root.ps1 as of 01/03/2024 12:10:43)*
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of cd-root.ps1 as of 01/25/2024 13:28:31)*
|
||||
|
@ -55,4 +55,4 @@ try {
|
||||
}
|
||||
```
|
||||
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of cd-screenshots.ps1 as of 01/03/2024 12:10:43)*
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of cd-screenshots.ps1 as of 01/25/2024 13:28:31)*
|
||||
|
@ -58,4 +58,4 @@ try {
|
||||
}
|
||||
```
|
||||
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of cd-scripts.ps1 as of 01/03/2024 12:10:43)*
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of cd-scripts.ps1 as of 01/25/2024 13:28:31)*
|
||||
|
@ -58,4 +58,4 @@ try {
|
||||
}
|
||||
```
|
||||
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of cd-ssh.ps1 as of 01/03/2024 12:10:43)*
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of cd-ssh.ps1 as of 01/25/2024 13:28:31)*
|
||||
|
@ -50,4 +50,4 @@ try {
|
||||
}
|
||||
```
|
||||
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of cd-temp.ps1 as of 01/03/2024 12:10:43)*
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of cd-temp.ps1 as of 01/25/2024 13:28:31)*
|
||||
|
@ -62,4 +62,4 @@ try {
|
||||
}
|
||||
```
|
||||
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of cd-templates.ps1 as of 01/03/2024 12:10:43)*
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of cd-templates.ps1 as of 01/25/2024 13:28:31)*
|
||||
|
@ -53,4 +53,4 @@ try {
|
||||
}
|
||||
```
|
||||
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of cd-trash.ps1 as of 01/03/2024 12:10:43)*
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of cd-trash.ps1 as of 01/25/2024 13:28:31)*
|
||||
|
@ -58,4 +58,4 @@ try {
|
||||
}
|
||||
```
|
||||
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of cd-up.ps1 as of 01/03/2024 12:10:43)*
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of cd-up.ps1 as of 01/25/2024 13:28:31)*
|
||||
|
@ -58,4 +58,4 @@ try {
|
||||
}
|
||||
```
|
||||
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of cd-up2.ps1 as of 01/03/2024 12:10:43)*
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of cd-up2.ps1 as of 01/25/2024 13:28:32)*
|
||||
|
@ -58,4 +58,4 @@ try {
|
||||
}
|
||||
```
|
||||
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of cd-up3.ps1 as of 01/03/2024 12:10:43)*
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of cd-up3.ps1 as of 01/25/2024 13:28:32)*
|
||||
|
@ -58,4 +58,4 @@ try {
|
||||
}
|
||||
```
|
||||
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of cd-up4.ps1 as of 01/03/2024 12:10:43)*
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of cd-up4.ps1 as of 01/25/2024 13:28:32)*
|
||||
|
@ -58,4 +58,4 @@ try {
|
||||
}
|
||||
```
|
||||
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of cd-users.ps1 as of 01/03/2024 12:10:43)*
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of cd-users.ps1 as of 01/25/2024 13:28:32)*
|
||||
|
@ -62,4 +62,4 @@ try {
|
||||
}
|
||||
```
|
||||
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of cd-videos.ps1 as of 01/03/2024 12:10:43)*
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of cd-videos.ps1 as of 01/25/2024 13:28:32)*
|
||||
|
@ -58,4 +58,4 @@ try {
|
||||
}
|
||||
```
|
||||
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of cd-windows.ps1 as of 01/03/2024 12:10:43)*
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of cd-windows.ps1 as of 01/25/2024 13:28:32)*
|
||||
|
@ -79,4 +79,4 @@ try {
|
||||
}
|
||||
```
|
||||
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of change-wallpaper.ps1 as of 01/03/2024 12:10:43)*
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of change-wallpaper.ps1 as of 01/25/2024 13:28:32)*
|
||||
|
@ -67,4 +67,4 @@ try {
|
||||
}
|
||||
```
|
||||
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of check-admin.ps1 as of 01/03/2024 12:10:43)*
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of check-admin.ps1 as of 01/25/2024 13:28:32)*
|
||||
|
@ -75,4 +75,4 @@ try {
|
||||
}
|
||||
```
|
||||
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of check-apps.ps1 as of 01/03/2024 12:10:44)*
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of check-apps.ps1 as of 01/25/2024 13:28:32)*
|
||||
|
@ -76,4 +76,4 @@ try {
|
||||
}
|
||||
```
|
||||
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of check-bios.ps1 as of 01/03/2024 12:10:44)*
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of check-bios.ps1 as of 01/25/2024 13:28:32)*
|
||||
|
@ -101,4 +101,4 @@ try {
|
||||
}
|
||||
```
|
||||
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of check-cpu.ps1 as of 01/03/2024 12:10:44)*
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of check-cpu.ps1 as of 01/25/2024 13:28:32)*
|
||||
|
85
docs/check-credentials.md
Normal file
85
docs/check-credentials.md
Normal file
@ -0,0 +1,85 @@
|
||||
*check-credentials.ps1*
|
||||
================
|
||||
|
||||
This PowerShell script asks for credentials and checks them against saved ones ("$HOME\my.credentials" by default).
|
||||
|
||||
Parameters
|
||||
----------
|
||||
```powershell
|
||||
PS> ./check-credentials.ps1 [[-TargetFile] <String>] [<CommonParameters>]
|
||||
|
||||
-TargetFile <String>
|
||||
Specifies the target file ("$HOME\my.credentials" by default)
|
||||
|
||||
Required? false
|
||||
Position? 1
|
||||
Default value "$HOME\my.credentials"
|
||||
Accept pipeline input? false
|
||||
Accept wildcard characters? false
|
||||
|
||||
[<CommonParameters>]
|
||||
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,
|
||||
WarningVariable, OutBuffer, PipelineVariable, and OutVariable.
|
||||
```
|
||||
|
||||
Example
|
||||
-------
|
||||
```powershell
|
||||
PS> ./check-credentials.ps1
|
||||
Enter username and password, please.
|
||||
✔️ Your credentials are correct.
|
||||
|
||||
```
|
||||
|
||||
Notes
|
||||
-----
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
|
||||
Related Links
|
||||
-------------
|
||||
https://github.com/fleschutz/PowerShell
|
||||
|
||||
Script Content
|
||||
--------------
|
||||
```powershell
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Checks credentials
|
||||
.DESCRIPTION
|
||||
This PowerShell script asks for credentials and checks them against saved ones ("$HOME\my.credentials" by default).
|
||||
.PARAMETER TargetFile
|
||||
Specifies the target file ("$HOME\my.credentials" by default)
|
||||
.EXAMPLE
|
||||
PS> ./check-credentials.ps1
|
||||
Enter username and password, please.
|
||||
✔️ Your credentials are correct.
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
.NOTES
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
#>
|
||||
|
||||
param([string]$TargetFile = "$HOME\my.credentials")
|
||||
|
||||
try {
|
||||
Write-Host "Enter username and password, please." -foreground red
|
||||
$credsFromUser = Get-Credential
|
||||
|
||||
$secureString = Get-Content "$TargetFile" | ConvertTo-SecureString
|
||||
$credsFromFile = New-Object System.Management.Automation.PSCredential($credsFromUser.UserName, $secureString)
|
||||
|
||||
if ($credsFromUser.UserName -ne $credsFromFile.UserName) { throw "Sorry, your username is wrong." }
|
||||
|
||||
$pw1 = [Runtime.InteropServices.Marshal]::PtrToStringAuto([Runtime.InteropServices.Marshal]::SecureStringToBSTR($credsFromUser.Password))
|
||||
$pw2 = [Runtime.InteropServices.Marshal]::PtrToStringAuto([Runtime.InteropServices.Marshal]::SecureStringToBSTR($credsFromFile.Password))
|
||||
if ($pw1 -cne $pw2) { throw "Sorry, your password is wrong." }
|
||||
|
||||
"✔️ Your credentials are correct."
|
||||
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-credentials.ps1 as of 01/25/2024 13:28:32)*
|
@ -57,4 +57,4 @@ try {
|
||||
}
|
||||
```
|
||||
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of check-day.ps1 as of 01/03/2024 12:10:44)*
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of check-day.ps1 as of 01/25/2024 13:28:32)*
|
||||
|
@ -73,4 +73,4 @@ try {
|
||||
}
|
||||
```
|
||||
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of check-dns.ps1 as of 01/03/2024 12:10:44)*
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of check-dns.ps1 as of 01/25/2024 13:28:32)*
|
||||
|
@ -1,15 +1,15 @@
|
||||
*check-drive-space.ps1*
|
||||
================
|
||||
|
||||
This PowerShell script checks a drive for free space left (20 GB by default).
|
||||
This PowerShell script checks the given drive for free space left (10 GB by default).
|
||||
|
||||
Parameters
|
||||
----------
|
||||
```powershell
|
||||
PS> ./check-drive-space.ps1 [[-Drive] <String>] [[-MinLevel] <Int32>] [<CommonParameters>]
|
||||
PS> ./check-drive-space.ps1 [[-driveName] <String>] [[-minLevel] <Int64>] [<CommonParameters>]
|
||||
|
||||
-Drive <String>
|
||||
Specifies the drive to check
|
||||
-driveName <String>
|
||||
Specifies the drive name to check (e.g. "C")
|
||||
|
||||
Required? false
|
||||
Position? 1
|
||||
@ -17,12 +17,12 @@ PS> ./check-drive-space.ps1 [[-Drive] <String>] [[-MinLevel] <Int32>] [<CommonPa
|
||||
Accept pipeline input? false
|
||||
Accept wildcard characters? false
|
||||
|
||||
-MinLevel <Int32>
|
||||
Specifies the minimum level in Gigabyte
|
||||
-minLevel <Int64>
|
||||
Specifies the minimum level in bytes (10GB by default)
|
||||
|
||||
Required? false
|
||||
Position? 2
|
||||
Default value 20
|
||||
Default value 10000000
|
||||
Accept pipeline input? false
|
||||
Accept wildcard characters? false
|
||||
|
||||
@ -34,8 +34,8 @@ PS> ./check-drive-space.ps1 [[-Drive] <String>] [[-MinLevel] <Int32>] [<CommonPa
|
||||
Example
|
||||
-------
|
||||
```powershell
|
||||
PS> ./check-drive-space C
|
||||
✔️ 172 GB left on drive C (61 of 233 GB used)
|
||||
PS> ./check-drive-space.ps1 C
|
||||
✅ Drive C: uses 56%, 442GB free of 999GB
|
||||
|
||||
```
|
||||
|
||||
@ -52,38 +52,57 @@ Script Content
|
||||
```powershell
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Checks a drive for free space left
|
||||
Checks the drive space
|
||||
.DESCRIPTION
|
||||
This PowerShell script checks a drive for free space left (20 GB by default).
|
||||
.PARAMETER Drive
|
||||
Specifies the drive to check
|
||||
.PARAMETER MinLevel
|
||||
Specifies the minimum level in Gigabyte
|
||||
This PowerShell script checks the given drive for free space left (10 GB by default).
|
||||
.PARAMETER driveName
|
||||
Specifies the drive name to check (e.g. "C")
|
||||
.PARAMETER minLevel
|
||||
Specifies the minimum level in bytes (10GB by default)
|
||||
.EXAMPLE
|
||||
PS> ./check-drive-space C
|
||||
✔️ 172 GB left on drive C (61 of 233 GB used)
|
||||
PS> ./check-drive-space.ps1 C
|
||||
✅ Drive C: uses 56%, 442GB free of 999GB
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
.NOTES
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
#>
|
||||
|
||||
param([string]$Drive = "", [int]$MinLevel = 20) # minimum level in GB
|
||||
param([string]$driveName = "", [int64]$minLevel = 10 * 1000 * 1000) # GB
|
||||
|
||||
function Bytes2String { param([int64]$bytes)
|
||||
if ($bytes -lt 1000) { return "$bytes bytes" }
|
||||
$bytes /= 1000
|
||||
if ($bytes -lt 1000) { return "$($bytes)KB" }
|
||||
$bytes /= 1000
|
||||
if ($bytes -lt 1000) { return "$($bytes)MB" }
|
||||
$bytes /= 1000
|
||||
if ($bytes -lt 1000) { return "$($bytes)GB" }
|
||||
$bytes /= 1000
|
||||
if ($bytes -lt 1000) { return "$($bytes)TB" }
|
||||
$bytes /= 1000
|
||||
return "$($bytes)PB"
|
||||
}
|
||||
|
||||
try {
|
||||
if ($Drive -eq "" ) { $Drive = read-host "Enter drive to check" }
|
||||
if ($driveName -eq "" ) { $driveName = Read-Host "Enter the drive name to check" }
|
||||
|
||||
$DriveDetails = (get-psdrive $Drive)
|
||||
[int]$Free = (($DriveDetails.Free / 1024) / 1024) / 1024
|
||||
[int]$Used = (($DriveDetails.Used / 1024) / 1024) / 1024
|
||||
[int]$Total = ($Used + $Free)
|
||||
$details = (Get-PSDrive $driveName)
|
||||
if (-not $IsLinux) { $driveName = $driveName + ":" }
|
||||
[int64]$free = $details.Free
|
||||
[int64]$used = $details.Used
|
||||
[int64]$total = ($used + $free)
|
||||
|
||||
if ($Free -lt $MinLevel) {
|
||||
write-warning "Drive $Drive has only $Free GB left to use! ($Used of $Total GB used, minimum is $MinLevel GB)"
|
||||
exit 1
|
||||
}
|
||||
|
||||
& "$PSScriptRoot/speak-english.ps1" "Drive $Drive has $Free GB left ($Total GB total)"
|
||||
if ($total -eq 0) {
|
||||
Write-Host "✅ Drive $driveName is empty"
|
||||
} elseif ($free -eq 0) {
|
||||
Write-Host "⚠️ Drive $driveName with $(Bytes2String $total) is full"
|
||||
} elseif ($free -lt $minLevel) {
|
||||
Write-Host "⚠️ Drive $driveName with $(Bytes2String $total) is nearly full, $(Bytes2String $free) free"
|
||||
} else {
|
||||
[int]$percent = ($used * 100) / $total
|
||||
Write-Host "✅ Drive $driveName uses $percent%, $(Bytes2String $free) free of $(Bytes2String $total)"
|
||||
}
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
@ -91,4 +110,4 @@ try {
|
||||
}
|
||||
```
|
||||
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of check-drive-space.ps1 as of 01/03/2024 12:10:44)*
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of check-drive-space.ps1 as of 01/25/2024 13:28:32)*
|
||||
|
@ -105,4 +105,4 @@ try {
|
||||
}
|
||||
```
|
||||
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of check-drives.ps1 as of 01/03/2024 12:10:44)*
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of check-drives.ps1 as of 01/25/2024 13:28:32)*
|
||||
|
@ -63,4 +63,4 @@ try {
|
||||
}
|
||||
```
|
||||
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of check-dusk.ps1 as of 01/03/2024 12:10:44)*
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of check-dusk.ps1 as of 01/25/2024 13:28:32)*
|
||||
|
@ -61,4 +61,4 @@ try {
|
||||
}
|
||||
```
|
||||
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of check-easter-sunday.ps1 as of 01/03/2024 12:10:44)*
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of check-easter-sunday.ps1 as of 01/25/2024 13:28:32)*
|
||||
|
@ -75,4 +75,4 @@ try {
|
||||
}
|
||||
```
|
||||
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of check-file-system.ps1 as of 01/03/2024 12:10:44)*
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of check-file-system.ps1 as of 01/25/2024 13:28:32)*
|
||||
|
@ -170,4 +170,4 @@ function Check-Header { param( $path )
|
||||
Check-Header $Path
|
||||
```
|
||||
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of check-file.ps1 as of 01/03/2024 12:10:44)*
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of check-file.ps1 as of 01/25/2024 13:28:32)*
|
||||
|
@ -65,4 +65,4 @@ try {
|
||||
}
|
||||
```
|
||||
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of check-firewall.ps1 as of 01/03/2024 12:10:44)*
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of check-firewall.ps1 as of 01/25/2024 13:28:32)*
|
||||
|
@ -65,4 +65,4 @@ try {
|
||||
}
|
||||
```
|
||||
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of check-gpu.ps1 as of 01/03/2024 12:10:44)*
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of check-gpu.ps1 as of 01/25/2024 13:28:32)*
|
||||
|
@ -63,4 +63,4 @@ Script Content
|
||||
exit 0 # success
|
||||
```
|
||||
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of check-hardware.ps1 as of 01/03/2024 12:10:44)*
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of check-hardware.ps1 as of 01/25/2024 13:28:32)*
|
||||
|
@ -58,4 +58,4 @@ Script Content
|
||||
exit 0 # success
|
||||
```
|
||||
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of check-health.ps1 as of 01/03/2024 12:10:44)*
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of check-health.ps1 as of 01/25/2024 13:28:32)*
|
||||
|
@ -61,4 +61,4 @@ try {
|
||||
}
|
||||
```
|
||||
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of check-independence-day.ps1 as of 01/03/2024 12:10:44)*
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of check-independence-day.ps1 as of 01/25/2024 13:28:32)*
|
||||
|
@ -84,4 +84,4 @@ try {
|
||||
}
|
||||
```
|
||||
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of check-ipv4-address.ps1 as of 01/03/2024 12:10:44)*
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of check-ipv4-address.ps1 as of 01/25/2024 13:28:32)*
|
||||
|
@ -98,4 +98,4 @@ try {
|
||||
}
|
||||
```
|
||||
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of check-ipv6-address.ps1 as of 01/03/2024 12:10:44)*
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of check-ipv6-address.ps1 as of 01/25/2024 13:28:32)*
|
||||
|
@ -55,4 +55,4 @@ try {
|
||||
}
|
||||
```
|
||||
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of check-iss-position.ps1 as of 01/03/2024 12:10:44)*
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of check-iss-position.ps1 as of 01/25/2024 13:28:32)*
|
||||
|
@ -87,4 +87,4 @@ try {
|
||||
}
|
||||
```
|
||||
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of check-mac-address.ps1 as of 01/03/2024 12:10:44)*
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of check-mac-address.ps1 as of 01/25/2024 13:28:32)*
|
||||
|
@ -60,4 +60,4 @@ try {
|
||||
}
|
||||
```
|
||||
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of check-midnight.ps1 as of 01/03/2024 12:10:44)*
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of check-midnight.ps1 as of 01/25/2024 13:28:32)*
|
||||
|
@ -57,4 +57,4 @@ try {
|
||||
}
|
||||
```
|
||||
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of check-month.ps1 as of 01/03/2024 12:10:44)*
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of check-month.ps1 as of 01/25/2024 13:28:32)*
|
||||
|
@ -76,4 +76,4 @@ try {
|
||||
}
|
||||
```
|
||||
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of check-moon-phase.ps1 as of 01/03/2024 12:10:44)*
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of check-moon-phase.ps1 as of 01/25/2024 13:28:32)*
|
||||
|
@ -65,4 +65,4 @@ Script Content
|
||||
exit 0 # success
|
||||
```
|
||||
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of check-network.ps1 as of 01/03/2024 12:10:44)*
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of check-network.ps1 as of 01/25/2024 13:28:32)*
|
||||
|
@ -60,4 +60,4 @@ try {
|
||||
}
|
||||
```
|
||||
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of check-new-year.ps1 as of 01/03/2024 12:10:44)*
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of check-new-year.ps1 as of 01/25/2024 13:28:32)*
|
||||
|
@ -59,4 +59,4 @@ try {
|
||||
}
|
||||
```
|
||||
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of check-noon.ps1 as of 01/03/2024 12:10:44)*
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of check-noon.ps1 as of 01/25/2024 13:28:32)*
|
||||
|
@ -73,4 +73,4 @@ try {
|
||||
}
|
||||
```
|
||||
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of check-os.ps1 as of 01/03/2024 12:10:44)*
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of check-os.ps1 as of 01/25/2024 13:28:32)*
|
||||
|
@ -65,4 +65,4 @@ try {
|
||||
}
|
||||
```
|
||||
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of check-outlook.ps1 as of 01/03/2024 12:10:44)*
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of check-outlook.ps1 as of 01/25/2024 13:28:32)*
|
||||
|
@ -94,4 +94,4 @@ try {
|
||||
}
|
||||
```
|
||||
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of check-password.ps1 as of 01/03/2024 12:10:44)*
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of check-password.ps1 as of 01/25/2024 13:28:32)*
|
||||
|
@ -24,7 +24,7 @@ Script Content
|
||||
This PowerShell script queries pending operating system reboots and prints it.
|
||||
.EXAMPLE
|
||||
./check-pending-reboot.ps1
|
||||
✅ No pending reboot
|
||||
✅ No pending system reboot
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
.NOTES
|
||||
@ -83,7 +83,7 @@ try {
|
||||
}
|
||||
}
|
||||
if ($Reason -eq "") {
|
||||
Write-Host "✅ No pending reboot"
|
||||
Write-Host "✅ No pending system reboot"
|
||||
}
|
||||
exit 0 # success
|
||||
} catch {
|
||||
@ -92,4 +92,4 @@ try {
|
||||
}
|
||||
```
|
||||
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of check-pending-reboot.ps1 as of 01/03/2024 12:10:44)*
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of check-pending-reboot.ps1 as of 01/25/2024 13:28:32)*
|
||||
|
@ -92,4 +92,4 @@ try {
|
||||
}
|
||||
```
|
||||
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of check-power.ps1 as of 01/03/2024 12:10:44)*
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of check-power.ps1 as of 01/25/2024 13:28:32)*
|
||||
|
@ -59,4 +59,4 @@ try {
|
||||
}
|
||||
```
|
||||
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of check-powershell.ps1 as of 01/03/2024 12:10:44)*
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of check-powershell.ps1 as of 01/25/2024 13:28:32)*
|
||||
|
@ -76,4 +76,4 @@ try {
|
||||
}
|
||||
```
|
||||
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of check-ps1-file.ps1 as of 01/03/2024 12:10:44)*
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of check-ps1-file.ps1 as of 01/25/2024 13:28:32)*
|
||||
|
@ -98,4 +98,4 @@ try {
|
||||
}
|
||||
```
|
||||
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of check-ram.ps1 as of 01/03/2024 12:10:44)*
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of check-ram.ps1 as of 01/25/2024 13:28:32)*
|
||||
|
@ -128,4 +128,4 @@ try {
|
||||
}
|
||||
```
|
||||
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of check-repo.ps1 as of 01/03/2024 12:10:44)*
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of check-repo.ps1 as of 01/25/2024 13:28:32)*
|
||||
|
@ -82,4 +82,4 @@ try {
|
||||
}
|
||||
```
|
||||
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of check-repos.ps1 as of 01/03/2024 12:10:44)*
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of check-repos.ps1 as of 01/25/2024 13:28:33)*
|
||||
|
@ -56,4 +56,4 @@ try {
|
||||
}
|
||||
```
|
||||
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of check-santa.ps1 as of 01/03/2024 12:10:44)*
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of check-santa.ps1 as of 01/25/2024 13:28:33)*
|
||||
|
@ -95,4 +95,4 @@ try {
|
||||
}
|
||||
```
|
||||
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of check-smart-devices.ps1 as of 01/03/2024 12:10:44)*
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of check-smart-devices.ps1 as of 01/25/2024 13:28:33)*
|
||||
|
@ -69,4 +69,4 @@ Script Content
|
||||
exit 0 # success
|
||||
```
|
||||
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of check-software.ps1 as of 01/03/2024 12:10:44)*
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of check-software.ps1 as of 01/25/2024 13:28:33)*
|
||||
|
@ -84,4 +84,4 @@ try {
|
||||
}
|
||||
```
|
||||
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of check-subnet-mask.ps1 as of 01/03/2024 12:10:44)*
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of check-subnet-mask.ps1 as of 01/25/2024 13:28:33)*
|
||||
|
@ -92,8 +92,8 @@ try {
|
||||
Write-Output "⚠️ Swap space of $(MB2String $Total) is full"
|
||||
} elseif ($Free -lt $minLevel) {
|
||||
Write-Output "⚠️ Swap space of $(MB2String $Total) is nearly full, only $(MB2String $Free) free"
|
||||
} elseif ($Used -eq 0) {
|
||||
Write-Output "✅ Swap space of $(MB2String $Total) reserved"
|
||||
} elseif ($Used -lt 5) {
|
||||
Write-Output "✅ Swap space unused, $(MB2String $Free) free"
|
||||
} else {
|
||||
[int]$Percent = ($Used * 100) / $Total
|
||||
Write-Output "✅ Swap space uses $Percent%, $(MB2String $Free) free of $(MB2String $Total)"
|
||||
@ -105,4 +105,4 @@ try {
|
||||
}
|
||||
```
|
||||
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of check-swap-space.ps1 as of 01/03/2024 12:10:45)*
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of check-swap-space.ps1 as of 01/25/2024 13:28:33)*
|
||||
|
@ -100,4 +100,4 @@ try {
|
||||
}
|
||||
```
|
||||
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of check-symlinks.ps1 as of 01/03/2024 12:10:45)*
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of check-symlinks.ps1 as of 01/25/2024 13:28:33)*
|
||||
|
@ -65,4 +65,4 @@ try {
|
||||
}
|
||||
```
|
||||
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of check-time-zone.ps1 as of 01/03/2024 12:10:45)*
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of check-time-zone.ps1 as of 01/25/2024 13:28:33)*
|
||||
|
@ -61,4 +61,4 @@ try {
|
||||
}
|
||||
```
|
||||
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of check-uptime.ps1 as of 01/03/2024 12:10:45)*
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of check-uptime.ps1 as of 01/25/2024 13:28:33)*
|
||||
|
@ -65,4 +65,4 @@ try {
|
||||
}
|
||||
```
|
||||
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of check-vpn.ps1 as of 01/03/2024 12:10:45)*
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of check-vpn.ps1 as of 01/25/2024 13:28:33)*
|
||||
|
@ -81,4 +81,4 @@ try {
|
||||
}
|
||||
```
|
||||
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of check-weather.ps1 as of 01/03/2024 12:10:45)*
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of check-weather.ps1 as of 01/25/2024 13:28:33)*
|
||||
|
@ -54,4 +54,4 @@ try {
|
||||
}
|
||||
```
|
||||
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of check-week.ps1 as of 01/03/2024 12:10:45)*
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of check-week.ps1 as of 01/25/2024 13:28:33)*
|
||||
|
@ -72,4 +72,4 @@ try {
|
||||
}
|
||||
```
|
||||
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of check-wind.ps1 as of 01/03/2024 12:10:45)*
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of check-wind.ps1 as of 01/25/2024 13:28:33)*
|
||||
|
@ -60,4 +60,4 @@ try {
|
||||
}
|
||||
```
|
||||
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of check-windows-system-files.ps1 as of 01/03/2024 12:10:45)*
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of check-windows-system-files.ps1 as of 01/25/2024 13:28:33)*
|
||||
|
@ -9,7 +9,7 @@ Parameters
|
||||
PS> ./check-xml-file.ps1 [[-path] <String>] [<CommonParameters>]
|
||||
|
||||
-path <String>
|
||||
Specifies the path to the XML file to check
|
||||
Specifies the path to the XML file
|
||||
|
||||
Required? false
|
||||
Position? 1
|
||||
@ -26,7 +26,7 @@ Example
|
||||
-------
|
||||
```powershell
|
||||
PS> ./check-xml-file.ps1 myfile.xml
|
||||
✔️ Valid XML in 'myfile.xml'
|
||||
✔️ Valid XML in 📄myfile.xml
|
||||
|
||||
```
|
||||
|
||||
@ -43,14 +43,14 @@ Script Content
|
||||
```powershell
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Verifies the given XML file
|
||||
Verifies an XML file
|
||||
.DESCRIPTION
|
||||
This PowerShell script checks the given XML file for validity.
|
||||
.PARAMETER path
|
||||
Specifies the path to the XML file to check
|
||||
Specifies the path to the XML file
|
||||
.EXAMPLE
|
||||
PS> ./check-xml-file.ps1 myfile.xml
|
||||
✔️ Valid XML in 'myfile.xml'
|
||||
✔️ Valid XML in 📄myfile.xml
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
.NOTES
|
||||
@ -74,16 +74,14 @@ try {
|
||||
while ($Reader.Read()) { }
|
||||
$Reader.Close()
|
||||
|
||||
if ($script:ErrorCount -gt 0) {
|
||||
throw "Invalid XML in '$path'"
|
||||
}
|
||||
if ($script:ErrorCount -gt 0) { throw "Invalid XML" }
|
||||
|
||||
"✔️ Valid XML in '$path'"
|
||||
"✔️ Valid XML in 📄$path"
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
"⚠️ $($Error[0]) in 📄$path"
|
||||
exit 1
|
||||
}
|
||||
```
|
||||
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of check-xml-file.ps1 as of 01/03/2024 12:10:45)*
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of check-xml-file.ps1 as of 01/25/2024 13:28:33)*
|
||||
|
@ -1,7 +1,7 @@
|
||||
*check-xml-files.ps1*
|
||||
================
|
||||
|
||||
This PowerShell script verifies each XML file in the given directory tree for validity.
|
||||
This PowerShell script verifies each XML file (with suffix .xml) in the given directory tree for validity.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
@ -27,7 +27,7 @@ Example
|
||||
```powershell
|
||||
PS> ./check-xml-files.ps1 C:\Windows
|
||||
...
|
||||
✔️ Checked 3607 XML files within C:\Windows in 174 sec
|
||||
✔️ Checked 3387 XML files within 📂C:\Windows in 174 sec
|
||||
|
||||
```
|
||||
|
||||
@ -44,15 +44,15 @@ Script Content
|
||||
```powershell
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Checks XML files in a directory tree
|
||||
Checks all XML files in a directory tree
|
||||
.DESCRIPTION
|
||||
This PowerShell script verifies each XML file in the given directory tree for validity.
|
||||
This PowerShell script verifies each XML file (with suffix .xml) in the given directory tree for validity.
|
||||
.PARAMETER path
|
||||
Specifies the path to the directory tree (current working dir by default)
|
||||
.EXAMPLE
|
||||
PS> ./check-xml-files.ps1 C:\Windows
|
||||
...
|
||||
✔️ Checked 3607 XML files within C:\Windows in 174 sec
|
||||
✔️ Checked 3387 XML files within 📂C:\Windows in 174 sec
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
.NOTES
|
||||
@ -65,17 +65,17 @@ try {
|
||||
$stopWatch = [system.diagnostics.stopwatch]::startNew()
|
||||
|
||||
$path = Resolve-Path "$path"
|
||||
[int]$count = 0
|
||||
[int]$numXmlFiles = 0
|
||||
|
||||
Write-Progress "Checking all *.xml files under $path..."
|
||||
Get-ChildItem -path "$path" -attributes !Directory -recurse -force | Where-Object { $_.Name -like "*.xml*" } | Foreach-Object {
|
||||
Write-Progress "Scanning all XML files within $path..."
|
||||
Get-ChildItem -path "$path" -attributes !Directory -recurse -force | Where-Object { $_.Name -like "*.xml" } | Foreach-Object {
|
||||
& $PSScriptRoot/check-xml-file.ps1 "$($_.FullName)"
|
||||
$count++
|
||||
$numXmlFiles++
|
||||
}
|
||||
Write-Progress -completed "Done."
|
||||
|
||||
[int]$elapsed = $stopWatch.Elapsed.TotalSeconds
|
||||
"✔️ Checked $count XML files within $path in $elapsed sec"
|
||||
"✔️ Checked $numXmlFiles XML files within 📂$path in $elapsed sec"
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
@ -83,4 +83,4 @@ try {
|
||||
}
|
||||
```
|
||||
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of check-xml-files.ps1 as of 01/03/2024 12:10:45)*
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of check-xml-files.ps1 as of 01/25/2024 13:28:33)*
|
||||
|
@ -101,4 +101,4 @@ try {
|
||||
}
|
||||
```
|
||||
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of clean-repo.ps1 as of 01/03/2024 12:10:45)*
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of clean-repo.ps1 as of 01/25/2024 13:28:33)*
|
||||
|
@ -100,4 +100,4 @@ try {
|
||||
}
|
||||
```
|
||||
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of clean-repos.ps1 as of 01/03/2024 12:10:45)*
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of clean-repos.ps1 as of 01/25/2024 13:28:33)*
|
||||
|
@ -60,4 +60,4 @@ try {
|
||||
}
|
||||
```
|
||||
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of clear-dns-cache.ps1 as of 01/03/2024 12:10:45)*
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of clear-dns-cache.ps1 as of 01/25/2024 13:28:33)*
|
||||
|
@ -58,4 +58,4 @@ try {
|
||||
}
|
||||
```
|
||||
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of clear-recycle-bin.ps1 as of 01/03/2024 12:10:45)*
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of clear-recycle-bin.ps1 as of 01/25/2024 13:28:33)*
|
||||
|
@ -112,4 +112,4 @@ try {
|
||||
}
|
||||
```
|
||||
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of clone-repos.ps1 as of 01/03/2024 12:10:45)*
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of clone-repos.ps1 as of 01/25/2024 13:28:33)*
|
||||
|
@ -48,4 +48,4 @@ Stop-Process -name "CalculatorApp"
|
||||
exit 0 # success
|
||||
```
|
||||
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of close-calculator.ps1 as of 01/03/2024 12:10:45)*
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of close-calculator.ps1 as of 01/25/2024 13:28:33)*
|
||||
|
@ -48,4 +48,4 @@ Script Content
|
||||
exit 0 # success
|
||||
```
|
||||
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of close-chrome.ps1 as of 01/03/2024 12:10:45)*
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of close-chrome.ps1 as of 01/25/2024 13:28:33)*
|
||||
|
@ -48,4 +48,4 @@ Script Content
|
||||
exit 0 # success
|
||||
```
|
||||
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of close-cortana.ps1 as of 01/03/2024 12:10:45)*
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of close-cortana.ps1 as of 01/25/2024 13:28:33)*
|
||||
|
@ -52,4 +52,4 @@ if ($lastExitCode -ne "0") {
|
||||
exit 0 # success
|
||||
```
|
||||
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of close-edge.ps1 as of 01/03/2024 12:10:45)*
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of close-edge.ps1 as of 01/25/2024 13:28:33)*
|
||||
|
@ -48,4 +48,4 @@ Script Content
|
||||
exit 0 # success
|
||||
```
|
||||
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of close-file-explorer.ps1 as of 01/03/2024 12:10:45)*
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of close-file-explorer.ps1 as of 01/25/2024 13:28:33)*
|
||||
|
@ -48,4 +48,4 @@ Script Content
|
||||
exit 0 # success
|
||||
```
|
||||
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of close-firefox.ps1 as of 01/03/2024 12:10:45)*
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of close-firefox.ps1 as of 01/25/2024 13:28:33)*
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user