From ece139671dc81858d6248ed536823119aae56714 Mon Sep 17 00:00:00 2001 From: Baipyrus Date: Thu, 5 Sep 2024 19:37:54 +0200 Subject: [PATCH] get, append and set to PATH for cli --- install.ps1 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/install.ps1 b/install.ps1 index bdf7600..b302b98 100644 --- a/install.ps1 +++ b/install.ps1 @@ -57,6 +57,11 @@ $assetPath = "$programPath\assets\ICON_Enabled.ico" DownloadFile -url https://raw.githubusercontent.com/Baipyrus/ProxySwitcher/main/assets/ICON_Disabled.ico DownloadFile -url https://raw.githubusercontent.com/Baipyrus/ProxySwitcher/main/assets/ICON_Enabled.ico +# Add program to PATH for cli application +$userpath = [System.Environment]::GetEnvironmentVariable("PATH", "User") +$userpath = $userpath + ";$programDir" +[System.Environment]::SetEnvironmentVariable("PATH", $userpath, "User") + # Create Startmenu Shortcut Write-Host "Creating shortcuts for easy access..." -ForegroundColor Cyan $assetsDir = "assets"