Typically in my scripts, I use the following to get the name of the current script (without the extension):
$baseName = (Get-Item $PSCommandPath).BaseName
For some reason, this (and every other way I can think of to get the name of the running script) is not working when the script is packaged as an executable. I am using Powershell Pro Tools with VS Code to package the script. While I could just hard code the base code, I would prefer not to. Is there anything I can do to get around this? Any way to get the name of the executable, even though it is in reality a script?
Thanks