Skip to content

Instantly share code, notes, and snippets.

@jkniiv
Created January 30, 2020 00:11
Show Gist options
  • Save jkniiv/fb0065e09ff26e6fe3091f4baeb48940 to your computer and use it in GitHub Desktop.
Save jkniiv/fb0065e09ff26e6fe3091f4baeb48940 to your computer and use it in GitHub Desktop.
Windows Terminal settings (profiles.json) with an ability to launch an elevated Powershell session via sudo.ps1
{
"$schema": "https://aka.ms/terminal-profiles-schema",
"defaultProfile": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
"profiles":
[
{
// Make changes here to the powershell.exe profile
"guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
"name": "Windows PowerShell",
"commandline": "powershell.exe",
"hidden": false,
"fontSize": 11
},
{
"guid": "{76495e63-b0e4-43c1-a397-fadade202aec}",
"name": "Windows PowerShell (Admin via scoop's sudo.ps1)",
"commandline": "powershell.exe -noprofile -ex unrestricted -file \\scoop\\apps\\sudo\\current\\sudo.ps1 powershell.exe",
"hidden": false,
"colorScheme": "Campbell Powershell",
"fontSize": 11,
"icon": "ms-appx:///ProfileIcons/{61c54bbd-c2c6-5271-96e7-009a87ff44bf}.png"
},
{
// Make changes here to the cmd.exe profile
"guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}",
"name": "CMD",
"commandline": "cmd.exe",
"hidden": false
}
],
// Add custom color schemes to this array
"schemes": [],
// Add any keybinding overrides to this array.
// To unbind a default keybinding, set the command to "unbound"
"keybindings": []
}
@jkniiv
Copy link
Author

jkniiv commented Jan 30, 2020

The above assumes you've installed Scoop (see Scoop.sh) and its 'sudo' package. In my case Scoop is installed in a custom directory 'C:\scoop' (how to do that see Scoop Quick Start but you should change the "commandline" property above to point to your 'sudo.ps1' instance).

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