azure-files-samples icon indicating copy to clipboard operation
azure-files-samples copied to clipboard

Unable to import module AzFilesHybrid

Open astavitsky opened this issue 4 years ago • 3 comments

Getting the following error importing the module:

Import-Module : The given assembly name or codebase was invalid. (Exception from HRESULT: 0x80131047)
At line:1 char:1
+ Import-Module AzFilesHybrid
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Import-Module], FileLoadException
    + FullyQualifiedErrorId : System.IO.FileLoadException,Microsoft.PowerShell.Commands.ImportModuleCommand

astavitsky avatar Feb 18 '21 19:02 astavitsky

Make sure the AzFilesHybrid folder is unzipped and copied to one or your PowerShell module paths. There is a script included in the unzipped contents to do this for you too.

powershell.exe / pwsh.exe
set-location -path C:\path\to\AzFilesHybrid
set-executionpolicy -scope currentuser -executionpolicy unrestricted
.\CopyToPSPath.ps1

pauldapps avatar Oct 06 '21 21:10 pauldapps

I did everything @pauldapps suggested, as the Powershell script in the Microsoft documentation has the same thing basically, but still getting this error. Running with admin access doesn't help.

jdhines avatar Jan 24 '23 16:01 jdhines

Any resolution for anybody?

jhall-conp avatar May 11 '23 17:05 jhall-conp