-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18 from AsBuiltReport/dev
v0.1.8 release
- Loading branch information
Showing
9 changed files
with
213 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,4 +41,13 @@ jobs: | |
TWITTER_CONSUMER_API_SECRET: ${{ secrets.TWITTER_CONSUMER_API_SECRET }} | ||
TWITTER_ACCESS_TOKEN: ${{ secrets.TWITTER_ACCESS_TOKEN }} | ||
TWITTER_ACCESS_TOKEN_SECRET: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }} | ||
|
||
bsky-post: | ||
needs: publish-to-gallery | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: zentered/[email protected] | ||
with: | ||
post: "[New Release] ${{ github.event.repository.name }} ${{ github.event.release.tag_name }}! Check out what's new! ${{ github.event.release.html_url }} #Microsoft #Azure #AsBuiltReport #PowerShell" | ||
env: | ||
BSKY_IDENTIFIER: ${{ secrets.BSKY_IDENTIFIER }} | ||
BSKY_PASSWORD: ${{ secrets.BSKY_PASSWORD }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,150 @@ | ||
function Get-AbrAzDnsPrivateResolver { | ||
<# | ||
.SYNOPSIS | ||
Used by As Built Report to retrieve Azure DNS Private Resolver information | ||
.DESCRIPTION | ||
.NOTES | ||
Version: 0.1.0 | ||
Author: Tim Carman | ||
Twitter: @tpcarman | ||
Github: tpcarman | ||
.EXAMPLE | ||
.LINK | ||
#> | ||
[CmdletBinding()] | ||
param ( | ||
) | ||
|
||
begin { | ||
Write-PScriboMessage "DnsPrivateResolver InfoLevel set at $($InfoLevel.DnsPrivateResolver)." | ||
} | ||
|
||
process { | ||
Try { | ||
if ($InfoLevel.DnsPrivateResolver -gt 0) { | ||
$AzDnsPrivateResolvers = Get-AzDnsResolver | Sort-Object Name | ||
if ($AzDnsPrivateResolvers) { | ||
Write-PscriboMessage "Collecting Azure DNS Private Resolver information." | ||
Section -Style Heading4 'DNS Private Resolver' { | ||
if ($Options.ShowSectionInfo) { | ||
Paragraph "Azure Private DNS Resolver is a service that securely resolves DNS queries for private resources in Azure VNets, enabling seamless communication between on-premises and cloud environments without exposing traffic to the public internet. It centralises DNS management and supports hybrid cloud architectures." | ||
} | ||
$AzDnsPrivateResolverInfo = @() | ||
foreach ($AzDnsPrivateResolver in $AzDnsPrivateResolvers) { | ||
$AzResourceGroup = Get-AzResource -ResourceType $AzDnsPrivateResolver.Type | ||
$AzDnsResolverInboundEndpoint = Get-AzDnsResolverInboundEndpoint -DnsResolverName $AzDnsPrivateResolver.Name -ResourceGroupName $AzResourceGroup.ResourceGroupName | ||
$AzDnsResolverOutboundEndpoint = Get-AzDnsResolverOutboundEndpoint -DnsResolverName $AzDnsPrivateResolver.Name -ResourceGroupName $AzResourceGroup.ResourceGroupName | ||
$InObj = [Ordered]@{ | ||
'Name' = $AzDnsPrivateResolver.Name | ||
'Resource Group' = $AzResourceGroup.ResourceGroupName | ||
'Location' = $AzLocationLookup."$($AzDnsPrivateResolver.Location)" | ||
'Subscription' = "$($AzSubscriptionLookup.(($AzDnsPrivateResolver.Id).split('/')[2]))" | ||
'Inbound Endpoints' = $AzDnsResolverInboundEndpoint.Count | ||
'Outbound Endpoints' = $AzDnsResolverOutboundEndpoint.Count | ||
'Virtual Network' = ($AzDnsPrivateResolver.VirtualNetworkId).split('/')[-1] | ||
'Resource Guid' = $AzDnsPrivateResolver.ResourceGuid | ||
'Creation Time' = get-date $AzDnsPrivateResolver.SystemDataCreatedAt.ToLocalTime() -format G | ||
'Last Modified' = get-date $AzDnsPrivateResolver.SystemDataLastModifiedAt.ToLocalTime() -format G | ||
'Current State' = $AzDnsPrivateResolver.State | ||
'Provisioning State' = $AzDnsPrivateResolver.ProvisioningState | ||
} | ||
|
||
if ($Options.ShowTags) { | ||
$InObj['Tags'] = if ([string]::IsNullOrEmpty($AzResourceGroup.Tags)) { | ||
'None' | ||
} else { | ||
($AzResourceGroup.Tags.GetEnumerator() | ForEach-Object {"$($_.Key):`t$($_.Value)"}) -join [Environment]::NewLine | ||
} | ||
} | ||
|
||
$AzDnsPrivateResolverInfo += [PSCustomObject]$InObj | ||
} | ||
|
||
if ($InfoLevel.DnsPrivateResolver -ge 2) { | ||
Paragraph "The following sections detail the configuration of the DNS private resolver(s) within the $($AzSubscription.Name) subscription." | ||
foreach ($AzDnsPrivateResolver in $AzDnsPrivateResolverInfo) { | ||
Section -Style NOTOCHeading5 -ExcludeFromTOC "$($AzDnsPrivateResolver.Name)" { | ||
$TableParams = @{ | ||
Name = "Private DNS Resolver - $($AzDnsPrivateResolver.Name)" | ||
List = $true | ||
ColumnWidths = 40, 60 | ||
} | ||
if ($Report.ShowTableCaptions) { | ||
$TableParams['Caption'] = "- $($TableParams.Name)" | ||
} | ||
$AzDnsPrivateResolver | Table @TableParams | ||
|
||
# Inbound Endpoints | ||
if ($AzDnsResolverInboundEndpoint) { | ||
Section -Style NOTOCHeading6 -ExcludeFromTOC 'Inbound Endpoints' { | ||
$InboundEndpointInfo = @() | ||
$InObj = [Ordered]@{ | ||
'Endpoint Name' = $AzDnsResolverInboundEndpoint.Name | ||
'IP Address' = $AzDnsResolverInboundEndpoint.IPConfiguration.PrivateIPAddress | ||
'IP Allocation' = $AzDnsResolverInboundEndpoint.IPConfiguration.PrivateIPAllocationMethod | ||
} | ||
$InboundEndpointInfo += [PSCustomObject]$InObj | ||
|
||
$TableParams = @{ | ||
Name = "Inbound Endpoints - $($AzDnsPrivateResolver.Name)" | ||
List = $false | ||
ColumnWidths = 40, 30, 30 | ||
} | ||
if ($Report.ShowTableCaptions) { | ||
$TableParams['Caption'] = "- $($TableParams.Name)" | ||
} | ||
$InboundEndpointInfo | Table @TableParams | ||
} | ||
} | ||
|
||
# Outbound Endpoints | ||
if ($AzDnsResolverOutboundEndpoint) { | ||
Section -Style NOTOCHeading6 -ExcludeFromTOC 'Outbound Endpoints' { | ||
$OutboundEndpointInfo = @() | ||
$InObj = [Ordered]@{ | ||
'Endpoint Name' = $AzDnsResolverOutboundEndpoint.Name | ||
'IP Address' = $AzDnsResolverOutboundEndpoint.IPConfiguration.PrivateIPAddress | ||
'IP Allocation' = $AzDnsResolverOutboundEndpoint.IPConfiguration.PrivateIPAllocationMethod | ||
} | ||
$OutboundEndpointInfo += [PSCustomObject]$InObj | ||
|
||
$TableParams = @{ | ||
Name = "Outbound Endpoints - $($AzDnsPrivateResolver.Name)" | ||
List = $false | ||
ColumnWidths = 40, 30, 30 | ||
} | ||
if ($Report.ShowTableCaptions) { | ||
$TableParams['Caption'] = "- $($TableParams.Name)" | ||
} | ||
$OutboundEndpointInfo | Table @TableParams | ||
} | ||
} | ||
} | ||
} | ||
} else { | ||
Paragraph "The following table summarises the configuration of the DNS private resolver(s) within the $($AzSubscription.Name) subscription." | ||
BlankLine | ||
$TableParams = @{ | ||
Name = "DNS Private Resolver - $($AzSubscription.Name)" | ||
List = $false | ||
Columns = 'Name', 'Resource Group', 'Location', 'Subscription' | ||
ColumnWidths = 25, 25, 25, 25 | ||
} | ||
if ($Report.ShowTableCaptions) { | ||
$TableParams['Caption'] = "- $($TableParams.Name)" | ||
} | ||
$AzDnsPrivateResolverInfo | Table @TableParams | ||
} | ||
} | ||
} | ||
} | ||
} Catch { | ||
Write-PScriboMessage -IsWarning $($_.Exception.Message) | ||
} | ||
} | ||
|
||
end {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters