mirror of
https://github.com/fleschutz/PowerShell.git
synced 2024-11-25 01:14:16 +01: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) {
|
||||
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"
|
||||
}
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user