Code: Select all
Powershell.exe -noprofile -noexit -command "& {D:\tmp\testargs.ps1 %args%}"
As soon as it contains blanks I have a problem. The following does not work:
Code: Select all
Powershell.exe -noprofile -noexit -command "& {'D:\tmp\test args.ps1' %args%}"
At line:1 char:27
+ & {'D:\tmp\test args.ps1' 'D:\tmp\236 236.pdf'}
+ ~~~~~~~~~~~~~~~~~~~~
Unexpected token ''D:\tmp\236 236.pdf'' in expression or statement.
+ CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : UnexpectedToken
How else can I use a filename (and possibly path) with blanks inside?