Page 1 of 1

Command found in module, but can't be loaded

Posted: Tue Sep 19, 2023 11:40 am
by andycarpenter@westat.com
Using Powershell 5. Need to migrate to a new host quickly and need to keep it neutral (i.e., not hopping to 7 at the same time).

I am suddenly getting errors like the ones below -- the command is found in a module, but the module can't be loaded.

These cmdlets have worked for me for a long time on this computer. I am trying to have some other folks use them on the same Win10 computer and so did some install-module -scope AllUsers. To solve the problem, I have uninstalled the modules (allversions, force), made sure get-installedmodule doesn't find them, reinstalled the modules, ensured executionpolicy is set generously to Unrestricted, bounced the server multiple times, etc. Import-module seems to just hang. This is driving me nuts.

Any idea what could be going on and how to get this working again? Assistance would be greatly appreciated.

Thanks, Andy

The 'Get-MgDeviceManagementWindowsAutopilotDeviceIdentity' command was found in the module 'Microsoft.Graph.DeviceManagement.Enrollment', but the module could not be loaded. For more information, run
'Import-Module Microsoft.Graph.DeviceManagement.Enrollment'.

Get-AzStorageAccount : The 'Get-AzStorageAccount' command was found in the module 'Az.Storage', but the module could not be loaded. For more information, run 'Import-Module Az.Storage'.