NetworkingDsc
NetworkingDsc copied to clipboard
FirewallProfile: Issue with Get-DSCConfiguration
Details of the scenario you tried and the problem that is occurring
Hello,
I have successfully started a configuration for a firewallProfile. All i want to do is turn off all 3 of them (private, public and domain). Start-DSCCconfiguration and Test-DSCConfiguration work fine, but Get-DSCConfiguration returns the below error at the end of function "Get-TargetResource":
Get-DscConfiguration: Unable to cast object of type "System.Management.Automation.PSObject" to type "System.IConvertible".
I have already checked the similar issues here, but nothing says anything about casting.
This is how i have written my configuration:
FirewallProfile PrivateProfile { Name = 'Private' Enabled = 'False' DependsOn = "[Computer]NewServer" }
Verbose logs showing the problem
Suggested solution to the issue
The DSC configuration that is used to reproduce the issue (as detailed as possible)
# FirewallProfile
The operating system the target node is running
Windows Server 2012 R2
Version and build of PowerShell the target node is running
PSVersion 4.0 WSManStackVersion 3.0
Version of the DSC module that was used ('dev' if using current dev branch)
6.3.0.0
Thanks for raising this @Dimalt . Looks like there might be an issue in get. I'll check it out and see if I can replicate it using your config. If I cant I might need to get you to share verbose log output. I'll look at this tonight.
Hi @Dimalt - I tried this out on my Windows Server 2016 lab and wasn't able to replicate this. I'll have to build a new Windows Server 2012 R2 lab to try this out on. I don't suppose you've seen if this works in Windows Server 2016?
I've also tried on NetworkingDsc 7.0.0.0 on Windows Server 2016 and I couldn't replicate the problem.
The other thing I was doing differently was that I didn't have the DependsOn = "[Computer]NewServer"
. Can you confirm that the problem occurs without the DependsOn?