Unable to Install-Module AzureRM

Welcome Forums General PowerShell Q&A Unable to Install-Module AzureRM

This topic contains 6 replies, has 4 voices, and was last updated by

 
Participant
1 year, 5 months ago.

  • Author
    Posts
  • #50274

    Participant
    Points: 0
    Rank: Member

    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

    Keymaster
    Points: 17
    Team Member
    Rank: Member

    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

    Participant
    Points: 0
    Rank: Member

    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

    Participant
    Points: 0
    Rank: Member

    Finally found the fix

    removed the Azure* folders from below locations.

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

    Thanks
    Mani

  • #50321

    Keymaster
    Points: 17
    Team Member
    Rank: Member

    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

    Participant
    Points: 0
    Rank: Member

    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

    Participant
    Points: 0
    Rank: Member

    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.

The topic ‘Unable to Install-Module AzureRM’ is closed to new replies.