Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to load resources from module #196

Open
jeremyhagan opened this issue Jul 3, 2024 · 0 comments
Open

Unable to load resources from module #196

jeremyhagan opened this issue Jul 3, 2024 · 0 comments

Comments

@jeremyhagan
Copy link

I have installed this module and the ComputerManagementDsc module on my development machine. Both are listed in the same directory.

    Directory: C:\Program Files\WindowsPowerShell\Modules


Mode                LastWriteTime         Length Name
----                -------------         ------ ----
d-----        3/07/2024   4:49 PM                ComputerManagementDsc
d-----        9/01/2024   1:38 PM                Microsoft365DSC
d-----        9/01/2024   1:48 PM                ReverseDSC
d-----        4/07/2024   8:48 AM                SecurityPolicyDsc

However, when I run Get-DscResource, not resources from SecurityPolicyDsc are returned.

C:\Program Files\...\Modules> (Get-DscResource).ModuleName | select -Unique
ComputerManagementDsc
Microsoft365DSC
PackageManagement
PSDesiredStateConfiguration

Nor is the module listed when I run Get-Module:

C:\Program Files\...\Modules> get-module *dsc -ListAvailable


    Directory: C:\Program Files\WindowsPowerShell\Modules


ModuleType Version    Name                                ExportedCommands
---------- -------    ----                                ----------------
Script     9.1.0      ComputerManagementDsc
Manifest   1.24.103.1 Microsoft365DSC                     {Assert-M365DSCBlueprint, Compare-M365DSCConfigura...
Manifest   2.0.0.18   ReverseDSC                          {Get-DSCParamType, Get-DSCBlock, Get-DSCFakeParame...

And trying to import the module throws an error

C:\> import-module SecurityPolicyDsc
import-module : The specified module 'SecurityPolicyDsc' was not loaded because no valid module file was found in any module directory.

The only difference I can see between ComputerManagementDsc and SecurityPolicyDsc is that the former has a .psm1 and the latter doesn't. What do I need to do to get this module (and others like it) working?

$PSVersionTable

Name                           Value
----                           -----
PSVersion                      5.1.17763.5458
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.17763.5458
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant