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)
try {
$Config.Autopilot.Enabled = $false
$script:AutopilotEnabled = $false
Write-Host "🤖 Autopilot mode disabled" -ForegroundColor Yellow
return $true
}
catch {
Write-Error "Failed to disable autopilot mode: $_"
return $false
}
}
# Main command processing
# Command processing function
function Process-Command {
param(
[string]$Command,