I would like to Pester to check if a public IP is attached to either $edge00
or $edge01
NIC
# id of the Get-AzPublicIpAddress output will = "/subscriptions/asdf-asdf-asdf/resourceGroups/RG-ASDF-FW/providers/Microsoft.Network/networkInterfaces/FW-ASDF-EDGE-00-NIC1/ipConfigurations/FW-ASDF-EDGE-ASDF"
$edge00 = "FW-ASDF-EDGE-00-NIC1"
$edge01 = "FW-ASDF-EDGE-01-NIC1"
# this will fail
(Get-AzPublicIpAddress -Name "PIP-FW-ASDF-EDGE-UNTRUST" -ResourceGroupName "RG-ASDF-FW").IpConfiguration.Id | Should -Match ($edge00 -or $edge01)
# this will work
(Get-AzPublicIpAddress -Name "PIP-FW-ASDF-EDGE-UNTRUST" -ResourceGroupName "RG-ASDF-FW").IpConfiguration.Id | Should -Match $edge00
I have done quite a bit of searching, but I am unable to find a way via normal PowerShell commands or Pester to check if a string ($id
)contains either string1 ($edge00
) or string2 ($edge01
)
Does anyone have any ideas, please?