Refactor Autopilot Mode to Use Global Variable

This commit is contained in:
dopeuni444 2025-07-31 13:19:21 +04:00
parent efc6bad638
commit 051b501fa7

View File

@ -252,17 +252,15 @@ function Disable-AutopilotMode {
param([object]$Config) param([object]$Config)
try { try {
$Config.Autopilot.Enabled = $false $script:AutopilotEnabled = $false
Write-Host "🤖 Autopilot mode disabled" -ForegroundColor Yellow Write-Host "🤖 Autopilot mode disabled" -ForegroundColor Yellow
return $true
} }
catch { catch {
Write-Error "Failed to disable autopilot mode: $_" Write-Error "Failed to disable autopilot mode: $_"
return $false
} }
} }
# Main command processing # Command processing function
function Process-Command { function Process-Command {
param( param(
[string]$Command, [string]$Command,