I google around quite a bit before I finally got it; the configuration file that you create is off course just like a normal script file in the sense that it doesn’t actually do anything. All it does is to define a function that you need to call!
So in order to actually generate the .mof-files, I ‘dot-sourced’ the script into the current session and called the function from the ps1-file.
Here’s an example configuration file called ‘demoConfig.ps1’:
configuration Demo
{
Node localhost
{
File TestFiles
{
SourcePath = "c:\temp\test.txt"
DestinationPath = "c:\temp\testdir"
Ensure = "Present"
Type = "File"
}
}
}
And to generate the .mof files:
PS C:\temp> . .\demoConfig.ps1
PS C:\temp> Demo