From 051b501fa732c2b61444fe8c8653aac4aa525dd5 Mon Sep 17 00:00:00 2001 From: dopeuni444 Date: Thu, 31 Jul 2025 13:19:21 +0400 Subject: [PATCH] Refactor Autopilot Mode to Use Global Variable --- PowerShell_AI_Agent/scripts/main.ps1 | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/PowerShell_AI_Agent/scripts/main.ps1 b/PowerShell_AI_Agent/scripts/main.ps1 index 561e3c1..c8371f5 100644 --- a/PowerShell_AI_Agent/scripts/main.ps1 +++ b/PowerShell_AI_Agent/scripts/main.ps1 @@ -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,