I'm using Powershell DSC to install chocolatey on a VM, setup through an Azure Automation Account. This is a snippet of my DSC configuration:
cChocoInstaller installChoco
{
InstallDir = "C:\choco"
}
xFirewall WebFirewallRule
{
Direction = "Inbound"
Name = "Web-Server-TCP-In"
DisplayName = "Allow http Inbound"
Description = "Allow incoming web site traffic."
Enabled = "true"
Action = "Allow"
Protocol = "TCP"
LocalPort = "80"
Ensure = "Present"
}
On the first time the consistency check runs, it installs chocolatey and returns compliant, but every single check after that is marked as Non Compliant, because of installChoco. The firewall rule is compliant every time.
I'm new to powershell DSC - am I missing something? Do I need to install chocolatey in a different way for it to realise it's there on subsequent runs?
Thanks.