Windows OS Hub
  • Windows
    • Windows 11
    • Windows 10
    • Windows Server 2025
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
  • Microsoft
    • Active Directory (AD DS)
    • Group Policies (GPOs)
    • Exchange Server
    • Azure and Microsoft 365
    • Microsoft Office
  • Virtualization
    • VMware
    • Hyper-V
    • Proxmox
  • PowerShell
  • Linux
  • Home
  • About

Windows OS Hub

  • Windows
    • Windows 11
    • Windows 10
    • Windows Server 2025
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
  • Microsoft
    • Active Directory (AD DS)
    • Group Policies (GPOs)
    • Exchange Server
    • Azure and Microsoft 365
    • Microsoft Office
  • Virtualization
    • VMware
    • Hyper-V
    • Proxmox
  • PowerShell
  • Linux

 Windows OS Hub / PowerShell / PowerShell: The Module Could Not Be Loaded

July 24, 2025

PowerShell: The Module Could Not Be Loaded

You may receive an error when trying to run a cmdlet from a PowerShell module installed on your computer.

The command XXX was found in the module, but the module YYY could not be loaded.

I received this error while trying to connect to a Microsoft 365 tenant via the Exchange Online PowerShell module.

Connect-ExchangeOnline : The 'Connect-ExchangeOnline' command was found in the module 'ExchangeOnlineManagement', but the module could not be loaded. For more information, run 'Import-Module ExchangeOnlineManagement'
+ CategoryInfo : ObjectNotFound: (Connect-ExchangeOnline:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CouldNotAutoloadMatchingModule

PowerShell module could not be loaded

This error typically indicates that your computer’s PowerShell Execution Policy settings are preventing third-party modules from launching.

Run the command:

Get-ExecutionPolicy

The Restricted policy setting prevents the execution of third-party scripts.

Get-ExecutionPolicy

Use the following command to load the PowerShell module:

Import-Module ExchangeOnlineManagement

An error should appear:

Import-Module: File C:\Program  Files\WindowsPowerShell\Modules\ExchangeOnlineManagement\3.5.0\netFramework\ExchangeOnlineManagement.psm1 cannot be loaded because running scripts is disabled on this system.

Import-Module PowerShell: cannot be loaded because running scripts is disabled

You can allow commands from external PowerShell modules to be run only in the current session.

Set-ExecutionPolicy RemoteSigned -Scope Process

Or, you can enable the execution of local scripts for the current user.

Set-ExecutionPolicy RemoteSigned -Scope CurrentUser

Attempting to import a module may result in an error:

Import-Module : Could not load file or assembly or one of its dependencies. The system cannot find the file specified.

In this case, the module is most likely either not fully downloaded or corrupted. Delete the directory with the module from the local drive and then reinstall it. PowerShell modules are installed in one of the following directories:

  • C:\Users\%username%\Documents\WindowsPowerShell\Modules – in the current user profile
  • C:\Program Files\WindowsPowerShell\Modules – third-party modules that are available to all users are usually installed here.
  • C:\Windows\system32\WindowsPowerShell\v1.0\Modules – built-in Windows modules
Learn how to manually install PowerShell modules in Windows.

Here’s another example of the PS module import error:

Import-Module : File \modulename.psm1 cannot be loaded. The file \modulename.psm1 is not digitally signed. You cannot run this script on the current system.

This error may occur due to the PowerShell Execution Policy settings, or because the PSM1 module file was downloaded manually from the Internet. In this case, use the following command to unblock the file downloaded from the Internet:

Unblock-File .\modulename.psm1

0 comment
0
Facebook Twitter Google + Pinterest
PowerShellQuestions and Answers
previous post
Run Elevated Commands with Sudo on Windows 11
next post
How to Find AD Users with Blank Passwords (Password-Not-Required)

Related Reading

Extend an Expired User Password in Active Directory

December 23, 2024

Check the Software Installation/Removal History in Windows

October 8, 2024

Configure Kiosk Mode on Windows 11 (Single or...

September 24, 2024

How to Write Logs to the Windows Event...

March 11, 2025

Run PowerShell Scripts on a Schedule with Task...

October 3, 2024

How to Verify a File Hash (Checksum) on...

November 25, 2024

Send a WhatsApp Message from the CommandLine (Shell)

December 3, 2024

How to Hide (Block) a Specific Windows Update

March 3, 2025

Leave a Comment Cancel Reply

join us telegram channel https://t.me/woshub
Join WindowsHub Telegram channel to get the latest updates!

Recent Posts

  • Find a Process Causing High Disk Usage on Windows

    July 15, 2025
  • Fix: Microsoft Defender Not Updating Automatically in Windows

    July 8, 2025
  • Create a Windows Server VM on Proxmox (Step-by-Step)

    July 7, 2025
  • How to Detect Which User Installed or Removed a Program on Windows

    June 23, 2025
  • Encrypt Any Client-Server App Traffic on Windows with Stunnel

    June 12, 2025
  • Failed to Open the Group Policy Object on a Computer

    June 2, 2025
  • Remote Desktop Printing with RD Easy Print Redirection

    June 2, 2025
  • Disable the Lock Screen Widgets in Windows 11

    May 26, 2025
  • Configuring Windows Protected Print Mode (WPP)

    May 19, 2025
  • Map a Network Drive over SSH (SSHFS) in Windows

    May 13, 2025

Follow us

  • Facebook
  • Twitter
  • Telegram
Popular Posts
  • How to Assign (Passthrough) a Physical GPU to a Hyper-V Virtual Machine
  • Run PowerShell Scripts on a Schedule with Task Scheduler
  • Extend an Expired User Password in Active Directory
  • Check Windows 11 Hardware Readiness with PowerShell Script
  • Check the Software Installation/Removal History in Windows
  • How to Add or Remove Pinned Folders to Quick Access with PowerShell and GPO
  • How to Enable and Configure Wake-on-LAN (WoL) in Windows
Footer Logo

@2014 - 2024 - Windows OS Hub. All about operating systems for sysadmins


Back To Top