I have a PowerShell file x.ps1. This is called up by a link.
(Get-Location) .Path I read my current directory. This is output differently when I run the code directly in the ps1 file than when I call the ps1 file through the link.
Give it another command so I can get my current directory. That of the ps1 file. No matter how I call it. Or is there a way in the ps1 file to determine by code whether this file is executed itself or is started by a shortcut?