Last active
December 15, 2018 21:15
-
-
Save garrytrinder/6606cfd9b74da5cb0f413be75ebc177d to your computer and use it in GitHub Desktop.
Azure Automation Basic PnP Provisioning Runbook
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Param( | |
[Parameter(Mandatory=$true)] | |
[string]$CredentialName, | |
[Parameter(Mandatory=$true)] | |
[string]$SiteUrl, | |
[Parameter(Mandatory=$true)] | |
[xml]$Template | |
) | |
# Store XML Template as local file | |
$Template.save("$home\template.xml") | |
# Create connection to SharePoint site | |
$Connect = Connect-PnPOnline -Url $SiteUrl -Credentials (Get-AutomationPSCredential -Name $CredentialName) | |
# Apply PnP Provisioning Template | |
$ApplyPnPProvisioningTemplate = Apply-PnPProvisioningTemplate -Path "$home\template.xml" -Wait | |
# Clean up SharePoint connection | |
$Disconnect = Disconnect-PnPOnline |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment