1- function Get-SPOSiteProperties
2- {
3-
4- param (
5- [Parameter (Mandatory = $true , Position = 1 )]
1+ function Get-SPOSiteProperties {
2+ param (
3+ [Parameter (Mandatory = $true , Position = 1 )]
64[string ]$Username ,
7- [Parameter (Mandatory = $true , Position = 2 )]
5+ [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- # Connect and load all prerequisites
14- $ctx = New-Object Microsoft.SharePoint.Client.ClientContext($Url )
15- $ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials ($Username , $AdminPassword )
16- $ctx.ExecuteQuery ()
17- $ctx.Load ($ctx.Web )
18- $ctx.Load ($ctx.Web.AllProperties )
19- $ctx.ExecuteQuery ()
9+ )
2010
21- foreach ($ap in $ctx.Web.AllProperties.FieldValues )
22- {
23- Write-Output $ap
24- }
11+ # Connect and load all prerequisites
12+ $ctx = New-Object Microsoft.SharePoint.Client.ClientContext($Url )
13+ $ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials ($Username , $AdminPassword )
14+ $ctx.ExecuteQuery ()
15+ $ctx.Load ($ctx.Web )
16+ $ctx.Load ($ctx.Web.AllProperties )
17+ $ctx.ExecuteQuery ()
2518
26- }
19+ foreach ($ap in $ctx.Web.AllProperties.FieldValues ){
20+ Write-Output $ap
21+ }
22+ }
2723
2824
2925
@@ -39,4 +35,4 @@ $SiteUrl="https://trial345.sharepoint.com/sites/teamsitewithlibraries"
3935
4036
4137
42- Get-SPOSiteProperties - Username $Username - AdminPassword $AdminPassword - Url $SiteUrl
38+ Get-SPOSiteProperties - Username $Username - AdminPassword $AdminPassword - Url $SiteUrl
0 commit comments