Skip to content

[BUG] Add-PnPPage with Translate & TranslationLanguageCodes failures after 2nd call #2572

@ChristopheAngot

Description

@ChristopheAngot

Reporting an Issue or Missing Feature

This is an Issue, not a missing feature.

Expected behavior

No exception should be thrown when calling Add-PnPPage twice with -Translate and -TranslationLanguageCodes parameters.

Actual behavior

Second call to Add-PnPPage fails.

Steps to reproduce behavior

The site is an english communication site.

When executing the following script :


Connect-PnPOnline -Url https://YourTenantHere.sharepoint.com/sites/TestMultiLingual -Credentials WinCredHere

Add-PnPPage -Name "TestMultiA" -Translate -TranslationLanguageCodes 1036,1031 -Publish

Add-PnPPage -Name "TestMultiB" -Translate -TranslationLanguageCodes 1036,1031 -Publish

Disconnect-PnPOnline

The first Add-PnPPage suceeds, the second fails.

I'm getting the exception :

Add-PnPPage : Feature 'MultilingualPages' (ID:
24611c05-ee19-45da-955f-6602264abaf8) is already activated at scope
'https://YourTenantHere.sharepoint.com/sites/TestMultiLingual'.

The Multilingual feature was activated before script execution and languages (French - 1036 & German - 1031) were also activated.

If I "reset" the connection (Disconnect / reconnect), it works as expected (but it's ugly/ slow/ not acceptable with -Interactive):

Connect-PnPOnline -Url https://YourTenantHere.sharepoint.com/sites/TestMultiLingual -Credentials WinCredHere
Add-PnPPage -Name "TestMultiA" -Translate -TranslationLanguageCodes 1036,1031 -Publish
Disconnect-PnPOnline

Connect-PnPOnline -Url https://YourTenantHere.sharepoint.com/sites/TestMultiLingual -Credentials WinCredHere
Add-PnPPage -Name "TestMultiB" -Translate -TranslationLanguageCodes 1036,1031 -Publish
Disconnect-PnPOnline

So I assume there is some kind of intialization problems related to the check with feature activation, it seems to try to activate a feature already activated.

Note : I noticed the same behavior with Set-PnPPage

What is the version of the Cmdlet module you are running?

1.12.0

Which operating system/environment are you running PnP PowerShell on?

  • [X ] Windows
  • Linux
  • MacOS
  • Azure Cloud Shell
  • Azure Functions
  • Other : please specify

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions