1

We deployed a spfx extension (Add-PnPCustomAction Location "ClientSideExtension.ApplicationCustomizer" ) to multiple site collections manually, is there a way to use powershell to pull extensions and maybe even spfx webparts added to each site collection?

0

I don't think there is a way to list them for all site collections with one command but you should be able to use Get-PnPCustomAction on each site collection. Something like this.

$adminSite = "https://TENANT-admin.sharepoint.com"
$extName = "NameOfCustomiserApplicationCustomizer"
$creds = Get-Credential
$extenstions = @()

Connect-PnPOnline –Url $adminSite –Credentials $creds
Get-PnPTenantSite -Filter "Url -notlike my.sharepoint.com" | % {
    $site = $_.Url
    Write-Output "Processing $site"
    Connect-PnPOnline -Url $site -Credentials $creds
    $siteExtensions = Get-PnPCustomAction | Where-Object { $_.Location -eq "ClientSideExtension.ApplicationCustomizer" -and $_.Name -eq $extName }
    $siteExtensions | % { 
        $extenstions += [pscustomobject]@{ Site=$site; Customiser=$_.Name }
    }
} 

$extenstions | Export-Csv -Path "C:/temp/application-customisers.csv"  -NoTypeInformation

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.