Update check-swap-space.ps1 and new-script.ps1

This commit is contained in:
Markus Fleschutz 2023-08-05 10:23:20 +02:00
parent 2a115dce0a
commit 4b01e23084
2 changed files with 4 additions and 3 deletions

View File

@ -52,7 +52,8 @@ try {
} elseif ($Used -eq 0) {
Write-Output "✅ Swap space with $(MB2String $Total) reserved"
} elseif ($Used -lt $Free) {
Write-Output "✅ Swap space uses $(MB2String $Used) of $(MB2String $Total)"
[int]$Percent = ($Used * 100) / $Total
Write-Output "✅ Swap space uses $(MB2String $Used) or $($Percent)% of $(MB2String $Total)"
} else {
Write-Output "✅ Swap space has $(MB2String $Free) of $(MB2String $Total) free"
}

View File

@ -17,9 +17,9 @@
param([string]$filename = "")
try {
if ($filename -eq "" ) { $shortcut = read-host "Enter the new filename" }
if ($filename -eq "" ) { $filename = Read-Host "Enter the new filename" }
copy-item "$PSScriptRoot/../Data/template.ps1" "$filename"
Copy-Item "$PSScriptRoot/../Data/template.ps1" "$filename"
"✔️ created new PowerShell script: $filename"
exit 0 # success