1

I recently started using PowerToys Run and I've noticed that I can no longer use some commands when launching Powershell (7.2.6) via PTR vs just running it out of the start menu.

Turns out, my $env:path is different depending on which way I launch Powershell. Why is my path different, and what is the best way that I can make sure that I have access to the same paths no matter how I open PWSH?

1 Answers1

1

A child process inherits the environment of its parent. It seems like PowerToys Run modifies its PATH variable before executing PowerShell.

The only way to avoid it might be to set up a script that will be always run when PowerShell is started.

This is described in the post Run Powershell script when you open Powershell.

Your script for PowerShell could then set the PATH to your preferred path.

harrymc
  • 498,455