#VS Code issue but works in ISE
1 messages ยท Page 1 of 1 (latest)
I would not run VSCode as administrator, personally. It would mean any extensions you use ran as administrator too, and I don't trust them that much.
But in vscode, normally, you would have your default working directory be the folder you're working from.
What do you want? You want c:\windows\system32 as your default working directory in vscode? This post might help? https://stackoverflow.com/a/69101443/14905075
This might be helpful to keep your terminal working directory to the file you are currently editing.
https://stackoverflow.com/a/56222855/14905075
The original post (now deleted) was about an assembly load problem in vscode. The admin stuff was just extra info about how they were running things
I see.
sorry I had resolved the problem shortly after posting and thought I had deleted everything
but how do you gain an admin powershell terminal without launching as admin?
you cannot, you need to launch the process as admin
I wouldn't do administration from vscode, that's all
What about with a custom profile that only has the PowerShell extension installed? ๐
Maybe, but I'm not sure what the point would be?
If your concern is the extension ecosystem doing something nefarious with your admin session, eliminate the extension ecosystem ๐
Sure, but how does being in Code help you admin, vs being in Terminal?
testing a script that requires admin
more importantly debugging one ๐
I mean yeah sure you can terminal debug like a wizard but why not have the full power?
Fair enough. I'm out of touch out here in cloud/k8s land -- almost the only thing I do elevated is choco upgrade all
I will agree that making it admin always is wrong though ๐
I'd still avoid using vs code as admin, just like I always avoided running VS as admin when I was a .NET dev ๐
sometimes you have to, fair enough -- but yeah, in VS Code, I would definitely use a special profile with reduced extensions
Agreed, most of my stuff is done remote or thru an API so it doesn't matter, but for testing something like a desktop installation script that has to be pushed via SCCM or something I don't have an issue with it.
I'd also do it if I had to god forbid interactively work on a server directly with admin rights, I use the code CLI to get a remote tunnel so I'm using VSCode and not RDP or SSH
Code CLI is super portable and easy to do that with, I even have a bootstrap bit.ly script on my gists
Psedit is nice for remote file mods in vscode as admin.