I've been trying to add if statements to my DSC package deployments but it has been difficult finding info on it. What I'm trying is pretty basic, All I need to do is have the config check to see if package1 is installed and if it is then it doesn't install package2 but if package 1 is absent then it installs package2.
What's fighting you is that these configuration scripts must compile to a MOF, and MOFs don't have logic in them. There's no if/then branching.
The current Package resource doesn't support an either/or scenario like you're describing. You would probably need to create your own resource, so that in a single definition you could define both packages and implement your either/or logic within the resource's script code.
The topic ‘If statements and package deployment’ is closed to new replies.