Skip to content

Instantly share code, notes, and snippets.

@refactorsaurusrex
Last active August 22, 2023 22:57
Show Gist options
  • Save refactorsaurusrex/4cce03f6fe714db533d6c7bcb5a57444 to your computer and use it in GitHub Desktop.
Save refactorsaurusrex/4cce03f6fe714db533d6c7bcb5a57444 to your computer and use it in GitHub Desktop.
How to open the Windows environment variables dialog with PowerShell

What's this?

It takes waaaay too many clicks to open the Windows environment variables dialog. Wouldn't it be nicer to open it with a quick cli command?

How to use

  1. Copy the code from profile.ps1 to your PowerShell profile script.
  2. Change the alias to your preferred value.
  3. Profit!

Credits

Thanks to this guy for sharing the command that does the magic!

function Get-EnvironmentVariablesDialog {
rundll32 sysdm.cpl,EditEnvironmentVariables
}
Set-Alias EnvGui Get-EnvironmentVariablesDialog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment