Error loading azure.profile in 1.0.5
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 How did you install? Not seeing this issue in version 1.0.5, whether installed from msi or Gallery.
I installed from the gallery.
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 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.
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 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.
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.
Interesting, I re-ran install-module azurerm -Verbose -Force and it populated all the missing files and the issue is resolved.