Here’s the scenario: You are working with Azure Automation and out of the blue, you start getting the error Invalid JSON primitive: Import-Module as depicted in the image below. Before changing your code (and I mean tearing up the code itself, modules, etc.) do yourself a favor and check the JSON file. Most of the time it is just bad formatting on the JSON file — missing a bracket, comma, or something like that.
Yes, sometimes it’s the simplest thing that trips you up.
More Quick Tips articles
- Visual Studio Code keyboard shortcut to manage your code
- Using Azure ephemeral disks when provisioning VMs with ARM
- Checking services availability in Azure and Azure Stack Hub
- Reading text files with PowerShell and Linux bash shell
- Integrating Microsoft Defender with Cloud App Security