Due to changes that were made in Puppet 5, code intended to generate warnings for an outdated PowerShell version will cause runs to completely fail.
The dsc_lite feature calls the Puppet.warn_once method to only display the inadequate WMF5 version once. In Puppet 5, that method takes 6 parameters. In Puppet 4, the method only took 5 parameters.
See the change that landed in:
2 options were vetted for addressing this problem:
- Call Puppet.err instead of Puppet.warn_once. This was tested and produced error messages for every single dsc_lite resource, which is undesirable.
- Vary the call to warn_once based on the method arity. This results in warning messages on Puppet 4 and error messages on Puppet 5, but at least limits their count to a single message.
We opted for the latter as it's less intrusive.