unc 路径上 ps1 文件的快捷方式不起作用

Shortcut to ps1 file on unc path not working

我正在尝试使用快捷方式打开网络上 UNC 文件夹中的 ps1 文件。 它适用于名称中没有空格的本地 c: 驱动器 快捷目标设置为下面

C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -windowstyle hidden \share\info folder\somewhere else\thisfile.ps1

当我点击它时它没有打开我也尝试过不隐藏 -windowstyle 但仍然没有成功。

我确定我错过了一些简单的东西。

你的路径中有空格,你应该用引号将它括起来,我认为你需要 -file 开关(不知道你正在使用的其他开关):

C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -file "\share\info folder\somewhere else\thisfile.ps1"