Install-Module Fails Without an Error on Some Modules RRS feed

  • Question



    So far the modules I cannot install are AzureAD, MSOnline, and Az. I also cannot update PowershellGet with install-module -force. When running the install-module, it appears to work, and we have no errors, however, I cannot import the 3 azure related modules and get the following error:

    PS C:\WINDOWS\system32> import-module azuread  import-module : The specified module 'azuread' was not loaded because no valid module file was found in any module directory. 
    At line:1 char:1 
    + import-module azuread -verbose 
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~     
    + CategoryInfo          : ResourceUnavailable: (azuread:String) [Import-Module], FileNotFoundException
    + FullyQualifiedErrorId : Modules_ModuleNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand

    With all 4 modules, when I run install-module -verbose, I get the following: 

    VERBOSE: Using the provider 'PowerShellGet' for searching packages.  VERBOSE: The -Repository parameter was not specified.  PowerShellGet will use all of the registered repositories.  VERBOSE: Getting the provider object for the PackageManagement Provider 'NuGet'.  VERBOSE: The specified Location is '' and PackageManagementProvider is NuGet'.  VERBOSE: Searching repository ''azuread'' for ''.  VERBOSE: Total package yield:'1' for the specified package 'azuread'.  VERBOSE: Performing the operation "Install-Module" on target "Version '' of module 'AzureAD'".  VERBOSE: The installation scope is specified to be 'AllUsers'.  VERBOSE: The specified module will be installed in 'C:\Program Files\WindowsPowerShell\Modules'.  VERBOSE: The specified Location is 'NuGet' and PackageManagementProvider is 'NuGet'.  VERBOSE: Downloading module 'AzureAD' with version '' from the repository ''.  VERBOSE: Searching repository ''AzureAD'' for ''.  VERBOSE: InstallPackage' - name='AzureAD', version='',destination='C:\Users\Bench\AppData\Local\Temp\906110414'  VERBOSE: DownloadPackage' - name='AzureAD', version='',destination='C:\Users\Bench\AppData\Local\Temp\906110414\AzureAD\AzureAD.nupkg', uri=''  VERBOSE: Downloading ''.  VERBOSE: Completed downloading ''.  VERBOSE: Completed downloading 'AzureAD'. VERBOSE: Hash for package 'AzureAD' does not match hash provided from the server.  VERBOSE: InstallPackageLocal' - name='AzureAD', version='',destination='C:\Users\Bench\AppData\Local\Temp\906110414'  VERBOSE: Catalog file '' is not found in the contents of the module 'AzureAD' being installed.  VERBOSE: Valid authenticode signature found in the file 'AzureAD.psd1' for the module 'AzureAD'.

    In the above verbose, the last line is missing, which would denote a successful install as seen here with a different module:

    VERBOSE: Module 'Posh-SSH' was installed successfully to path 'C:\Program Files\WindowsPowerShell\Modules\Posh-SSH\2.2'.

    Now the big kicker is that issue is not with just 1 machine, but 4, each failing to install those modules. 

    System Info:

    Like I said, the issue was on 4 systems. All computers are on OS version 10.0.18363 on Windows Pro.

    Nuget is version
    PowershellGet is version and I have not been able to update it.
    All systems use Threatlocker and Webroot. Neither software had any alerts related to powershell. Plus, 1 of the systems randomly started working without changes to either program policy.

    Steps Taken:

    Tried to update powershellget. Updated Nuget and windows. Manually installed one of the troublesome modules, uninstalled it and reattempted to install with install-module. Other modules install and work without an issue. Ran sfc /scannow on one of the systems and it did not make a difference on the install-module. 1 of the 4 computers started working, and repeating what I did on that one with the others did not work.

    I tried using the "get help" application on windows, but after 3 windows advisors and an update to 2004 that broke one of our systems, I'd rather ask here instead. 

    Friday, July 31, 2020 3:07 PM


All replies