1

I am trying to build the Windows Azure PowerShell cmdlet, but facing issue while loading the cmdlet. I have followed the below steps:

  1. Cloned the latest code from master branch https://github.com/WindowsAzure/azure-sdk-tools
  2. Build the solution WindowsAzurePowershell.sln using VS 2010 SP1 Ultimate [I have Windows Azure SDK 1.7, VS 2010 tools for Windows Azure and WIX installed]
  3. After building the solution, opened the folder C:\repo\Windows-Azure-SDK-Nodejs-Git\azure-sdk-tools\Package\Debug and tried to load the cmdlet by running the command: Get-ChildItem '.*.psd1' | ForEach-Object {Import-Module $_}

And got the below error. Could someone please help me to resolve this issue?

If I install the official cmdlet bits using WebPI, everything works fine. But the cmdlet installed using the msi I built failed to load with the same error.

Error:

PS C:\repo\Windows-Azure-SDK-Nodejs-Git\azure-sdk-tools\Package\Debug> Get-ChildItem '.*.psd1' | ForEach-Object {Import-Module $} > error.txt Import-Module : Cannot load Windows PowerShell snap-in C:\Interop-TFS\Windows-Azure-SDK-Nodejs-Git\azure-sdk-tools\Pack age\Debug\Microsoft.WindowsAzure.Management.ServiceManagement.dll because of the following error: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. Loader Exceptions: Could not load file or assembly 'Microsoft.WindowsAzure.Management, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31 bf3856ad364e35' or one of its dependencies. The system cannot find the file specified. Could not load file or assembly 'Microsoft.WindowsAzure.Management, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31 bf3856ad364e35' or one of its dependencies. The system cannot find the file specified. Could not load file or assembly 'Microsoft.WindowsAzure.Management, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31 bf3856ad364e35' or one of its dependencies. The system cannot find the file specified. Could not load file or assembly 'Microsoft.WindowsAzure.Management, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31 ..... bf3856ad364e35' or one of its dependencies. The system cannot find the file specified. Could not load file or assembly 'Microsoft.WindowsAzure.Management, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31 bf3856ad364e35' or one of its dependencies. The system cannot find the file specified. At line:1 char:57 + Get-ChildItem '.*.psd1' | ForEach-Object {Import-Module <<<< $} > error.txt + CategoryInfo : ResourceUnavailable: (:) [Import-Module], PSSnapInException + FullyQualifiedErrorId : PSSnapInLoadFailure,Microsoft.PowerShell.Commands.ImportModuleCommand

1 Answer 1

0

Try this:

  • Go to Control Panel and every thing related with "Windows Azure Powershell *", uninstall all.
  • Now install Windows Azure Powershell CMdlets
  • Verify you have powershell installed @ C:\Program Files (x86)\Microsoft SDKs\Windows Azure\PowerShell (You will all the dll in this folder which result missing in your problem case)
  • Now open a Windows Powershell prompt in admin mode
  • Use this link and follow the process to verify that you can access to Windows Azure Management Services (This is just to verify that you have all modules needed in your machine)
  • Now try whatever you wanted to try and there should not be any issue.
Sign up to request clarification or add additional context in comments.

4 Comments

Thanks Avkash. I got the issue solved, the references in the project (both master and dev branch) point to signed DLLs. I have disabled strong name verification in dev machine, now I can load the modules and debug.
I am glad that your problem is resovled. Good luck for your next problem ahead.
Thanks Avkash. Reason is I want to debug and understand the code flow, trying to understand the implementation :)
@Anu Thomas Chandy, I have the same problem, trying to import the custom-built PowerShell modules. Please, could you share how you resolved your issue ?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.