diff --git a/Content Types/Get/Find content types added to your lists/checkallcontenttypes.ps1 b/Content Types/Get/Find content types added to your lists/checkallcontenttypes.ps1 index ff953eda..d2803259 100644 --- a/Content Types/Get/Find content types added to your lists/checkallcontenttypes.ps1 +++ b/Content Types/Get/Find content types added to your lists/checkallcontenttypes.ps1 @@ -1,68 +1,43 @@  -function Get-SPOList -{ - - param ( - [Parameter(Mandatory=$true,Position=1)] +function Get-SPOList{ + 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.Lists) - $ctx.ExecuteQuery() - Write-Host - Write-Host $ctx.Url -BackgroundColor White -ForegroundColor DarkGreen - foreach( $ll in $ctx.Web.Lists) - { - - $ctx.Load($ll.RootFolder) - $ctx.Load($ll.DefaultView) - $ctx.Load($ll.Views) - $ctx.Load($ll.WorkflowAssociations) - $ctx.Load($ll.ContentTypes) - - try - { - $ctx.ExecuteQuery() - } - catch - { - } - - - - - Write-Host $ll.Title -ForegroundColor Green - - foreach($cc in $ll.ContentTypes) - { - Write-Host $cc.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.Lists) + $ctx.ExecuteQuery() + Write-Host + Write-Host $ctx.Url -BackgroundColor White -ForegroundColor DarkGreen + + foreach( $ll in $ctx.Web.Lists){ + $ctx.Load($ll.RootFolder) + $ctx.Load($ll.DefaultView) + $ctx.Load($ll.Views) + $ctx.Load($ll.WorkflowAssociations) + $ctx.Load($ll.ContentTypes) + + try{ + $ctx.ExecuteQuery() + } + catch{} + + Write-Host $ll.Title -ForegroundColor Green + + foreach($cc in $ll.ContentTypes){ + Write-Host $cc.Name + } + } +} # Paths to SDK. Please verify location on your computer.