dsccommunity / dsccommunity/NetworkingDsc

FirewallProfile: Issue with Get-DSCConfiguration

Open
#381 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

waiting for author response
Dominant language
PowerShell
Stars
235
Forks
93
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the FirewallProfile resource's Get-TargetResource function and reproduce the reported Get-DSCConfiguration failure on Windows Server 2012 R2 with PowerShell 4.0 and NetworkingDsc 6.3.0.0. Compare it with the working Start-DSCConfiguration and Test-DSCConfiguration behavior; done means Get-DSCConfiguration completes without the PSObject-to-IConvertible casting error.

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell
Domain
networking
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.