From 11b797b4ba0e54e5cf7d9d9992ce8fc28a53e882 Mon Sep 17 00:00:00 2001 From: Mike Preston Date: Tue, 11 Jan 2022 11:37:19 -0500 Subject: [PATCH 01/10] token support --- Src/Public/Invoke-AsBuiltReport.Rubrik.CDM.ps1 | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Src/Public/Invoke-AsBuiltReport.Rubrik.CDM.ps1 b/Src/Public/Invoke-AsBuiltReport.Rubrik.CDM.ps1 index 980d1a4..acabfcf 100644 --- a/Src/Public/Invoke-AsBuiltReport.Rubrik.CDM.ps1 +++ b/Src/Public/Invoke-AsBuiltReport.Rubrik.CDM.ps1 @@ -19,6 +19,7 @@ function Invoke-AsBuiltReport.Rubrik.CDM { param ( [String[]] $Target, [PSCredential] $Credential, + [String] $Token, [String]$StylePath ) @@ -51,7 +52,12 @@ function Invoke-AsBuiltReport.Rubrik.CDM { foreach ($brik in $Target) { try { Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Connection] Connecting to $($brik)" - $RubrikCluster = Connect-Rubrik -Server $brik -Credential $Credential -ErrorAction Stop + if ($Credential) { + $RubrikCluster = Connect-Rubrik -Server $brik -Credential $Credential -ErrorAction Stop + } + else { + $RubrikCluster = Connect-Rubrik -Server $brik -Token $Token -ErrorAction Stop + } } catch { Write-Error $_ } From dac366a39964ce7b1b269be47d0e9782ce524b39 Mon Sep 17 00:00:00 2001 From: Mike Preston Date: Tue, 11 Jan 2022 11:50:25 -0500 Subject: [PATCH 02/10] update changelog --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5ef19bc..0c29fca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Rubrik CDM As Built Report Changelog +## Unreleased + +## Changed +* Added new `Token` parameter to support the ability to connect with an API Token + ## [1.0.1] ### Added From bdb9d8b791ee296c2a3b24a31ac1d84ba49f2054 Mon Sep 17 00:00:00 2001 From: Mike Preston Date: Wed, 12 Jan 2022 09:36:06 -0500 Subject: [PATCH 03/10] added token example --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index a7d7fa5..81b9fea 100644 --- a/README.md +++ b/README.md @@ -152,6 +152,12 @@ The `Healthcheck` section of the Rubrik CDM As Built Report is not currently uti ```powershell New-AsBuiltReport -Target 'cluster1.domain.local' -Username 'administrator@domain.local' -Password 'SuperSecret' -Report Rubrik.CDM -Format Html,Word -OutputFolderPath 'C:\Reports' -Timestamp ``` +- Generate HTML & Word reports using API Token authentication + + Generate a Rubrik CDM As Built Report for a cluster named 'cluster1.domain.local' using specified API Token. Export report to HTML & DOCX formats. Use default report style. Append timestamp to report filename. Save reports to 'C:\Reports\' + ```powershell + New-AsBuiltReport -Target 'cluster1.domain.local' -Token '1234abcd' -Report Rubrik.CDM -Format Html,Word -OutputFolderPath 'C:\Reports' -Timestamp + ``` - Generate HTML & Text reports Generate a Rubrik CDM As Built Report for a cluster named 'cluster1.domain.local' using stored credentials. Export report to HTML & Text formats. Use default report style. Save reports to 'C:\Reports' From 26498bd9c906f52729b7241450ee929d0dde1a76 Mon Sep 17 00:00:00 2001 From: Mike Preston Date: Thu, 3 Feb 2022 09:27:13 -0500 Subject: [PATCH 04/10] update param and required modules --- AsBuiltReport.Rubrik.CDM.psd1 | Bin 9768 -> 9768 bytes .../Invoke-AsBuiltReport.Rubrik.CDM.ps1 | 3 +-- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/AsBuiltReport.Rubrik.CDM.psd1 b/AsBuiltReport.Rubrik.CDM.psd1 index a77e58406d06efd7c9be1664a8da52a4c228420f..eeda9a48dc74edb99e3cfea9ac88d4118a1387b5 100644 GIT binary patch delta 14 VcmZ4Cv%+V?D?Ub}&9C`v#Q`wk1;hXV delta 14 VcmZ4Cv%+V?D?UcU&9C`v#Q`we1;YRU diff --git a/Src/Public/Invoke-AsBuiltReport.Rubrik.CDM.ps1 b/Src/Public/Invoke-AsBuiltReport.Rubrik.CDM.ps1 index acabfcf..410ddca 100644 --- a/Src/Public/Invoke-AsBuiltReport.Rubrik.CDM.ps1 +++ b/Src/Public/Invoke-AsBuiltReport.Rubrik.CDM.ps1 @@ -19,8 +19,7 @@ function Invoke-AsBuiltReport.Rubrik.CDM { param ( [String[]] $Target, [PSCredential] $Credential, - [String] $Token, - [String]$StylePath + [String] $Token ) # Import JSON Configuration for Options and InfoLevel From 7f086671487ab3d544c52de0a43d707e178ca419 Mon Sep 17 00:00:00 2001 From: Mike Preston Date: Thu, 3 Feb 2022 09:32:23 -0500 Subject: [PATCH 05/10] release workflow --- .github/workflows/Release.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .github/workflows/Release.yml diff --git a/.github/workflows/Release.yml b/.github/workflows/Release.yml new file mode 100644 index 0000000..7272757 --- /dev/null +++ b/.github/workflows/Release.yml @@ -0,0 +1,27 @@ +name: Publish PowerShell Module + +on: + release: + types: [published] + +jobs: + publish-to-gallery: + runs-on: windows-2019 + steps: + - uses: actions/checkout@v2 + - name: Set PSRepository to Trusted for PowerShell Gallery + shell: pwsh + run: | + Set-PSRepository -Name PSGallery -InstallationPolicy Trusted + - name: Install AsBuiltReport.Core module + shell: pwsh + run: | + Install-Module -Name AsBuiltReport.Core -Repository PSGallery -Force + - name: Test Module Manifest + shell: pwsh + run: | + Test-ModuleManifest .\AsBuiltReport.Rubrik.CDM.psd1 + - name: Publish module to PowerShell Gallery + shell: pwsh + run: | + Publish-Module -Path ./ -NuGetApiKey ${{ secrets.PSGALLERY_API_KEY }} -Verbose \ No newline at end of file From 2020c3471297f6fa2921eaca5e6e632f4b8eac90 Mon Sep 17 00:00:00 2001 From: Mike Preston Date: Thu, 3 Feb 2022 09:35:38 -0500 Subject: [PATCH 06/10] updated changelog --- CHANGELOG.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0c29fca..dabb04c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,8 +2,13 @@ ## Unreleased -## Changed +### Changed * Added new `Token` parameter to support the ability to connect with an API Token +* Changed Required Modules to AsBuiltReport.Core v1.2.0 +* Removed `StylePath` parameter from `Invoke-AsBuiltReport.Rubrik.CDM.ps1` + +### Added +* Added GitHub workflow for release actions ## [1.0.1] From 3b21ab5927f23d396678fb5ddaff6872f9be36a4 Mon Sep 17 00:00:00 2001 From: Tim Carman Date: Fri, 11 Feb 2022 16:05:50 +1100 Subject: [PATCH 07/10] Update Release workflow * Send automated tweet on release --- .github/workflows/Release.yml | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/.github/workflows/Release.yml b/.github/workflows/Release.yml index 7272757..58970cc 100644 --- a/.github/workflows/Release.yml +++ b/.github/workflows/Release.yml @@ -24,4 +24,19 @@ jobs: - name: Publish module to PowerShell Gallery shell: pwsh run: | - Publish-Module -Path ./ -NuGetApiKey ${{ secrets.PSGALLERY_API_KEY }} -Verbose \ No newline at end of file + Publish-Module -Path ./ -NuGetApiKey ${{ secrets.PSGALLERY_API_KEY }} -Verbose + tweet: + runs-on: ubuntu-latest + steps: + - uses: Eomm/why-don-t-you-tweet@v1 + # We don't want to tweet if the repository is not a public one + if: ${{ !github.event.repository.private }} + with: + # GitHub event payload + # https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#release + tweet-message: "[New Release] ${{ github.event.repository.name }} ${{ github.event.release.tag_name }}! Check out what's new! ${{ github.event.release.html_url }} #AsBuiltReport #PowerShell" + env: + TWITTER_CONSUMER_API_KEY: ${{ secrets.TWITTER_CONSUMER_API_KEY }} + 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 }} \ No newline at end of file From 2a0bf3001f4efef1746af84227b7443c75ae5776 Mon Sep 17 00:00:00 2001 From: Tim Carman Date: Fri, 11 Feb 2022 16:07:42 +1100 Subject: [PATCH 08/10] Update Release workflow * Fix YAML formatting --- .github/workflows/Release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Release.yml b/.github/workflows/Release.yml index 58970cc..db07aba 100644 --- a/.github/workflows/Release.yml +++ b/.github/workflows/Release.yml @@ -25,7 +25,7 @@ jobs: shell: pwsh run: | Publish-Module -Path ./ -NuGetApiKey ${{ secrets.PSGALLERY_API_KEY }} -Verbose - tweet: + tweet: runs-on: ubuntu-latest steps: - uses: Eomm/why-don-t-you-tweet@v1 From 5a6d077c82ec506a179c9807bc038c3a0ce19fa9 Mon Sep 17 00:00:00 2001 From: Tim Carman Date: Mon, 14 Feb 2022 09:17:45 +1100 Subject: [PATCH 09/10] Update release workflow * Add Rubrik hashtag to automated release tweet --- .github/workflows/Release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Release.yml b/.github/workflows/Release.yml index db07aba..bcb9b91 100644 --- a/.github/workflows/Release.yml +++ b/.github/workflows/Release.yml @@ -34,7 +34,7 @@ jobs: with: # GitHub event payload # https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#release - tweet-message: "[New Release] ${{ github.event.repository.name }} ${{ github.event.release.tag_name }}! Check out what's new! ${{ github.event.release.html_url }} #AsBuiltReport #PowerShell" + tweet-message: "[New Release] ${{ github.event.repository.name }} ${{ github.event.release.tag_name }}! Check out what's new! ${{ github.event.release.html_url }} #Rubrik #AsBuiltReport #PowerShell" env: TWITTER_CONSUMER_API_KEY: ${{ secrets.TWITTER_CONSUMER_API_KEY }} TWITTER_CONSUMER_API_SECRET: ${{ secrets.TWITTER_CONSUMER_API_SECRET }} From 2bd4bcc5e373e700a1e154893e1167a57499bc49 Mon Sep 17 00:00:00 2001 From: Tim Carman Date: Wed, 19 Oct 2022 13:12:14 +1100 Subject: [PATCH 10/10] v1.0.2 release ### Changed * Added new `Token` parameter to support the ability to connect with an API Token * Changed Required Modules to AsBuiltReport.Core v1.2.0 * Removed `StylePath` parameter from `Invoke-AsBuiltReport.Rubrik.CDM.ps1` ### Added * Added GitHub workflow for release actions ### Fixed * Fixes [#21](https://github.com/AsBuiltReport/AsBuiltReport.Rubrik.CDM/issues/21) --- .github/workflows/Release.yml | 3 ++- AsBuiltReport.Rubrik.CDM.psd1 | Bin 9768 -> 9768 bytes CHANGELOG.md | 7 +++++-- .../Invoke-AsBuiltReport.Rubrik.CDM.ps1 | 7 +------ 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/.github/workflows/Release.yml b/.github/workflows/Release.yml index bcb9b91..3b0119d 100644 --- a/.github/workflows/Release.yml +++ b/.github/workflows/Release.yml @@ -26,6 +26,7 @@ jobs: run: | Publish-Module -Path ./ -NuGetApiKey ${{ secrets.PSGALLERY_API_KEY }} -Verbose tweet: + needs: publish-to-gallery runs-on: ubuntu-latest steps: - uses: Eomm/why-don-t-you-tweet@v1 @@ -34,7 +35,7 @@ jobs: with: # GitHub event payload # https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#release - tweet-message: "[New Release] ${{ github.event.repository.name }} ${{ github.event.release.tag_name }}! Check out what's new! ${{ github.event.release.html_url }} #Rubrik #AsBuiltReport #PowerShell" + tweet-message: "[New Release] ${{ github.event.repository.name }} ${{ github.event.release.tag_name }}! Check out what's new! ${{ github.event.release.html_url }} #Rubrik #AsBuiltReport #PowerShell #DataProtection" env: TWITTER_CONSUMER_API_KEY: ${{ secrets.TWITTER_CONSUMER_API_KEY }} TWITTER_CONSUMER_API_SECRET: ${{ secrets.TWITTER_CONSUMER_API_SECRET }} diff --git a/AsBuiltReport.Rubrik.CDM.psd1 b/AsBuiltReport.Rubrik.CDM.psd1 index eeda9a48dc74edb99e3cfea9ac88d4118a1387b5..4a4dd343f1cd6bac0d113cfe626093dc03b3ab22 100644 GIT binary patch delta 18 acmZ4Cv%+UX3lpQ!=K*jF!d+{06r`Ru>b%7 diff --git a/CHANGELOG.md b/CHANGELOG.md index dabb04c..1fc1f26 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ -# Rubrik CDM As Built Report Changelog +# :arrows_clockwise: Rubrik CDM As Built Report Changelog -## Unreleased +## [1.0.2] - 2022-10-19 ### Changed * Added new `Token` parameter to support the ability to connect with an API Token @@ -10,6 +10,9 @@ ### Added * Added GitHub workflow for release actions +### Fixed +* Fixes [#21](https://github.com/AsBuiltReport/AsBuiltReport.Rubrik.CDM/issues/21) + ## [1.0.1] ### Added diff --git a/Src/Public/Invoke-AsBuiltReport.Rubrik.CDM.ps1 b/Src/Public/Invoke-AsBuiltReport.Rubrik.CDM.ps1 index 410ddca..0dcec16 100644 --- a/Src/Public/Invoke-AsBuiltReport.Rubrik.CDM.ps1 +++ b/Src/Public/Invoke-AsBuiltReport.Rubrik.CDM.ps1 @@ -5,7 +5,7 @@ function Invoke-AsBuiltReport.Rubrik.CDM { .DESCRIPTION Documents the configuration of the Rubrik CDM in Word/HTML/XML/Text formats using PScribo. .NOTES - Version: 1.0.1 + Version: 1.0.2 Author: Mike Preston Twitter: @mwpreston Github: mwpreston @@ -26,11 +26,6 @@ function Invoke-AsBuiltReport.Rubrik.CDM { $InfoLevel = $ReportConfig.InfoLevel $Options = $ReportConfig.Options - # If custom style not set, use default style - if (!$StylePath) { - & "$PSScriptRoot\..\..\AsBuiltReport.Rubrik.CDM.Style.ps1" - } - #region Script Functions #---------------------------------------------------------------------------------------------# # SCRIPT FUNCTIONS #