Monday, March 20, 2023

Update-ModuleManifest is not recognized as the name of a cmdlet in Azure Automation

The other day I was moving my PowerShell scripts in Azure Automation to a new Automation Account in a different Azure Subscription. For one of them that connects to Exchange Online through an Azure App Registration, I received the following error when I tried to test it (in the new automation account):

'The term 'Update-ModuleManifest' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.'

It turns out the problem was easy to fix. While on the original automation account I was still using version 2.x of the ExchangeOnlineManagement module, in the new one I am using v3.1.0. Usually this wouldn’t be an issue at all, but clearly the new Exchange module requires the Update-ModuleManifest cmdlet, which is part of the PowerShellGet module that I did not have installed. I found this out by searching for the cmdlet in the Module Gallery:

So, all I had to do was install the PackageManagement module, as PowerShellGet depends on it, and then the PowerShellGet module. All working now!

No comments:

Post a Comment