fix(windows): add null check for ScriptDir in uninstall script detection

Line 166 was calling Test-Path with null ScriptDir when running via irm | iex,
causing 'Cannot bind argument to parameter Path because it is null' error.

Added null check: if ($ScriptDir -and (Test-Path ...)) to safely skip to
standalone mode when ScriptDir is null.
This commit is contained in:
kaitranntt
2025-11-02 02:26:28 -05:00
parent 411d3850a2
commit 6bc6db6f31
+1 -1
View File
@@ -163,7 +163,7 @@ if ($InstallMethod -eq "standalone") {
}
# Install uninstall script
if (Test-Path "$ScriptDir\uninstall.ps1") {
if ($ScriptDir -and (Test-Path "$ScriptDir\uninstall.ps1")) {
# Only copy if source and destination are different
if ($ScriptDir -ne $CcsDir) {
Copy-Item "$ScriptDir\uninstall.ps1" "$CcsDir\uninstall.ps1" -Force