Open ahmedrafeq opened 3 years ago
I was receiving the exact same error message when running Invoke-PnPSiteTemplate locally but it was due to VS Code trying to target PowerShell v5 instead of v7.1.
If you haven't done so already, you might want to check your Azure Automation Runbook is targeting the right PowerShell version.
It is interesting that the powershell version is the issue, but how can i target powershell 7.1 because this is "coming soon", meanwhile all my runbooks cannot complete the pnp template (clientsidepages) because of this error, is there a work a round, because my customer cannot roll out new templates due to this error.
I have this same error using PowerShell 5. It did go away when I moved to PowerShell 7, but then I learned I couldn't use PowerShell 7 because it has an issue with how it parses JSON when it's called from a webhookk in an Azure Runbook.
This is documented here under "Create a webhook": https://learn.microsoft.com/en-us/azure/automation/automation-webhooks?tabs=portal.
So now I'm back to looking for a workaround. Anyone else bump into this issue?
Using Invoke-PnPSiteTemplate inside Azure Automation Runbook. the script runs successfully locally, but when running inside Azure Automation, get the error below when Invoke command is run.
Method not found: 'System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable`1Boolean Enumerator.MoveNextAsync()'.
The template was generated using get-pnpsitetemplate The template has few components:
Pnp version 1.6
Thanks