From 89989130c52635bc0e845dafaeef2ccf71cef305 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Tue, 29 Apr 2025 20:22:56 +0000 Subject: [PATCH] Fix PowerShell installation error with global drive Co-Authored-By: jhaynie@agentuity.com --- install.ps1 | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/install.ps1 b/install.ps1 index 1a04a029..4fa8e1d0 100644 --- a/install.ps1 +++ b/install.ps1 @@ -287,7 +287,6 @@ function Add-ToPath { # Refresh PowerShell's command discovery to make the command immediately available # This creates a temporary function with the same name as the executable to force PowerShell to refresh $exeName = "agentuity" - $tempFunctionName = "global:$exeName" # Remove any existing function with this name first if (Get-Command $exeName -ErrorAction SilentlyContinue) { @@ -304,8 +303,8 @@ function Add-ToPath { Remove-Item -Path "Function:\$exeName" -ErrorAction SilentlyContinue } - # Register the function - Set-Item -Path $tempFunctionName -Value $scriptBlock -Force + # Register the function using the Function: drive instead of global: scope + Set-Item -Path "Function:\$exeName" -Value $scriptBlock -Force Write-Success "Command '$exeName' is now available in the current PowerShell session" }