Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NetAdapterAdvancedProperty: The property 'Name' cannot be found on this object #370

Closed
dcuomo opened this issue Jan 20, 2019 · 1 comment
Labels
bug The issue is a bug. help wanted The issue is up for grabs for anyone in the community.

Comments

@dcuomo
Copy link

dcuomo commented Jan 20, 2019

Details of the scenario you tried and the problem that is occurring

Running Get-DscConfiguration returns error:

"Get-DscConfiguration : The PowerShell DSC resource returned results that are not valid from Get-TargetResource. The Name key is not a valid property in the corresponding DSC resource schema file. The results from Get-TargetResource must be in a Hashtable format. The keys in the Hashtable
must be the same as the properties in the corresponding DSC resource schema file."

Verbose logs showing the problem

DSC Operational Log Event: 4097 shows...

Resource Id is [NetAdapterAdvancedProperty]Adapter1-SRIOV and Source Info is .ps1::205::25::NetAdapterAdvancedProperty. Error Message is The PowerShell DSC resource returned results that are not valid from Get-TargetResource. The Name key is not a valid property in the corresponding DSC resource schema file. The results from Get-TargetResource must be in a Hashtable format. The keys in the Hashtable must be the same as the properties in the corresponding DSC resource schema file..

Suggested solution to the issue

Rather than return $result.Name which is not defined in the schema, return $result.NetworkAdapterName

    $result = @{
        Name            = $NetworkAdapterName
        RegistryKeyword = $RegistryKeyword
        DisplayValue    = $netAdapterAdvancedProperty.DisplayValue
        RegistryValue   = $netAdapterAdvancedProperty.RegistryValue
    }

The DSC configuration that is used to reproduce the issue (as detailed as possible)

# insert configuration here

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)

Master - 6.2.0.0

@PlagueHO PlagueHO added bug The issue is a bug. help wanted The issue is up for grabs for anyone in the community. labels Jan 22, 2019
@PlagueHO
Copy link
Member

Closed by #371

@SteveL-MSFT SteveL-MSFT added this to Help Wanted in powershell/dscresources May 14, 2019
@SteveL-MSFT SteveL-MSFT removed this from Help Wanted in powershell/dscresources Nov 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug The issue is a bug. help wanted The issue is up for grabs for anyone in the community.
Projects
None yet
Development

No branches or pull requests

2 participants