I have migrated an old enterprise wiki site collection 2013 to SharePoint online. I did not create the source site collection, and i found that the wiki pages are associated with the built-in
Enterprise Wiki Page content type and the built-in
EnterpriseWiki.aspx page layout. And those 2 built components were customized by adding new site columns to them. As i know that modifying the built-in components (Content type and the Page layout) are not recommended, because the modification might get overridden by Microsoft if they apply an update. so i create a new content type which mimic the built-in one and i create a new layout which mimic the the built-in one.
But i am not sure if i can write a PnP script to update the enterprise wiki pages's Content type and Page layout without affecting the wiki pages' metadata (mainly the modified date and modified by)?