如何在VSTS上运行SharePoint Online PowerShell脚本

时间:2018-03-01 10:10:32

标签: powershell sharepoint azure-devops office365 sharepoint-online

我需要从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任务中。

导入模块Microsoft.Online.SharePoint.Powershell 的Cmdlet是指本地计算机中文件夹** C:\ Program Files \ SharePoint Online Management Shell **中的文件。

如何引用SharePoint Online Management Shell文件,并在VSTS构建任务中执行PowerShell脚本,以在SharePoint Online上创建站点列,列表等?

1 个答案:

答案 0 :(得分:0)

您可以在其中一台网络计算机上设置私人代理。然后在其上安装所需的依赖项。这应该有用。

请参阅https://docs.microsoft.com/en-us/vsts/build-release/actions/agents/v2-windows?view=vsts了解如何操作。