I am running the following command as part of a test code trying to determine if a script is running in an interactive session (i.e. with a CLI) or if from a console-less remote session (SSH,SCP,FTP).
So when using [Environment]::GetCommandLineArgs(), in a Powershell Core (pwsh.exe) CLI session, I get: C:\Program Files\PowerShell\6\pwsh.dll. This is surprising as I would have expected to get pwsh.exe and not a DLL.
Why do I get the DLL and not the EXE?
What is going on?