executing (old) windows commands [fixed]

I have (what I think is) a bit of weird case
That turned out to be hard to google

For some reason, powershell, wont properly execute windows commands that are on my path (like for example compilers)
unless i type their name.extension

So for example, I install the rust compiler, so if I type


I get the error commnd not found:

cargo : The term 'cargo' is not recognized as the name of a cmdlet, function, script file, or operable program.

But if i type


the command does get executed, but it gets executed as if in sub-process, so it does get executed in-line in my shell
it pops a new windows, where it executes the command and close rapidly

Weirdness doesnt stop here
I have another account with admin privilige, this one works fine, I dont have this issue

Also i checked the $env:path variable, it is fine, and again proof of this, is that cargo.exe does … kinda … work

Is there a setting, that I changed for some reason, and forgot about that is causing this behavior

I cannot think of any setting off the top of my head, you could have done on purpose / by accident, via the Console Host, ISE or VSCode terminal that would cause what you are seeing.

However, if you are using external commands, you really need to add the extension (in most cases a .exe) to avoid any confusion about what you are trying to run.

Also, in general they must approach a specific way. Here are two articles on the topic.

Using PowerShell and external commands and their parameters or switches.



thanks for the links
but i dont think they match my case

i know that calling windows commands, was working before, but suddenly it stopped
i must have set something

but as i say, what is weird, is that on the same machine, the user with admin privilige work fine
this is why i dont think it can be because i have installed something
because it would have been the same problem for all users on my computer

So, this fail is when you are calling your commands from the console host, the ISE or in VSCode?

You can run code in the console host and the ISE to reset them back to their defaults to see if that resolves you issues.

You can get the default settings from any other machine, and use that to reset yours.

If you are using profiles in each, either remove them, are start PoSH using the -noprofile parameter.

PS C:\Users\...\bin> Test-Path $profile

it seems i dont even have a profile set, for this to be possibly a settings issues

More updates

I installed powershell 6
And I am getting almost the same behavior

windows command wont execute, with my none admin account, unless i add the .exe part
some command such as ping, i cant figure a way to execute them (ping.exe wont work for example)

pwsh6 is only different from powershell 5 in that windows command (after i added their extension) will execute in
the current shell, on powershell 5, they pop-up a new shell windows

again, to be clear, my account with admin privileges works fine


it fixed itself, or i fixed it, i have no clue
but i uninstalled Idera Powershell Plus, and then restarted the computer

the computer also coincidentally installed some windows updates

but now i no longer have this issue
i think that idera powershell plus, might have been it … but … again
cannot be 100% sure