powershell
powershell copied to clipboard
[BUG] Error when running ConvertTo-PNPPage on a classic page with Image under /_layouts
Notice
Many bugs reported are actually related to the PnP Framework which is used behind the scenes. Consider carefully where to report an issue:
Reporting an Issue
I'm trying to convert classic to modern pages using ConvertTo-PNPPage\
Expected behavior
A succesful conversion of the classic page to a modern page.
Actual behavior
ConvertTo-PnPPage fails with "Page does not exist" if an image is on the page that is not in a library. (Like the default : /sites/
An error log with verbose logging in the attachment.
I have tried to exclude SharePointPnP.Modernization.WikiImagePart from the webpart mapping and to use -SkipDefaultUrlRewriting . Both did not help.
Steps to reproduce behavior
ConvertTo-PnPPage -Identity "Home1" -Overwrite -LogVerbose -LogType File -WebPartMappingFile .\webpartmapping.xml
or
ConvertTo-PnPPage -Identity "Home1" -Overwrite -LogVerbose -LogType File -WebPartMappingFile .\webpartmapping.xml -SkipDefaultUrlRewriting
What is the version of the Cmdlet module you are running?
1.10.0
Which operating system/environment are you running PnP PowerShell on?
- [X ] Windows
- [ ] Linux
- [ ] MacOS
- [ ] Azure Cloud Shell
- [ ] Azure Functions
- [ ] Other : please specify
Found what the cause is: It is caused by the Function ImageLookup({ServerRelativeFileName}) Since for these files no library is found the function crashes. It would be enough if a place holder could be placed or even if the image was skipped.
This issue is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 5 days
@remcodegroot - Can you please update to the latest release 2.1.x however you will need PS 7.2 or later to benefit from all the bug fixes and improvements.
PS5 support has been dropped in the new release.
Feel free to reopen if the issue persists. Thanks!