mirror of
https://github.com/Raphire/Win11Debloat.git
synced 2026-08-21 23:26:42 +00:00
23 lines
488 B
PowerShell
23 lines
488 B
PowerShell
<#
|
|
.SYNOPSIS
|
|
Waits for user acknowledgement, then exits the script.
|
|
|
|
.PARAMETER ExitCode
|
|
Process exit code to return after acknowledgement. Defaults to 0.
|
|
#>
|
|
function Wait-ForKeyPress {
|
|
param(
|
|
[int]$ExitCode = 0
|
|
)
|
|
|
|
# Suppress prompt if Silent parameter was passed
|
|
if (-not $Silent) {
|
|
Write-Output ""
|
|
Write-Output "Press any key to exit..."
|
|
$null = [System.Console]::ReadKey()
|
|
}
|
|
|
|
Stop-Transcript
|
|
Exit $ExitCode
|
|
}
|