Skip to content

Powershell issues when VSCode run as another user #2825

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

Closed
SilentlyContinue27 opened this issue Jul 22, 2020 · 2 comments
Closed

Powershell issues when VSCode run as another user #2825

SilentlyContinue27 opened this issue Jul 22, 2020 · 2 comments

Comments

@SilentlyContinue27
Copy link

SilentlyContinue27 commented Jul 22, 2020

Greetings,

I run VSCode as another user via “Run As Administrator” with my domain credentials. I’ve been noticing several issues with the PowerShell extension while doing this.

1: Run Selection does not work, either via F8 on the keyboard or right-click and “Run Selection.” Copy and paste code into the terminal works fine.

2:The VSCode log command requested for this post ( >PowerShell: Upload Bug Report To Github ) fails with VSCode popup error “Command ‘PowerShell: Upload Bug Report To Github’ resulted in an error (command ‘PowerShell.GenerateBugReport’ not found)

3: The troubleshooting code requested for this post:
[
& {"### VSCode version: $(code -v)"; "n### VSCode extensions:n$(code --list-extensions --show-versions | Out-String)"; "n### PSES version: $($pseditor.EditorServicesVersion)"; "n### PowerShell version:`n$($PSVersionTable | Out-String)"}
]
errors with the following PowerShell errors:
[
code : The term 'code' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path
was included, verify that the path is correct and try again.
At line:1 char:27

  • & {"### VSCode version: $(code -v)"; "n### VSCode extensions:n$(cod ...
  •                       ~~~~
    
    • CategoryInfo : ObjectNotFound: (code:String) [], CommandNotFoundException
    • FullyQualifiedErrorId : CommandNotFoundException

VSCode version:

code : The term 'code' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path
was included, verify that the path is correct and try again.
At line:1 char:67

  • ... SCode version: $(code -v)"; "n### VSCode extensions:n$(code --list- ...
  •                                                          ~~~~
    
    • CategoryInfo : ObjectNotFound: (code:String) [], CommandNotFoundException
    • FullyQualifiedErrorId : CommandNotFoundException

VSCode extensions:

nothing to see here, despite having the PowerShell extension V2020.6 installed…

PSES version:

PowerShell version:

Name Value


PSVersion 5.1.18362.752
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.18362.752
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1

]

All of the above function correctly when running VScode as my logged in user (Double-clicking VScode to start) rather than as another user (Right Click > Run As Admin).
I’ve been able to produce this on both of my workstations using the same versioning below. I’m curious if I have managed to mess something up or if anyone else can reproduce the issue.
Unfortunately, I am unable to attach a log due to issue 2 above. I would be happy to send logs if anyone can help me do so.

System Details

VS Code Version: 1.47.2, User and System Versions attempted, x64.
PowerShell Extension Version: v2020.6.0 (also tested with preview v2020.6.1. Only one extension installed at a given time.)
WinVer: Windows 10 1909 (OS Build 18363.959)

PSES version:

PowerShell version:

Name Value


PSVersion 5.1.18362.752
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.18362.752
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1

@ghost ghost added the Needs: Triage Maintainer attention needed! label Jul 22, 2020
@corbob
Copy link
Contributor

corbob commented Jul 22, 2020

When you say code version 1.4.7.2, do you mean 1.47.2? I believe this is the issue seen here: #2808 and will be resolved in code 1.47.3.

@SilentlyContinue27
Copy link
Author

@corbob, yes 1.47.2 (Corrected in op). #2808 does sound like this issue. I will close this for now and monitor that. Thanks!

@SydneyhSmith SydneyhSmith removed the Needs: Triage Maintainer attention needed! label Jul 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants