0

Im trying to open a ps1 file that is in a UNC folder on the network using a shortcut. it works on a local c: drive with no spaces in the name The shortcut target is set to the below

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

When i click it it doesn't open i have also tried without -windowstyle hidden and still no luck.

im sure i have missed something simple.

1 Answers1

2

You have spaces in the path, you should encapsulate it with quotes and I think you need the -file switch (don't know the other ones you are using) :

C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -file "\\share\info folder\somewhere else\thisfile.ps1"
sodawillow
  • 12,497
  • 4
  • 34
  • 44