Import-module has empty list of exported commands

Welcome Forums General PowerShell Q&A Import-module has empty list of exported commands

This topic contains 5 replies, has 3 voices, and was last updated by

 
Participant
1 month ago.

  • Author
    Posts
  • #111991

    Participant
    Points: 0
    Rank: Member

    Hello All,

    While importing the module in powershell Version : 5.1.14409.1005, we are getting the exported commandlets are missing for applocker while import-module is successful.

    Execution policy is unrestricted, Server OS is Windows Server 2008 R2 x64 Datacenter Full.

    >>import-module "applocker" -verbose

    VERBOSE: loading module from path 'C:\Windows\system32\WindowsPowerShell\v1.0\Modules\applocker\applocker.psd1'.

    >> get-module applocker

    ModuleType      Version          Name               ExtportedCommands

    Manifest            1.0.0.0       Applocker

  • #111997

    Participant
    Points: 9
    Rank: Member

    Try to verify with this:

    Get-Command -Module Applocker

    .

    • #112004

      Participant
      Points: 0
      Rank: Member

      it is empty , no list of cmdlets there.

  • #112018

    Participant
    Points: 1
    Rank: Member

    Having PS 5 does not mean you can run all modules that require PS 5. Some modules require additional underlying .NET objects to work.

    AppLocker is typically located under C:\Windows\System32\WindowsPowerShell\v1.0\Modules\AppLocker

    However, it depends on .NET 4, specifically Microsoft.Security.ApplicationId.PolicyManagement.Cmdlets.dll which is typically under

    C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\Microsoft.Security.ApplicationId.PolicyManagement.Cmdlets\v4.0_10.0.0.0__31bf3856ad364e35\Microsoft.Security.ApplicationId.PolicyManagement.Cmdlets.dll

    Also current version of the AppLocker manifest module is 2.0.0.0

    • #112061

      Participant
      Points: 0
      Rank: Member

      hello Sam,

      There is no such folder in C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\ .. while the servers which has the similar OS are also doesn't have that folder though they are able provide the cmdlets command. 

  • #112078

    Participant
    Points: 0
    Rank: Member

    you will find the folder over here ;

     

    C:\Windows\winsxs\msil_microsoft.security...ymanagement.cmdlets_31bf3856ad364e35_6.1.7600.16385_none_26b1f4355e49a023

You must be logged in to reply to this topic.