在 azure release 管道上运行命令时出现此错误。
管道正在本地服务器上运行。我能够从服务器执行命令,但 azure 代理无法运行它。
这里是完整的日志:
2021-11-17T10:22:04.1713762Z ##[command]"C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" -NoLogo -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -Command ". 'C:\azagent\A1\_work\_temp\9283112d-f24e-4a23-a9cb-5f4a9ddbf609.ps1'"
2021-11-17T10:22:04.9965126Z VERBOSE: Loading module from path 'C:\Program
2021-11-17T10:22:04.9969014Z Files\WindowsPowerShell\Modules\SqlServer\21.1.18226\Microsoft.SqlServer.Management.PSSnapins.dll'.
2021-11-17T10:22:05.1903160Z Invoke-Sqlcmd : The 'Invoke-Sqlcmd' command was found in the module 'SqlServer', but the module could not be loaded.
2021-11-17T10:22:05.1904438Z For more information, run 'Import-Module SqlServer'.
2021-11-17T10:22:05.1905465Z At C:\azagent\A1\_work\_temp\9283112d-f24e-4a23-a9cb-5f4a9ddbf609.ps1:5 char:1
2021-11-17T10:22:05.1906570Z + Invoke-Sqlcmd -InputFile "C:\azagent\A1\_work\r3\a\_main\docker-windo ...
2021-11-17T10:22:05.1907306Z + ~~~~~~~~~~~~~
2021-11-17T10:22:05.1908214Z + CategoryInfo : ObjectNotFound: (Invoke-Sqlcmd:String) [], ParentContainsErrorRecordException
2021-11-17T10:22:05.1909889Z + FullyQualifiedErrorId : CouldNotAutoloadMatchingModule