0
如果我创建计划任务时启动的PowerShell脚本是这样的:指定路径的脚本放慢参数在计划任务
Powershell -command "& 'C:\test.ps1'"
我如何可以把一个路径参数中的一个参数不中断-command
参数?
Powershell -command "& 'C:\test.ps1 -path C:\Program Files(x86)\test'"
是行不通的,因为它找不到"C:\Program"
Powershell -command "& 'C:\test.ps1 -path 'C:\Program Files(x86)\test''"
or
Powershell -command "& 'C:\test.ps1 -path "C:\Program Files(x86)\test"'"
是行不通的,因为包裹路径引号会中断-command
参数
你应该指定'-file'而不是'-command' – Avshalom
@Avshalom'-file“C:\ script.ps1 -path'C:\ test'”'这样吗? – SimonS