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

The 'Set-AzureRmSqlDatabaseTransparentDataEncryption' command was found in the module 'AzureRM.Sql', but the module could not be loaded. For more information, run 'Import-Module AzureRM.Sql'.

Open consultguru opened this issue 9 years ago • 7 comments

Cmdlet(s)

PowerShell Version

Name Value


PSVersion 5.1.15063.168 PSEdition Desktop PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...} BuildVersion 10.0.15063.168 CLRVersion 4.0.30319.42000 WSManStackVersion 3.0 PSRemotingProtocolVersion 2.3 SerializationVersion 1.1.0.1

Module Version

3.8.0

OS Version

Instructions: to get OS version, type $PSversionTable and look for value associated with BuildVersion

Description

Get error The 'Set-AzureRmSqlDatabaseTransparentDataEncryption' command was found in the module 'AzureRM.Sql', but the module could not be loaded. For more information, run 'Import-Module AzureRM.Sql'. + CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Invoke-SQLCase + PSComputerName : localhost

On running Import-Module AzureRM.Sql, get the following error Import-Module : Could not load file or assembly 'Microsoft.Azure.Management.Sql.Legacy, Version=2.8.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified. At line:1 char:1

  • Import-Module AzureRM.Sql
  •   + CategoryInfo          : NotSpecified: (:) [Import-Module], FileNotFoundException
      + FullyQualifiedErrorId : System.IO.FileNotFoundException,Microsoft.PowerShell.Commands.ImportModuleCommand
    
    
    

Debug Output

Instructions: to get Debug Output, set $DebugPreference="Continue" and then execute the cmdlet or script causing the issue

Script/Steps for Reproduction

consultguru avatar May 09 '17 03:05 consultguru

@consultguru Hey Gururaj, if you remove all AzureRM modules from your machine and run Install-Module -Name AzureRM , are you seeing the same error?

cormacpayne avatar May 16 '17 21:05 cormacpayne

@cormacpayne Hi Cormac, Tried all of that. Removed and re-installed 'AzureRM' modules, Re-installed powershell, but to no avail. Same error. However, now i could reproduce the issue on another machine as well. We had Visual Studio 2107 RC version and Visual Studio 2015 Enterprise edition. On this machine we had all AzureRM modules. When we remove all of that and install Visual studio 2017, we are able to see the error. Prior to VS2017, it had not errored.

consultguru avatar May 16 '17 23:05 consultguru

@consultguru for the new machine you setup, what were the steps you took to reproduce this error? This will help us determine what the root cause of the issue was.

cormacpayne avatar May 16 '17 23:05 cormacpayne

  • Install VS 2015 enterprise edition
  • Install VS 2017 RC build
  • Installed Powershell 5.1
  • Install AzureRM (previous version, think it was 3.7?)
  • Removed VS 2017 RC build
  • Installed VS 2017 enterprise
  • Removed AzureRM
  • Installed AzureRM 3.8.0

AzureRM.SQL fails..

consultguru avatar May 16 '17 23:05 consultguru

@consultguru Can you run Get-Module -ListAvailable and post the results when you are able to repro the error?

Does this repro with the latest version (4.1.0)

markcowl avatar Jun 13 '17 01:06 markcowl

Yes, it had reproed with 4.1.0 and 3.8.0 side-by-side. However, I've forced deleted all Azure* modules and installed 3.8.0 now. should have taken a module listing earlier. Don't have another machine to spare for the tryouts. Sorry.

consultguru avatar Jun 13 '17 05:06 consultguru

@consultguru So, side-by-side is supported as long as the modules are installed in the same scope - but you cannot mix versions in the same powershell session. Closing, as it appears this is by design, if you are installing to different scopes.

markcowl avatar Jul 11 '17 17:07 markcowl