azure-powershell icon indicating copy to clipboard operation
azure-powershell copied to clipboard

Error loading azure.profile in 1.0.5

Open TravisEz13 opened this issue 10 years ago • 8 comments

Import-Module AzureRM.profile -force Import-Module : The member 'FormatsToProcess' in the module manifest is not valid: Cannot find path 'C:\Program Files\WindowsPowerShell\Modules\AzureRM.profile\1.0.5.\Microsoft.Azure.Commands.Profile.format.ps1xml' because it does not exist.. Verify that a valid value is spec 'C:\Program Files\WindowsPowerShell\Modules\AzureRM.profile\1.0.5\AzureRM.profile.psd1' file. At line:1 char:1

  • Import-Module AzureRM.profile -force

TravisEz13 avatar Mar 09 '16 20:03 TravisEz13

@TravisEz13 How did you install? Not seeing this issue in version 1.0.5, whether installed from msi or Gallery.

markcowl avatar Mar 11 '16 22:03 markcowl

I installed from the gallery.

TravisEz13 avatar Mar 13 '16 06:03 TravisEz13

The version of PowerShell I'm running did not like the .\ in the paths in this file: https://github.com/Azure/azure-powershell/blob/dev/src/ResourceManager/Profile/AzureRM.Profile.psd1#L61

The .\ is not needed as the path is assumed relative (there may be some logic to detect non-relative paths)

TravisEz13 avatar Mar 13 '16 07:03 TravisEz13

@TravisEz13 What version of PowerShell is it? Our relative paths have been there for 3+ years, and this is the first report of an issue I've seen.

markcowl avatar Mar 16 '16 22:03 markcowl

I figured out what happened here. There was an error when I ran update-azurerm and the profile module was in use in another window. install-module was called with -force, so it attempted to re-install an already up-to-date module. The module being in use and a C# module. It was not able to update it, but it had already deleted some of the files.

As a workaround, I've written my own update script which calls install-module without the -force.

TravisEz13 avatar Apr 16 '16 21:04 TravisEz13

@TravisEz13 I believe this is resolved by the current version of AzureRM, which uses exact version dependencies. Please re-open this issue if you see a recurrence.

markcowl avatar May 03 '16 01:05 markcowl

This issue just came up for me. I ran update-module AzureRM -force. The message says that C:\Program Files\WindowsPowerShell\Modules\azurerm.profile\1.0.8\.\Microsoft.Azure.Commands.Profile.format.ps1xml is missing, and it is.

vicp-iq avatar May 09 '16 21:05 vicp-iq

Interesting, I re-ran install-module azurerm -Verbose -Force and it populated all the missing files and the issue is resolved.

vicp-iq avatar May 09 '16 22:05 vicp-iq