powershellsharepoint-onlinepnp.powershell

Why does using the PnP.PowerShell cmdlet Enable-PnPFeature to enable multilingual support add all languages on a SharePoint site?


So this is driving me crazy! Please help :)

I'm using the PnP.PowerShell module to enable multi-lingual support on a SharePoint Online site. I'm taking the following steps.

  1. Create a communication site through the SharePoint admin centre
  2. Run the following PowerShell script:
$SiteURL = 'https://tenant.sharepoint.com/sites/test'
$SiteConnection = Connect-PnPOnline -Url $SiteURL -Interactive
Enable-PnPFeature -Identity 24611c05-ee19-45da-955f-6602264abaf8 -Connection $SiteConnection -Scope Web

This toggles the 'Enable translation into multiple languages' setting at the following URL 'https://tenant.sharepoint.com/sites/test/_layouts/15/muisetng.aspx' which is great and exactly what I want. However, it also enables every site language. I only want to enable a couple of languages.

Has anyone else tried the above? Not sure why this is happening.

I'm using PnP.PowerShell version 2.2.0


Solution

  • Not sure why but the following continues to enable all languages.

    Enable-PnPFeature -Identity 24611c05-ee19-45da-955f-6602264abaf8 -Connection $SiteConnection -Scope Web

    So I've just implemented a workaround to loop through all the added languages and if the language is not in the array of languages I need, then I remove it.

    My script has been extensively used, and has been working fine with no issues.