Closed rifftual closed 3 years ago
Hi @rifftual
Looks like you're using PSDesiredStateConfiguration
module for your resources and not this PSDscResources
module.
Invoke-DscResource -Name Service -Method Set -Property @{Ensure = 'Present'; Name = 'foo'; StartupType = 'Disabled'; State = 'Stopped'; Path = 'C:\foo.exe' } -ModuleName PSDesiredStateConfiguration
Thanks. Created an issue here PowerShell/PowerShell#14370
You misunderstood my point, you should probably be using PSDscResources
or better, xPSDesiredStateConfiguration
module.
The built-in resources are not updated.
The PsDscResources
module can be fixed in some cases but does not accept non-critical changes.
The Community-maintained xPSDesiredStateConfiguration
module is the most up to date, and probably the best for you to use.
https://github.com/dsccommunity/xPSDesiredStateConfiguration/
Details of the scenario you tried and the problem that is occurring
First invocation creates the service. The second one fails and it doesn't matter if you change some properties or keep them identical.
Verbose logs showing the problem
Suggested solution to the issue
The DSC configuration that is used to reproduce the issue (as detailed as possible)
The operating system the target node is running
Version and build of PowerShell the target node is running
Version of the DSC module that was used ('dev' if using current dev branch)
dev