diff --git a/Content Types/Get/Get Single Content Type - Array Method/GetSingleContentType.ps1 b/Content Types/Get/Get Single Content Type - Array Method/GetSingleContentType.ps1 index 583f75bd..83a4b5e0 100644 --- a/Content Types/Get/Get Single Content Type - Array Method/GetSingleContentType.ps1 +++ b/Content Types/Get/Get Single Content Type - Array Method/GetSingleContentType.ps1 @@ -1,26 +1,22 @@ -function Get-SPOContentType -{ - - param ( - [Parameter(Mandatory=$true,Position=1)] +function Get-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.ExecuteQuery() - - $ctx.Load($ctx.Web) - - $ctx.Load($ctx.Web.ContentTypes) - $ctx.ExecuteQuery() - Write-Host $ctx.Web.ContentTypes[0].Name - - } + ) + + $ctx=New-Object Microsoft.SharePoint.Client.ClientContext($Url) + $ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Username, $AdminPassword) + $ctx.ExecuteQuery() + + $ctx.Load($ctx.Web) + $ctx.Load($ctx.Web.ContentTypes) + $ctx.ExecuteQuery() + Write-Host $ctx.Web.ContentTypes[0].Name +}