You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Imagine a scenario where a user wants to perform both these steps in the same configuration:
Rename a network adapter
Assign a DNS server address to the same adapter
If a configuration like this is put through a Test-TargetResource phase before being applied (see example), it will fail with 'System.InvalidOperationException: A network adapter with the alias '' could not be found.'
Verbose logs
VERBOSE: [Test-VM]: LCM: [ Start Resource ] [[DnsServerAddress]Ethernet0-IPv6::[DomainController]Test-VM]
VERBOSE: [Test-VM]: LCM: [ Start Test ] [[DnsServerAddress]Ethernet0-IPv6::[DomainController]Test-VM]
VERBOSE: [Test-VM]: [[DnsServerAddress]Ethernet0-IPv6::[DomainController]Test-VM]
Test-TargetResource: Checking the DNS server addresses.
VERBOSE: [Test-VM]: [[DnsServerAddress]Ethernet0-IPv6::[DomainController]Test-VM]
Get-DnsClientServerStaticAddress: Getting staticly assigned DNS server IPv6 address for interface alias 'Ethernet0'.
VERBOSE: [Test-VM]: LCM: [ End Test ] [[DnsServerAddress]Ethernet0-IPv6::[DomainController]Test-VM] False in
0.1090 seconds.
VERBOSE: [Test-VM]: LCM: [ *FAILED*Compare ] Completed processing compare operation. The operation returned
False.
PowerShell DSC resource DSC_DnsServerAddress failed to execute Test-TargetResource functionality with error message:
System.InvalidOperationException: A network adapter with the alias 'Ethernet0' could not be found.
+ CategoryInfo : InvalidOperation: (root/Microsoft/...gurationManager:String) [], CimException
+ FullyQualifiedErrorId : ProviderOperationExecutionFailure
+ PSComputerName : Test-VM
The DnsServerAddress resource should not return a terminating error when the network interface specified in InterfaceAlias is invalid - instead, it should just return that the resource is not in the desired state. There is no need to tank the entire Test-TargetResource process.
Operating system the target node is running
OsName : Microsoft Windows Server 2022 Datacenter Azure Edition
OsOperatingSystemSKU : 407
OsArchitecture : 64-bit
WindowsVersion : 2009
WindowsBuildLabEx : 20348.1.amd64fre.fe_release.210507-1500
OsLanguage : en-US
OsMuiLanguages : {en-US}
PowerShell version and build the target node is running
Problem description
Imagine a scenario where a user wants to perform both these steps in the same configuration:
If a configuration like this is put through a Test-TargetResource phase before being applied (see example), it will fail with 'System.InvalidOperationException: A network adapter with the alias '' could not be found.'
Verbose logs
DSC configuration
Suggested solution
The DnsServerAddress resource should not return a terminating error when the network interface specified in InterfaceAlias is invalid - instead, it should just return that the resource is not in the desired state. There is no need to tank the entire Test-TargetResource process.
Operating system the target node is running
PowerShell version and build the target node is running
NetworkingDsc version
The text was updated successfully, but these errors were encountered: