Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
36 lines (30 sloc) 1.46 KB
$siteUrl = Read-Host -Prompt "Enter the site url"
#if using MFA or ADFS, replace '' with your real domain
if($siteUrl -like '**') {
Connect-PnPOnline -url $siteUrl -UseWebLogin
else {
Connect-PnPOnline -url $siteUrl -Credentials (Get-Credential)
function ProvisionLists() {
Write-Host ""
Write-Host "Provisioning Site Columns, Content Types, & Lists" -ForegroundColor Yellow
Write-Host "-------------------------------------------------" -ForegroundColor Yellow
Write-Host "Global Nav List" -ForegroundColor Green
Apply-PnPProvisioningTemplate ".\GlobalNavList\definition.xml"
Write-Host "Provisioning done" -ForegroundColor Blue
function ConfigureLookupField() {
Write-Host "Adding Lookup Field" -ForegroundColor Green
$globalNavList = Get-PnPList -Identity "Lists/GlobalNavList"
if(!$globalNavList) {
Write-Host "Could not find the list to connect the lookup field. Check that the Global Nav list exists.";
else {
$fieldXml = "<Field ID='{068992B0-C110-411E-A152-4C17E17E43DE}' Name='GlobalNavParent' StaticName='GlobalNavParent' DisplayName='Parent' Group='Global Nav Site Columns' Required='false' Type='Lookup' List='"+ $globalNavList.Id +"' ShowField='Title' Overwrite='TRUE' OverwriteInChildScopes='TRUE' />"
Add-PnPFieldFromXml -List "Global Nav List" -FieldXml $fieldXml -ErrorAction "SilentlyContinue"
You can’t perform that action at this time.