-
Notifications
You must be signed in to change notification settings - Fork 399
Description
Reporting an Issue or Missing Feature
This is an Issue, not a missing feature.
Expected behavior
No exception should be thrown when calling a Cmdlet after two Set-PnPPage calls.
Actual behavior
Any Cmdlet call after 2 Set-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/YourSite -Credentials WinCredHere
Set-PnPPage -Identity "PageA" -Translate -TranslationLanguageCodes 1036,3082 -Publish
Get-PnPPage -Identity "PageA"
Set-PnPPage -Identity "PageB" -Translate -TranslationLanguageCodes 1036,3082 -Publish
Get-PnPPage -Identity "PageB"
Disconnect-PnPOnline
Both Set-PnPPage and the first Get-PnPPage succeed.
The second Get-PnPPage fails but you can replace it by any PnP Cmdlet and it still fails.
I'm getting this exception :
Feature 'MultilingualPages' (ID: 24611c05-ee19-45da-955f-6602264abaf8) is already activated at scope 'https://YourTenant.sharepoint.com/sites/YourSite'.
I activated the Multilingual feature before script execution and I also activated languages (French - 1036 & Spanish - 3082).
If I "reset" the connection (Disconnect / reconnect), it works as expected (but it's ugly/ slow/ not acceptable with -Interactive):
Connect-PnPOnline -Url https://YourTenant.sharepoint.com/sites/YourSite -Credentials WinCredHere
Set-PnPPage -Name "PageA" -Translate -TranslationLanguageCodes 1036,3082 -Publish
Get-PnPPage -Identity "PageA"
Disconnect-PnPOnline
Connect-PnPOnline -Url https://YourTenant.sharepoint.com/sites/YourSite -Credentials WinCredHere
Set-PnPPage -Name "PageB" -Translate -TranslationLanguageCodes 1036,3082 -Publish
Get-PnPPage -Identity "PageB"
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 : A similar issue has already been reported for Add-PnPPage #2572
What is the version of the Cmdlet module you are running?
2.1.1
Which operating system/environment are you running PnP PowerShell on?
- Windows
- Linux
- MacOS
- Azure Cloud Shell
- Azure Functions
- Other : please specify