Azure / Azure/GuestConfiguration
Exception: Found a dependency on resources from the PSDesiredStateConfiguration module
- Dominant language
- PowerShell
- Stars
- 8
- Forks
- 13
- PR merge metrics
- No merged PRs in 30d
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
```powershell
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
```powershell
/*
@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";
};
```
Contributor guide
Assessment
This issue has not been assessed yet.