Unable to Install-Module AzureRM

This topic contains 6 replies, has 4 voices, and was last updated by  Trent Yates 1 month, 3 weeks ago.

  • Author
    Posts
  • #50274

    Manimaran
    Participant

    Running PowerShell as Administartor

    install-module -Name azurerm -force

    Below is the error message , any ideas why?

    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
    + ... $null = PackageManagement\Install-Package @PSBoundParameters
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidData: (Microsoft.Power....InstallPackage:InstallPackage) [Install-Package], Excep
    tion
    + FullyQualifiedErrorId : ParameterArgumentTransformationError,Validate-ModuleAuthenticodeSignature,Microsoft.Powe
    rShell.PackageManagement.Cmdlets.InstallPackage

    PS C:\WINDOWS\system32>

  • #50293

    Will Anderson
    Keymaster

    Hey there Manimaran,

    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:

    (Find-Module *azurerm*).foreach({Install-Module -Name $PSItem.Name})

  • #50297

    Manimaran
    Participant

    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".

  • #50311

    Manimaran
    Participant

    Finally found the fix

    removed the Azure* folders from below locations.

    %ProgramFiles%\WindowsPowerShell\Modules folder
    %ProgramFiles(x86)%\Microsoft SDKs\Azure\PowerShell

    Thanks
    Mani

  • #50321

    Will Anderson
    Keymaster

    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.

  • #54763

    Brian Lalancette
    Participant

    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.

    Cheers
    Brian

  • #74086

    Trent Yates
    Participant

    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.

    Thanks

    Trent.

You must be logged in to reply to this topic.