0

I usually use the shortcut described here: How do I start PowerShell from Windows Explorer? to open a PS session in a specific folder. Just using powershell to open the sessions

However is no longer working, every time I write powershell on the address bar and hit enter it take me to the folder: C:\Users\MyUser\Documents\PowerShell (I'm in a Windows 10 laptop)

It seems to be related only to this shortcut as I have tried a few other things and they work. List of things I have tried/checked already below:

  • powershell -noprofile it work opening a PS session as expected
  • No, my $Profile file does not have anything to set the location of the PS Session.
  • powershell.exe works as expected
  • powershell_ise works as expected
  • going to File --> Open Windows Powershell works as expected
  • Checked my environment variables and nothing strange there either
Erick Guillen
  • 547
  • 4
  • 11
  • Not that this solves your problem but it might give you some clues. First, this works on my Windows 10 pro machine. Second, I used process explorer to look at the command line passed to the instance and there wasn't one. It gets the startup directory using the current working directory used by CreateProcess(). – Señor CMasMas Dec 04 '19 at 16:28

1 Answers1

0

It seems to be related to the fact that I installed PS core 6 recently. This installation introduced the folder C:\Users\MyUser\Documents\PowerShell (it's a new folder vs the ones that existed with Windows Powershell) and that's why the windows explorer now opens a folder instead of the command line.

I suppose I will need to get used to powershell.exe instead of powershell from now on.

Erick Guillen
  • 547
  • 4
  • 11
  • Delete or rename this folder? If it is in your Documents folder, it shouldn't be tied to anything specific. – Señor CMasMas Dec 04 '19 at 16:29
  • Delete is not an option as it's required for the PS Core to load custom modules and scripts (its purpose is like `C:\Users\MyUser\Documents\WindowsPowerShell` in regular PS). Rename is an option but need to have in consideration that renaming it will mean is also needed to update the configurations in PS Core to load from the renamed folder and do not expect the original. It seems quite a lot of trouble vs just using the `powershell.exe` – Erick Guillen Dec 04 '19 at 16:33
  • Without checking.. I would bet it is nothing more than a registry key. – Señor CMasMas Dec 04 '19 at 16:41