mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-04-22 09:58:19 +02:00
Update check-swap-space.ps1 and new-script.ps1
This commit is contained in:
parent
2a115dce0a
commit
4b01e23084
@ -52,7 +52,8 @@ try {
|
|||||||
} elseif ($Used -eq 0) {
|
} elseif ($Used -eq 0) {
|
||||||
Write-Output "✅ Swap space with $(MB2String $Total) reserved"
|
Write-Output "✅ Swap space with $(MB2String $Total) reserved"
|
||||||
} elseif ($Used -lt $Free) {
|
} 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 {
|
} else {
|
||||||
Write-Output "✅ Swap space has $(MB2String $Free) of $(MB2String $Total) free"
|
Write-Output "✅ Swap space has $(MB2String $Free) of $(MB2String $Total) free"
|
||||||
}
|
}
|
||||||
|
@ -17,9 +17,9 @@
|
|||||||
param([string]$filename = "")
|
param([string]$filename = "")
|
||||||
|
|
||||||
try {
|
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"
|
"✔️ created new PowerShell script: $filename"
|
||||||
exit 0 # success
|
exit 0 # success
|
||||||
|
Loading…
Reference in New Issue
Block a user