If you recently tried to deploy the SharePoint template for the Power Platform Communication Site you certainly ran into some errors! 😤

Couple of things I had to do to fix the script. 🛠️
First, make sure you create an app registration for interactive login, see Register an Entra ID Application to use with PnP PowerShell | PnP PowerShell.
Register-PnPEntraIDAppForInteractiveLogin -ApplicationName "PnP.PowerShell" -Tenant [yourtenant].onmicrosoft.com
Make sure you grab the Client Id that is outputted on the screen. 💻
I added a parameter to the PowerSheel script for $clientId.
$clientId = "CLIENT_ID"
I then replaced all the instances of Connect-PnPOnline to include the Client Id, for example, -ClientId $clientId.
See Connect-PnPOnline | PnP PowerShell for more information.
The last error took some to figure out! 💪🧑💻🧠
From what I could figure out, Set-PnPTraceLog is no longer available, instead Start-PnPTraceLog and Stop-PnPTraceLog should be used instead.
Start-PnPTraceLog -WriteToConsole -Level Debug
See Start-PnPTraceLog | PnP PowerShell for more information.
Stop-PnPTraceLog
See Stop-PnPTraceLog | PnP PowerShell for more information.
Once I made all these changes, I was able to get Power Platform Communication Site template to successfully deploy! 🥳🎉
To make it even easier to run, I added the ability to pass parameters to the PowerShell script, feel free to download it at mattruma/powershell-power-platform-hub and check it out for yourself!
Discover more from Matt Ruma
Subscribe to get the latest posts sent to your email.
