diff --git a/Content Types/Display Forms/Find Custom Display Forms Deployed/ModifyDisplayFormUrl-FindCustomFormsDeployed.ps1 b/Content Types/Display Forms/Find Custom Display Forms Deployed/ModifyDisplayFormUrl-FindCustomFormsDeployed.ps1 index 287d882d..66cc998c 100644 --- a/Content Types/Display Forms/Find Custom Display Forms Deployed/ModifyDisplayFormUrl-FindCustomFormsDeployed.ps1 +++ b/Content Types/Display Forms/Find Custom Display Forms Deployed/ModifyDisplayFormUrl-FindCustomFormsDeployed.ps1 @@ -1,50 +1,35 @@ -function Set-SPOContentType -{ - - param ( - [Parameter(Mandatory=$true,Position=1)] +function Set-SPOContentType{ + param ( + [Parameter(Mandatory=$true,Position=1)] [string]$Username, [Parameter(Mandatory=$true,Position=2)] $AdminPassword, - [Parameter(Mandatory=$true,Position=3)] + [Parameter(Mandatory=$true,Position=3)] [string]$Url - ) - - $ctx=New-Object Microsoft.SharePoint.Client.ClientContext($Url) - $ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Username, $AdminPassword) - $ctx.Load($ctx.Web.Lists) - $ctx.ExecuteQuery() - - - - foreach($ll in $ctx.Web.Lists) - { - Write-Host $ll.Title -ForegroundColor Green - $ctx.Load($ll.ContentTypes) - $ctx.ExecuteQuery() - foreach($cc in $ll.ContentTypes) - { - - if($cc.DisplayFormUrl -ne "") - { - Write-Host "Content type name: "$cc.Name - Write-Host "The Custom url: " $cc.DisplayFormUrl - } - # $cc.DisplayFormTemplateName="DocumentForm" - # $cc.Update($false) - # $ctx.ExecuteQuery() - - - - } - } - - - - $ctx.Dispose() - - - } + ) + + $ctx=New-Object Microsoft.SharePoint.Client.ClientContext($Url) + $ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Username, $AdminPassword) + $ctx.Load($ctx.Web.Lists) + $ctx.ExecuteQuery() + + foreach($ll in $ctx.Web.Lists){ + Write-Host $ll.Title -ForegroundColor Green + $ctx.Load($ll.ContentTypes) + $ctx.ExecuteQuery() + foreach($cc in $ll.ContentTypes){ + if($cc.DisplayFormUrl -ne ""){ + Write-Host "Content type name: "$cc.Name + Write-Host "The Custom url: " $cc.DisplayFormUrl + } + # $cc.DisplayFormTemplateName="DocumentForm" + # $cc.Update($false) + # $ctx.ExecuteQuery() + } + } + + $ctx.Dispose() +}