Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我知道这必须非常简单,但我发现的一切都是如何恢复另一个文件的路径。我需要得到的是正在运行的 powershell 文件的路径。这样它就可以移动并且仍然可以正常工作。
尝试:
$MyInvocation.MyCommand.Path
$ScriptPath = ($MyInvocation.MyCommand).Path