From 4886da99467f994497de07b35d37f9323e6a69af Mon Sep 17 00:00:00 2001 From: mitchell Date: Mon, 28 Oct 2024 15:35:40 -0400 Subject: [PATCH] Log %PATH% that did not contain powershell to aid in diagnosing rollbar issue. --- internal/osutils/shortcut/shortcut_windows.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/osutils/shortcut/shortcut_windows.go b/internal/osutils/shortcut/shortcut_windows.go index 30e6b337d3..365b493077 100644 --- a/internal/osutils/shortcut/shortcut_windows.go +++ b/internal/osutils/shortcut/shortcut_windows.go @@ -1,6 +1,7 @@ package shortcut import ( + "errors" "fmt" "os" "os/exec" @@ -74,6 +75,9 @@ func (s *Shortcut) Enable() error { cmd := exec.Command("powershell.exe", args...) out, err := cmd.CombinedOutput() if err != nil { + if errors.Is(err, exec.ErrNotFound) { + return locale.WrapError(err, "err_prepare_shortcut_powershell_not_found", "Could not create shortcut because powershell was not found on your PATH (searched '{{.V0}}')", os.Getenv("PATH")) + } return locale.WrapError(err, "err_clean_start", "Could not create shortcut. Received error: {{.V0}}", string(out)) }