forked from PowerFeature/WT64
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreset.ps1
31 lines (24 loc) · 1.18 KB
/
reset.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
"LOADING PLEASE WAIT ..."
$e = "$([char]27)"
$mem = [regex]::Match((wmic OS get TotalVisibleMemorySize /Value),'[0-9]+').Value + ''
$free = [regex]::Match((wmic OS get FreePhysicalMemory /Value),'[0-9]+').Value + ''
# This will display READY.\n as prompt
# function prompt {"READY.`n"}
function prompt {"`r"}
function CenterText([string]$inputLine,[int]$textWidth,[string]$wrapChar) {
If (($inputLine.length + ($wrapChar.Length *2)) -ge $textWidth) {
return -join($wrapChar,$inputLine.Substring(0,$textWidth-2*$wrapChar.Length),$wrapChar)}
else {
$diff = ($textWidth+(2*$wrapChar.Length)) - $inputLine.Length
$spaceCount = [math]::Floor($diff/2)
$leadingSpaces = $(" " * $spaceCount)
if (-join( $wrapChar, $leadingSpaces, $inputLine, $leadingSpaces,$wrapChar).Length -lt $textWidth) {
return -join( $wrapChar, $leadingSpaces, $inputLine, $leadingSpaces,$wrapChar, " ")
} else {
return -join( $wrapChar, $leadingSpaces, $inputLine, $leadingSpaces,$wrapChar)
}
}
}
$scriptRoot = Split-Path -parent $PSCommandPath
. "$scriptRoot\commands.ps1"
SYS64738