我想在Microsoft Management Studio中执行PowerShell脚本。但是我有一个错误。在下面查看更多详细信息:
EXEC master..xp_cmdshell '%SYSTEMROOT%System32WindowsPowerShellv1.0powershell.exe -ExecutionPolicy unrestricted -command "C:tmp_estest.ps1"'
C:tmp_estest.ps1 : The term 'C:tmp_estest.ps1' is not recognized as the
name of a cmdlet, function, script file, or operable program. Check the
spelling of the name, or if a path was included, verify that the path is
correct and try again.
将-Command
更改为-File
EXEC master..xp_cmdshell '%SYSTEMROOT%System32WindowsPowerShellv1.0powershell.exe -ExecutionPolicy unrestricted -File "C:tmp_estest.ps1"'