Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/powershell/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/sharepoint/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Powershell Azure Devops连接到SharePoint Online租户-连接SPOService cmdlet超时_Powershell_Sharepoint_Azure Devops - Fatal编程技术网

Powershell Azure Devops连接到SharePoint Online租户-连接SPOService cmdlet超时

Powershell Azure Devops连接到SharePoint Online租户-连接SPOService cmdlet超时,powershell,sharepoint,azure-devops,Powershell,Sharepoint,Azure Devops,一直在使用Azure DevOps自动化针对SharePoint Online的某些PowerShell脚本。据我所知,我的第一步需要针对该租户进行身份验证。以下是我到目前为止得到的信息: 触发: -主人 游泳池: vmImage:“windows最新版本” 步骤: powershell:安装模块-名称Microsoft.Online.SharePoint.powershell-RequiredVersion 16.0.8029.0-强制 displayName:“安装SP Online Po

一直在使用Azure DevOps自动化针对SharePoint Online的某些PowerShell脚本。据我所知,我的第一步需要针对该租户进行身份验证。以下是我到目前为止得到的信息:

触发: -主人

游泳池: vmImage:“windows最新版本”

步骤:

  • powershell:安装模块-名称Microsoft.Online.SharePoint.powershell-RequiredVersion 16.0.8029.0-强制 displayName:“安装SP Online PowerShell”

  • powershell:$cred=New Object-TypeName System.Management.Automation.PSCredential-argumentlist$env:USERNAME,$(convertto securestring$env:PASSWORD-asplaintext-force) displayName:'从以前的变量中形成凭据变量'

  • powershell:Connect-SPOService-Url https://$env:ORG-admin.sharepoint.com-凭据$cred displayName:“连接到租户”
环境变量username、password和org是在管道中定义的,并且似乎工作正常(例如,在部署这些变量之前,我遇到了不同的错误)。现在,我进入最后一步,它将永远运行,直到我取消它。这就好像它在连接服务上得到了一些提示,当然,我看不到,所以我无法响应

没有错误可以反应,只是坐着旋转,没有结束。我的最后一个错误是connect sposervice不是可识别的cmdlet。为了解决这个问题,我使用了install-module命令并解决了这个问题,所以看起来它现在正确地运行了这个命令(没有错误)

我可以在本地机器上运行所有相同的PowerShell,并且不需要提示或输入任何额外的内容就可以到达那里

有人有什么想法吗


谢谢

您似乎正在跟随以连接到Sharepoint online

注意:当出现Windows PowerShell凭据请求对话框提示时,请键入SharePoint Online SharePoint管理员帐户的密码

使用Microsoft hosted agent运行PowerShell任务时,我们无法访问UI以在dislog框中输入密码。所以这是不支持的方式


相反,您可能会从以下两个文档中获得帮助:和。

除了microsoft hosted agent之外,如果使用自代理运行管道,结果会是什么。您可以在您的计算机中安装一个自代理,并调用它来运行相同的管道,以检查托管代理是否缺少此进程所需的某些组件。嗨,朋友,是否有此问题的更新?