PS C:\WINDOWS\system32> install-module -Name azurerm -force
PackageManagement\Install-Package : Cannot process argument transformation on parameter ‘InstalledModuleInfo’. Cannot
convert the “System.Object[]” value of type “System.Object[]” to type “System.Management.Automation.PSModuleInfo”.
At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:1661 char:21
Are you trying to install the module from a local source? Or from a PSRepository? If you’re going from the PowerShell Gallery PSRepository, I would recommend that you install all of the AzureRM modules and not rely on the Import-AzureRm from the AzureRm module. Try this:
Hey Will, Thanks for the response.
From PSRepository. I ran the above command below is the error message I get
[1661,21: Install-Package] Cannot process argument transformation on parameter ‘InstalledModuleInfo’. Cannot convert the "
System.Object[]" value of type “System.Object[]” to type “System.Management.Automation.PSModuleInfo”.
Glad you found the solution! Yeah, the AzureRm modules can get funky from time to time. Also, be sure to watch out when you use update-module against the AzureRm modules as they’ll sometimes just install the new version sibe-by-side with your older version and that can cause weirdness with the embedded dependencies in the modules.
Thanks Mani - I was also getting this (and this page is the only search result for it!). Your fixed worked on one of my 3 machines (there were Azure folders with older contents) but on the other 2 I’m somewhat reluctant to blow the Azure folders away as their contents were updated very recently. But worst case I suppose I could back them up first and then try.
Hi Guys, just wanted to say thanks for the posts. This helped me solve why I couldn’t install these modules. Particularly Mani with the info about deleting data in the system folders. That is what got me sorted.