manifests/collectors/Networking/VirtualNetworkGateways.psd1
|
# # GENERATED by scripts/ConvertTo-ScoutCollectorDefinition.ps1 from Modules/Public/InventoryModules/Networking/VirtualNetworkGateways.ps1 (AB#5660). # Field expressions are copied verbatim from the original collector and evaluate in an # equivalent scope -- see docs/design/decisions/declarative-collectors.md. # Review before trusting; regenerate rather than hand-patch if the source collector changes. # @{ ResourceTypes = @( 'microsoft.network/virtualnetworkgateways' ) ResourceTypeMatching = 'Grouped' AdditionalFilter = $null FilterPreamble = '' RowLoopVariable = '1' Preamble = @' $ResUCount = 1 $sub1 = $SUB | Where-Object { $_.Id -eq $1.subscriptionId } $data = $1.PROPERTIES $generation = if($data.vpnGatewayGeneration -eq 'None'){ 'Generation1'}else{ 'Generation2'} $Retired = $Retirements | Where-Object { $_.id -eq $1.id } if ($Retired) { $RetiredFeature = foreach ($Retire in $Retired) { $RetiredServiceID = $Unsupported | Where-Object {$_.Id -eq $Retired.ServiceID} $tmp0 = [pscustomobject]@{ 'RetiredFeature' = $RetiredServiceID.RetiringFeature 'RetiredDate' = $RetiredServiceID.RetirementDate } $tmp0 } $RetiringFeature = if (@($RetiredFeature.RetiredFeature).count -gt 1) { $RetiredFeature.RetiredFeature | ForEach-Object { $_ + ' ,' } }else { $RetiredFeature.RetiredFeature} $RetiringFeature = [string]$RetiringFeature $RetiringFeature = if ($RetiringFeature -like '* ,*') { $RetiringFeature -replace ".$" }else { $RetiringFeature } $RetiringDate = if (@($RetiredFeature.RetiredDate).count -gt 1) { $RetiredFeature.RetiredDate | ForEach-Object { $_ + ' ,' } }else { $RetiredFeature.RetiredDate} $RetiringDate = [string]$RetiringDate $RetiringDate = if ($RetiringDate -like '* ,*') { $RetiringDate -replace ".$" }else { $RetiringDate } } else { $RetiringFeature = $null $RetiringDate = $null } $Tags = if(![string]::IsNullOrEmpty($1.tags.psobject.properties)){$1.tags.psobject.properties}else{'0'} # P2S VPN Client Configuration $vpnClientConfig = $data.vpnClientConfiguration $P2SAddressPool = if ($vpnClientConfig.vpnClientAddressPool.addressPrefixes) { ($vpnClientConfig.vpnClientAddressPool.addressPrefixes) -join ', ' } else { $null } $P2SProtocols = if ($vpnClientConfig.vpnClientProtocols) { ($vpnClientConfig.vpnClientProtocols) -join ', ' } else { $null } $P2SAuthTypes = if ($vpnClientConfig.vpnAuthenticationTypes) { ($vpnClientConfig.vpnAuthenticationTypes) -join ', ' } else { $null } $P2SRootCertCount = if ($vpnClientConfig.vpnClientRootCertificates) { @($vpnClientConfig.vpnClientRootCertificates).count } else { 0 } $P2SRevokedCertCount = if ($vpnClientConfig.vpnClientRevokedCertificates) { @($vpnClientConfig.vpnClientRevokedCertificates).count } else { 0 } $P2SRadiusServer = $vpnClientConfig.radiusServerAddress $P2SAADTenant = $vpnClientConfig.aadTenant # Custom DNS & NAT $CustomDNS = if ($data.customDnsServers) { ($data.customDnsServers) -join ', ' } else { $null } $NATRulesCount = if ($data.natRules) { @($data.natRules).count } else { 0 } $PolicyGroupCount = if ($vpnClientConfig.vngClientConnectionConfigurations) { @($vpnClientConfig.vngClientConnectionConfigurations).count } else { 0 } '@ AdditionalRowLoops = @() TagLoop = @{ Variable = 'Tag' Source = '$Tags' Preamble = '' } Fields = @( @{ Name = 'ID' Expression = '$1.id' } @{ Name = 'Subscription' Expression = '$sub1.Name' } @{ Name = 'Resource Group' Expression = '$1.RESOURCEGROUP' } @{ Name = 'Name' Expression = '$1.NAME' } @{ Name = 'Location' Expression = '$1.LOCATION' } @{ Name = 'SKU' Expression = '$data.sku.tier' } @{ Name = 'Retiring Feature' Expression = '$RetiringFeature' } @{ Name = 'Retiring Date' Expression = '$RetiringDate' } @{ Name = 'Gateway Generation' Expression = '$generation' } @{ Name = 'Migration Status' Expression = '$data.virtualNetworkGatewayMigrationStatus.state' } @{ Name = 'Active-active mode' Expression = '$data.activeActive' } @{ Name = 'Gateway Type' Expression = '$data.gatewayType' } @{ Name = 'VPN Type' Expression = '$data.vpnType' } @{ Name = 'Enable Private Address' Expression = '$data.enablePrivateIpAddress' } @{ Name = 'Enable BGP' Expression = '$data.enableBgp' } @{ Name = 'BGP ASN' Expression = '$data.bgpsettings.asn' } @{ Name = 'BGP Peering Address' Expression = '$data.bgpSettings.bgpPeeringAddress' } @{ Name = 'BGP Peer Weight' Expression = '$data.bgpSettings.peerWeight' } @{ Name = 'Gateway Public IP' Expression = '[string]$data.ipConfigurations.properties.publicIPAddress.id.split("/")[8]' } @{ Name = 'Gateway Subnet Name' Expression = '[string]$data.ipConfigurations.properties.subnet.id.split("/")[8]' } @{ Name = 'P2S Address Pool' Expression = '$P2SAddressPool' } @{ Name = 'P2S VPN Client Protocols' Expression = '$P2SProtocols' } @{ Name = 'P2S Auth Type' Expression = '$P2SAuthTypes' } @{ Name = 'P2S Root Cert Count' Expression = '$P2SRootCertCount' } @{ Name = 'P2S Revoked Cert Count' Expression = '$P2SRevokedCertCount' } @{ Name = 'P2S RADIUS Server' Expression = '$P2SRadiusServer' } @{ Name = 'P2S AAD Tenant' Expression = '$P2SAADTenant' } @{ Name = 'Custom DNS Servers' Expression = '$CustomDNS' } @{ Name = 'NAT Rules Count' Expression = '$NATRulesCount' } @{ Name = 'Policy Group Count' Expression = '$PolicyGroupCount' } @{ Name = 'Resource U' Expression = '$ResUCount' } @{ Name = 'Tag Name' Expression = '[string]$Tag.Name' } @{ Name = 'Tag Value' Expression = '[string]$Tag.Value' } ) Export = @{ WorksheetName = 'VNET Gateways' TableNamePrefix = 'VNETGTWTable_' Columns = @( 'Subscription' 'Resource Group' 'Name' 'Location' 'SKU' 'Retiring Feature' 'Retiring Date' 'Gateway Generation' 'Migration Status' 'Active-active mode' 'Gateway Type' 'VPN Type' 'Enable Private Address' 'Enable BGP' 'BGP ASN' 'BGP Peering Address' 'BGP Peer Weight' 'Gateway Public IP' 'Gateway Subnet Name' 'P2S Address Pool' 'P2S VPN Client Protocols' 'P2S Auth Type' 'P2S Root Cert Count' 'P2S Revoked Cert Count' 'P2S RADIUS Server' 'P2S AAD Tenant' 'Custom DNS Servers' 'NAT Rules Count' 'Policy Group Count' 'Resource U' ) TagColumns = @( 'Tag Name' 'Tag Value' ) TagColumnsBefore = 'Resource U' NumberFormat = '0' ConditionalText = @( 'New-ConditionalText -Range F2:F100 -ConditionalType ContainsText' 'New-ConditionalText UltraPerformance -Range E:E' 'New-ConditionalText Standard -Range E:E' 'New-ConditionalText VpnGw1 -Range E:E' 'New-ConditionalText VpnGw2 -Range E:E' 'New-ConditionalText VpnGw3 -Range E:E' 'New-ConditionalText VpnGw1AZ -Range E:E' 'New-ConditionalText VpnGw2AZ -Range E:E' 'New-ConditionalText VpnGw3AZ -Range E:E' 'New-ConditionalText Basic -Range E:E' 'New-ConditionalText Generation1 -Range H:H' ) } SourceCollector = 'Modules/Public/InventoryModules/Networking/VirtualNetworkGateways.ps1' } |