I’m trying to get a first DSC config working and while I can get it to run cleanly and create an output directory. I don’t get any MOF files.
I have a pull server setup, etc… and all that seems to be okay. My config script is just using a “File” source to pull in some files. I’m using “ConfigurationNames” in my LCMs. So, if the LCM pulls this file then I want it to apply. However, that’s step 2 ![]()
PS v5 is used.
My script looks like this:
##define nodes
$ConfigData =
@{
AllNodes =
@(
@{
#applies to all nodes
NodeName = "*";
#install files to
InstallDest = "C:\\Program Files\Zabbix\\";
}
);
#define some variable(s) that are global to the config
NonNodeData =
@{
#resource location - Zabbix EXE files (copy all .exe files)
InstallFiles = "\\\\networkfilepath\\Zabbix\Agent\\3.0.0\win64\\";
}
}
Configuration Install_Zabbix_Agent
{
#load DSC resources (Get-DscResource shows all available Modules and names)
#Import-DscResource -ModuleName PSDesiredStateConfiguration -Name Script;
#all nodes using this DSC
Node $AllNodes.NodeName
{
#file resource
File CreateZabbixDir
{
Ensure = "Present";
Type = "Directory";
CheckSum = "SHA-1";
SourcePath = $ConfigurationData.NonNodeData.InstallFiles;
DestinationPath = $Node.InstallDest;
}
}
}
#call the config
Install_Zabbix_Agent
I run the .ps1 and I don’t get any MOF files. Just a empty directory. No errors.