-
Notifications
You must be signed in to change notification settings - Fork 8.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Powershell as Admin - Ignoring system path variable #14686
Comments
What's the environment in each type of session (elevated vs unelevated)? I just wanna see if there's anything immediately obvious about the difference that jumps out. How are you running the Terminal as admin? Via some mechanism in the OS (like right-clicking on the taskbar, or via the Start Menu), or are you using the Terminal's built-in "run this profile elevated" functionality/? (note to self: this isn't going to be a defterm thing, cause obviously, defterm doesn't work for an elevated powershell.exe) |
HI, Sorry, i'm not following specifically what you mean by environment here. I'm on a Windows 11 machine, with local admin rights to the machine. (sorry if I'm being dense). I'm using Terminals inbuilt 'Run this profile as Administrator' option. Regards, Steve D. |
Oh sorry, I meant |
Ahh! I see... I have simply added a folder to the path variable. In the path below, it's highlighted in bold text. PATH=C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\WINDOWS\System32\OpenSSH;%ONEDRIVE%\Documents\Code_Script;C:\Users\SDavison\AppData\Local\Microsoft\WindowsApps;;C:\Users\SDavison\AppData\Local\Programs\Microsoft VS Code\bin |
Sorry, to extra clarify - is that the What's the |
This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. |
That's the system environment PATH, its from neither window. |
Gotcha - so, what does PATH look like in each of an elevated/unelevated window/? Maybe there's some diff in one of those PATHs (when compared to what it should be) that might give us a clue as to where the issue is originating. This might get better in 1.17 after #14637, so I might also have you try out that build (when we release it later today) |
This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. |
Windows Terminal version
1.15.3466.0
Windows build number
Version 10.0.22000.856
Other Software
No response
Steps to reproduce
Windows Powershell (elevated to admin) reads the PATH system variable and uses the items within correctly. (I have a custom scripts folder which I call all the time, so it's easier to just type the command)
With a Powershell tab in Terminal, running as admin, doesn't seem to do this by default,
Expected Behavior
I should be able to reference my powershell scripts directly without using the full path.
Actual Behavior
Powershell in Terminal cannot find the scripts, and gives a standard "unable to find" error.
The text was updated successfully, but these errors were encountered: