Exception: Found a dependency on resources from the PSDesiredStateConfiguration module

Open
#320 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
powershell
Domain
devops

Research direction

Start with the PowerShell configuration and the generated MOF shown in the issue, comparing the resource module recorded there with the module imported by the configuration. Verify the package-build entry point against this minimal File resource example; done means the example packages without the dependency exception.

Written by the indexing model from the issue text.

Description

Hi I have error when I try to build packed for guest configuration

Exception: Found a dependency on resources from the PSDesiredStateConfiguration module, but we cannot copy these resources into the Guest Configuration package.
Please switch these resources to using the PSDscResources module instead.

My code for this to test


Configuration CreateFileExample
{
    #Import-DscResource -ModuleName PSDscResources

    Node localhost
    {
        File ExampleFile
        {
            DestinationPath = "C:\Temp\example.txt"
            Ensure          = "Present"
            Contents        = "This file was created by DSC."
            Type            = "File"
        }
    }
}

CreateFileExample

Build MOF file


/*
@TargetNode='localhost'
@GeneratedBy=mmach
@GenerationDate=03/09/2026 21:13:32
@GenerationHost=XXXX-MICHAL
*/

instance of MSFT_FileDirectoryConfiguration as $MSFT_FileDirectoryConfiguration1ref
{
ResourceID = "[File]ExampleFile";
 ModuleName = "PSDesiredStateConfiguration";
 DestinationPath = "C:\\Temp\\example.txt";
 Type = "File";
 Contents = "This file was created by DSC.";
 Ensure = "Present";
 SourceInfo = "C:\\Users\\mmach\\OneDrive\\Skrypty\\DSC\\AzureDay-example\\GuestConfiguration\\dsc-file.ps1::7::9::File";

ModuleVersion = "1.0";

 ConfigurationName = "CreateFileExample";

};
instance of OMI_ConfigurationDocument


                    {
 Version="2.0.0";


                        MinimumCompatibleVersion = "1.0.0";


                        CompatibleVersionAdditionalProperties= {"Omi_BaseResource:ConfigurationName"};


                        Author="mmach";


                        GenerationDate="03/09/2026 21:13:32";


                        GenerationHost="XXXX-MICHAL";


                        Name="CreateFileExample";


                    };


Dominant language
PowerShell
Stars
8
Forks
13
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Azure/GuestConfiguration

All issues in Azure/GuestConfiguration

Similar issues

More DevOps issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.