Parameter-based data can be passed as parameters to a configuration block, as follows:
configuration FooBar
{
param([switch]$foo,$bar)
if($foo){
WindowsFeature InstallIIS
{
Name = "Web-Server"
}
}elseif($bar){
WindowsFeature InstallHyperV
{
Name = "Microsoft-Hyper-V"
}
}
}
FooBar -Foo