Comments (9)
Good idea!
I modify the naming at a7bbd8e
Thanks
from windows-terminal-context-menu.
This works for me
powershell -WindowStyle hidden -Command "Start-Process powershell -WindowStyle hidden -Verb RunAs -ArgumentList """"-Command C:\Users\Meegoo\AppData\Local\Microsoft\WindowsApps\wt.exe -p 'Windows PowerShell' -d '%V'"""""
Replace path to wt with your own (or just use wt
, it should be a proper alias) and profile with ones you want.
If anyone can find a better way to escape quotes in this monstrocity, be my guest. Took me like an hour to figure those ones out. And implementing this in yet another powershell script isn't gonna be fun.
Also, might just be me, but first "-WindowStyle hidden" seems broken. It still shows me powershell window, albeit for a slightly shorter period of time. minimized
also works badly, it starts as usual, and only then minimizes, making it even more annoying than hidden
Alternatively, you can add actual administrator profiles using third party executable and just use those as normal microsoft/terminal#1032 (comment). However, keep in mind that gsudo probably opens up some attack vectors because Windows doesn't exactly support this usecase
PS. Also, unfortunately, new tabs in elevated Terminal always start at C:\Windows\system32, this is a "Windows thing". So if this bothers you, elevated profiles from above should help.
from windows-terminal-context-menu.
I have tried the following method.
But all of them are failed.
- Add
HasLUAShield
for menu item - Executable powershell command
Start-Process wt.exe -Verb runAs
Does anyone have any suggestion?
from windows-terminal-context-menu.
Hi all,
I have implemented this function.
You can give it a try 4fe75b6 😉
The RunAs item is closed by default, you have to turn it on in config.json
Such like that
{
"profiles": {
"{61c54bbd-c2c6-5271-96e7-009a87ff44bf}": {
"showRunAs": true
}
}
}
Thanks
from windows-terminal-context-menu.
This ^
from windows-terminal-context-menu.
Thanks
from windows-terminal-context-menu.
Thank you @Meegooo
I love gsudo solution, it's a simple way.
But gsudo is a external program, this make this script no independent.
from windows-terminal-context-menu.
For me it currently shows Run as PowerShell
:
I'd suggest you to put PowerShell (Admin)
, so then it would look like the native Windows Win
+X
menu:
from windows-terminal-context-menu.
Awesome!
from windows-terminal-context-menu.
Related Issues (20)
- Add Context Menu to Drives HOT 1
- Open as Tab on a existing Terminal window HOT 4
- Does not work if username has a space in between HOT 1
- i'm sorry, please delete this
- Adding Git Bash does not work HOT 2
- Option to show the menu on Shift-RightClick HOT 2
- Directory Paths not working for Cygwin HOT 7
- Admin Terminal Option HOT 1
- Add keyboard shortcut
- Error while installing firebase packages into flutter project HOT 1
- File doesn't have app associated with it HOT 4
- Icons in windows terminal dont show up unless launched as admin HOT 1
- Need to add bash support HOT 1
- No submenu
- Not working with Windows Terminal Preview HOT 2
- Could not find path
- Git Bash default icon on context menu is replaced by unknown.ico HOT 1
- Run-As window flashes during execution
- Does not work for custom added terminals HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from windows-terminal-context-menu.