mirror of
https://github.com/Raphire/Win11Debloat.git
synced 2026-02-17 07:56:24 +00:00
Minimize Win11Debloat powershell window when not running CLI mode
This commit is contained in:
9
Get.ps1
9
Get.ps1
@@ -140,8 +140,15 @@ $arguments = $($PSBoundParameters.GetEnumerator() | ForEach-Object {
|
|||||||
Write-Output ""
|
Write-Output ""
|
||||||
Write-Output "> Running Win11Debloat..."
|
Write-Output "> Running Win11Debloat..."
|
||||||
|
|
||||||
|
# Minimize the powershell window when CLI is not specified
|
||||||
|
if (-not $CLI) {
|
||||||
|
$windowStyle = "Minimized"
|
||||||
|
} else {
|
||||||
|
$windowStyle = "Normal"
|
||||||
|
}
|
||||||
|
|
||||||
# Run Win11Debloat script with the provided arguments
|
# Run Win11Debloat script with the provided arguments
|
||||||
$debloatProcess = Start-Process powershell.exe -PassThru -ArgumentList "-executionpolicy bypass -File $env:TEMP\Win11Debloat\Win11Debloat.ps1 $arguments" -Verb RunAs
|
$debloatProcess = Start-Process powershell.exe -WindowStyle $windowStyle -PassThru -ArgumentList "-executionpolicy bypass -File $env:TEMP\Win11Debloat\Win11Debloat.ps1 $arguments" -Verb RunAs
|
||||||
|
|
||||||
# Wait for the process to finish before continuing
|
# Wait for the process to finish before continuing
|
||||||
if ($null -ne $debloatProcess) {
|
if ($null -ne $debloatProcess) {
|
||||||
|
|||||||
Reference in New Issue
Block a user