Skip to content

Feature Request: Ability to open the terminal with elevated privilages #582

Open

Description

System Details

  • VSCode Version: Code 1.10.2 (8076a19fdcab7e1fc1707952d652f0bb6c6db331, 2017-03-08T14:02:52.799Z)
  • OS Version: Windows_NT ia32 10.0.14393
  • Extensions:
Extension Author Version
vscode-yaml-validation djabraham 0.0.1
githistory donjayamanne 0.2.0
chocolatey-vscode gep13 0.2.2
PowerShell ms-vscode 0.10.1
Chef Pendrica 0.6.2
Ruby rebornix 0.10.4
vscode-icons robertohuertasm 7.4.0
MDTools seanmcbreen 1.0.0
code-settings-sync Shan 2.6.1
code-spell-checker streetsidesoftware 1.0.1
Name                           Value
----                           -----
PSVersion                      5.1.14393.0
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.14393.0
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Issue Description

Is there a way to open the new PS Terminal as an admin/elevated privileges without opening VS Code as an admin? If not, can that be added into the extension so that I don't have to open VS Code as an admin in order to have admin rights in the terminal? Opening VS Code as an admin causes issues with opening/running other files from outside the application.

Attached Logs

Follow the instructions in the README
about capturing and sending logs.

Activity

  1. rkeithhill commented on Mar 20, 2017

    @rkeithhill
    Contributor

    As a work-around (for now), you can attach to a PowerShell console that you have started elevated when debugging.

  2. added
    Issue-Enhancement
    on Mar 20, 2017
  3. added this to the milestone on Mar 20, 2017
  4. daviwil commented on Mar 20, 2017

    @daviwil
    Contributor

    I looked into this in the past, seemed like it might not be possible for a non-elevated process (VS Code) to attach to the console output of an elevated process (PowerShell). I'll give it one more shot at some point just to make sure.

  5. iesen commented on Nov 14, 2017

    @iesen

    i tried that and it gives me following error

    Enter-PSHostProcess : Unable to connect to application domain name DefaultAppDomain of 
    process xxx.  Error: Access is denied.
    
  6. sqlsolver commented on Dec 5, 2017

    @sqlsolver

    Even when opening VSCode as an admin, the PShell console is not running elevated. This should be fixed.

  7. rkeithhill commented on Dec 6, 2017

    @rkeithhill
    Contributor

    SQL Solver (@sqlsolver) I can't repro what you're seeing. When I started VSCode as admin, both the regular PowerShell terminal and the PowerShell Integrated Terminal run as admin as well.

  8. sqlsolver commented on Dec 6, 2017

    @sqlsolver

    I was getting a non-admin error when running Import-Module. My VS Code taskbar shortcut is set to run as admin, however I had three instances open and the one without admin privilege was apparently opened from 'New Window' in the taskbar slide-up vs. the regular shortcut. When VS Code is opened from the shortcut set to run as admin you are correct, the shell is running as admin also. Thanks for your quick response to my comment.

  9. modified the milestone: on May 24, 2018
  10. removed this from the milestone on Jan 26, 2021
  11. carrchri commented on Nov 25, 2026

    @carrchri

    It would be great to have a new button 'Run as admin' next to the 'Run' button. I have a lot of script and some must be started as admin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-Enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions