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
Describe 'Test bad inputs (both IPv4 and IPv6)'-Tag 'Test','DnsRecord','DnsRecordPtr' {
477
-
It 'Throws when the IPv4 address is malformatted' {
478
-
InModuleScope -ScriptBlock {
479
-
Set-StrictMode-Version 1.0
480
-
$malformattedIPv4State= [DnsRecordPtr] @{
481
-
ZoneName='0.168.192.in-addr.arpa'
482
-
IpAddress='192.168.0.DS9'
483
-
Name='quarks.contoso.com'
484
-
Ensure='Present'
485
-
}
486
-
487
-
{ $malformattedIPv4State.Get() } | Should -Throw -ExpectedMessage ('*'+'"Cannot convert value "{0}" to type "System.Net.IPAddress". Error: "An invalid IP address was specified.""'-f$malformattedIPv4State.IpAddress)
488
-
}
489
-
}
490
-
491
-
It 'Throws when the IPv6 address is malformatted' {
492
-
InModuleScope -ScriptBlock {
493
-
Set-StrictMode-Version 1.0
494
-
495
-
$malformattedIPv6State= [DnsRecordPtr] @{
496
-
ZoneName='0.0.d.f.ip6.arpa'
497
-
IpAddress='fd00::1::9'
498
-
Name='quarks.contoso.com'
499
-
Ensure='Present'
500
-
}
501
-
502
-
{ $malformattedIPv6State.Get() } | Should -Throw -ExpectedMessage ('*'+'"Cannot convert value "{0}" to type "System.Net.IPAddress". Error: "An invalid IP address was specified.""'-f$malformattedIPv6State.IpAddress)
503
-
}
504
-
}
505
485
506
486
It 'Throws when placed in an incorrect IPv4 reverse lookup zone' {
0 commit comments