Update RemoveWindowsAi.ps1
This commit is contained in:
@@ -70,25 +70,6 @@ If (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]:
|
|||||||
Add-Type -AssemblyName PresentationFramework
|
Add-Type -AssemblyName PresentationFramework
|
||||||
Add-Type -AssemblyName System.Windows.Forms
|
Add-Type -AssemblyName System.Windows.Forms
|
||||||
|
|
||||||
Function Wait-ForKeyOrTimeout {
|
|
||||||
param (
|
|
||||||
[int]$Timeout = 10
|
|
||||||
)
|
|
||||||
|
|
||||||
for ($i = $Timeout; $i -ge 0; $i--) {
|
|
||||||
Write-Host -NoNewline "`rPress any key to close... (Closing in $i seconds) "
|
|
||||||
|
|
||||||
if ([System.Console]::KeyAvailable) {
|
|
||||||
[void][System.Console]::ReadKey($true)
|
|
||||||
Write-Host "`rKey pressed, exiting countdown... " # Clear line with spaces
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
Start-Sleep -Seconds 1
|
|
||||||
}
|
|
||||||
Write-Host "`rPress any key to close... (Closing in 0 seconds) " # Clear the last countdown
|
|
||||||
}
|
|
||||||
|
|
||||||
function Run-Trusted([String]$command, $psversion) {
|
function Run-Trusted([String]$command, $psversion) {
|
||||||
|
|
||||||
if ($psversion -eq 7) {
|
if ($psversion -eq 7) {
|
||||||
@@ -2083,6 +2064,4 @@ if ($ogExecutionPolicy) {
|
|||||||
Reg.exe add 'HKLM\SOFTWARE\Policies\Microsoft\Windows\PowerShell' /v 'ExecutionPolicy' /t REG_SZ /d $ogExecutionPolicy /f >$null
|
Reg.exe add 'HKLM\SOFTWARE\Policies\Microsoft\Windows\PowerShell' /v 'ExecutionPolicy' /t REG_SZ /d $ogExecutionPolicy /f >$null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Wait-ForKeyOrTimeout -Timeout 3
|
|
||||||
exit
|
exit
|
||||||
Reference in New Issue
Block a user