Skip to content

Commit 52aa941

Browse files
Merge pull request #78 from JakubPiegza/patch-25
Update ModifyDisplayFormUrl-FindCustomFormsDeployed.ps1
2 parents 6a8c284 + 513e4d3 commit 52aa941

File tree

1 file changed

+28
-43
lines changed

1 file changed

+28
-43
lines changed

Content Types/Display Forms/Find Custom Display Forms Deployed/ModifyDisplayFormUrl-FindCustomFormsDeployed.ps1

Lines changed: 28 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,35 @@
1-
function Set-SPOContentType
2-
{
3-
4-
param (
5-
[Parameter(Mandatory=$true,Position=1)]
1+
function Set-SPOContentType{
2+
param (
3+
[Parameter(Mandatory=$true,Position=1)]
64
[string]$Username,
75
[Parameter(Mandatory=$true,Position=2)]
86
$AdminPassword,
9-
[Parameter(Mandatory=$true,Position=3)]
7+
[Parameter(Mandatory=$true,Position=3)]
108
[string]$Url
11-
)
12-
13-
$ctx=New-Object Microsoft.SharePoint.Client.ClientContext($Url)
14-
$ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Username, $AdminPassword)
15-
$ctx.Load($ctx.Web.Lists)
16-
$ctx.ExecuteQuery()
17-
18-
19-
20-
foreach($ll in $ctx.Web.Lists)
21-
{
22-
Write-Host $ll.Title -ForegroundColor Green
23-
$ctx.Load($ll.ContentTypes)
24-
$ctx.ExecuteQuery()
25-
foreach($cc in $ll.ContentTypes)
26-
{
27-
28-
if($cc.DisplayFormUrl -ne "")
29-
{
30-
Write-Host "Content type name: "$cc.Name
31-
Write-Host "The Custom url: " $cc.DisplayFormUrl
32-
}
33-
# $cc.DisplayFormTemplateName="DocumentForm"
34-
# $cc.Update($false)
35-
# $ctx.ExecuteQuery()
36-
37-
38-
39-
}
40-
}
41-
42-
43-
44-
$ctx.Dispose()
45-
46-
47-
}
9+
)
10+
11+
$ctx=New-Object Microsoft.SharePoint.Client.ClientContext($Url)
12+
$ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Username, $AdminPassword)
13+
$ctx.Load($ctx.Web.Lists)
14+
$ctx.ExecuteQuery()
15+
16+
foreach($ll in $ctx.Web.Lists){
17+
Write-Host $ll.Title -ForegroundColor Green
18+
$ctx.Load($ll.ContentTypes)
19+
$ctx.ExecuteQuery()
20+
foreach($cc in $ll.ContentTypes){
21+
if($cc.DisplayFormUrl -ne ""){
22+
Write-Host "Content type name: "$cc.Name
23+
Write-Host "The Custom url: " $cc.DisplayFormUrl
24+
}
25+
# $cc.DisplayFormTemplateName="DocumentForm"
26+
# $cc.Update($false)
27+
# $ctx.ExecuteQuery()
28+
}
29+
}
30+
31+
$ctx.Dispose()
32+
}
4833

4934

5035

0 commit comments

Comments
 (0)