我需要从VSTS Build执行SharePoint Online PowerShell脚本 .
对于本地计算机,我们使用以下内容执行创建列表等的SharePoint Online PowerShell脚本 .
Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.dll"
Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.Runtime.dll"
我想我们需要用以下内容替换上面的内容
Import-Module Microsoft.Online.SharePoint.Powershell
在构建的powershell任务中 .
导入模块的Cmdlet Microsoft.Online.SharePoint.Powershell是指本地计算机中文件夹** C:\ Program Files \ SharePoint Online Management Shell **中的文件 .
如何引用SharePoint Online Management Shell文件,并在VSTS构建任务中执行PowerShell脚本,以在SharePoint Online上创建站点列,列表等?
1 回答
您可以在其中一台网络计算机上设置私有代理 . 然后在其上安装所需的依赖项 . 这应该工作 .
请参阅https://docs.microsoft.com/en-us/vsts/build-release/actions/agents/v2-windows?view=vsts以了解如何操作 .