pnp / PnP-PowerShell

SharePoint PnP PowerShell CmdLets
https://pnp.github.io/powershell
Other
990 stars 662 forks source link

[FEATURE] Add site Id to output of Get-PnPTenantSite #3012

Open alexbelevantsev opened 3 years ago

alexbelevantsev commented 3 years ago

Is your feature request related to a problem? Please describe. Get-PnPTenantSite doesn't return site Id.

Describe the solution you'd like Get-PnPTenantSite returns a site Id.

Describe alternatives you've considered Currently we use the following cmdlets to get the site Id:

Connect-PnPOnline -Url $tenant_site_url -Credentials $cred
$sites=Get-PnPTenantSite -Detailed
foreach($tenant_site in $sites){
    Connect-PnPOnline -Url $tenant_site.Url -Credentials $cred
    $site = Get-PnPSite -Includes ID
}

Unfortunately additional cmdlets takes much time to execute.

ToddKlindt commented 3 years ago

If I'm reading the code and the docs right (and there's a really good chance I'm not) then the Site's ID isn't returned by the GetSiteProperties method they're using. It returns a SiteProperties object and I don't see Site ID in there. All of that properties of that object are being returned by Get-PnPTenantSite. I'm not saying that can't add it, I'm just noting that it will be more work than just including a property they're already getting back.