Get-MpPreference fails: 'Defender' module couldn't be loaded. RRS feed

  • Question

  • Hi, everyone!

    I am on a Windows 8.1 and I am trying to use the Windows Defender WMI providers via Powershell. I have last used this machine about 2 months ago and there were no troubles with it. Now when I run `Get-MpPreference` cmdlet it fails with the message:

    Get-MpPreference : The 'Get-MpPreference' command was found in the module 'Defender', but the module could not be
    loaded. For more information, run 'Import-Module Defender'.
    At line:1 char:1
    + Get-MpPreference
    + ~~~~~~~~~~~~~~~~
        + CategoryInfo          : ObjectNotFound: (Get-MpPreference:String) [], CommandNotFoundException
        + FullyQualifiedErrorId : CouldNotAutoloadMatchingModule

    Following the instruction I tried `Import-Module Defender` which gave me:

    Import-Module : The module to process 'MSFT_MpWDOScan.cdxml', listed in field 'NestedModules' of module manifest
    'C:\Windows\system32\WindowsPowerShell\v1.0\Modules\Defender\Defender.psd1' was not processed because no valid module
    was found in any module directory.
    At line:1 char:1
    + Import-Module Defender
    + ~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : ResourceUnavailable: (Defender:String) [Import-Module], PSInvalidOperationException
        + FullyQualifiedErrorId : Modules_ModuleFileNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand

    Again everything was fine some months ago. And by the way the same thing happened on another machine under Windows 8.1 (an HP laptop).

    I could really use an advice here. Please help)


    • Edited by Daniel.BMSTU Friday, June 29, 2018 12:15 PM
    • Moved by Bill_Stewart Tuesday, July 31, 2018 3:18 PM This is not break/fix forum
    Friday, June 29, 2018 12:13 PM

All replies

  • Again everything was fine some months ago.
    ... and how is it now? Obviously somethings changed on the system. Anyway that is not a scripting issue. You will have to fix your system.

    Best regards,


    Friday, June 29, 2018 12:30 PM
  • Well, the thing is this machine is a VM I am only using for testing. So if you ask what happened between the last time I used it and Defender module was fine and today - the answer is nothing really, it was either paused (in terms of Hyper-v) or turned off. Of course some Windows updates were probably installed during my work. Could you please elaborate on the "fix your system" stuff?


    Friday, June 29, 2018 12:44 PM
  • And could you please tell me where should I rather direct this issue?


    Friday, June 29, 2018 12:47 PM
  • You could try it there:


    or there:


    Good luck.

    Best regards,


    Friday, June 29, 2018 1:20 PM