Azure-Samples / azure-files-samples

This repository contains supporting code (PowerShell modules/scripts, ARM templates, etc.) for deploying, configuring, and using Azure Files.
https://docs.microsoft.com/azure/storage/files/storage-files-introduction
MIT License
225 stars 192 forks source link

Unable to import module AzFilesHybrid #68

Open astavitsky opened 3 years ago

astavitsky commented 3 years ago

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
pauldapps commented 2 years ago

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
jdhines commented 1 year ago

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.

jhall-conp commented 1 year ago

Any resolution for anybody?