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.
Configuration DefaultApps
{
Import-DscResource -ModuleName 'PSDesiredStateConfiguration'
Node Localhost
{
Package package1
{
Ensure = "Present"
Path = ".msi"
Name = "package1"
ProductId = ""
Arguments = "AllUsers=1"
DependsOn = ""
}
Package package2
{
Ensure = "Present"
Path = ".msi"
Name = "package2"
ProductId = ""
Arguments = "AllUsers=1"
DependsOn = ""
}
}
}
Pretty basic, but I’m very new to dsc so information resources would be very helpful.