Import-module has empty list of exported commands

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

Try to verify with this:

Get-Command -Module Applocker
.

it is empty , no list of cmdlets there.

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

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.

you will find the folder over here ;

 

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