From 5a6263609fdf8c4353fe8ebf738069b26fffe8fd Mon Sep 17 00:00:00 2001 From: JakubPiegza <45433779+JakubPiegza@users.noreply.github.com> Date: Thu, 30 Jan 2020 19:17:38 +0100 Subject: [PATCH] Update ModifyDisplayFormTemplateName-ContentTypeHub.ps1 --- ...DisplayFormTemplateName-ContentTypeHub.ps1 | 37 +++++++------------ 1 file changed, 13 insertions(+), 24 deletions(-) diff --git a/Content Types/Get/All Content Types from a Content Type Hub and their DisplayFormTemplate/ModifyDisplayFormTemplateName-ContentTypeHub.ps1 b/Content Types/Get/All Content Types from a Content Type Hub and their DisplayFormTemplate/ModifyDisplayFormTemplateName-ContentTypeHub.ps1 index 91519a06..c16944a8 100644 --- a/Content Types/Get/All Content Types from a Content Type Hub and their DisplayFormTemplate/ModifyDisplayFormTemplateName-ContentTypeHub.ps1 +++ b/Content Types/Get/All Content Types from a Content Type Hub and their DisplayFormTemplate/ModifyDisplayFormTemplateName-ContentTypeHub.ps1 @@ -1,16 +1,14 @@  -function Set-SPOContentType -{ - - param ( - [Parameter(Mandatory=$true,Position=1)] - [string]$Username, - [Parameter(Mandatory=$true,Position=2)] - $AdminPassword, - [Parameter(Mandatory=$true,Position=3)] - [string]$Url - ) +function Set-SPOContentType{ +param ( + [Parameter(Mandatory=$true,Position=1)] + [string]$Username, + [Parameter(Mandatory=$true,Position=2)] + $AdminPassword, + [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) @@ -18,21 +16,12 @@ function Set-SPOContentType $ctx.ExecuteQuery() - foreach($cc in $ctx.Web.ContentTypes) - { - - Write-Host $cc.Name " " $cc.DisplayFormTemplateName - - - +foreach($cc in $ctx.Web.ContentTypes){ + Write-Host $cc.Name " " $cc.DisplayFormTemplateName } - - - $ctx.Dispose() - - - } + $ctx.Dispose() +}