Skip to content

Commit

Permalink
Merge pull request #22 from AsBuiltReport/dev
Browse files Browse the repository at this point in the history
v1.0.2 release
  • Loading branch information
tpcarman committed Oct 19, 2022
2 parents 18ad96a + 2bd4bcc commit 88d7467
Show file tree
Hide file tree
Showing 5 changed files with 71 additions and 9 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/Release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
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
tweet:
needs: publish-to-gallery
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 }} #Rubrik #AsBuiltReport #PowerShell #DataProtection"
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 }}
Binary file modified AsBuiltReport.Rubrik.CDM.psd1
Binary file not shown.
15 changes: 14 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@
# Rubrik CDM As Built Report Changelog
# :arrows_clockwise: Rubrik CDM As Built Report Changelog

## [1.0.2] - 2022-10-19

### 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)

## [1.0.1]

Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 '[email protected]' -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'
Expand Down
16 changes: 8 additions & 8 deletions Src/Public/Invoke-AsBuiltReport.Rubrik.CDM.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -19,18 +19,13 @@ function Invoke-AsBuiltReport.Rubrik.CDM {
param (
[String[]] $Target,
[PSCredential] $Credential,
[String]$StylePath
[String] $Token
)

# Import JSON Configuration for Options and InfoLevel
$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 #
Expand All @@ -51,7 +46,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 $_
}
Expand Down

0 comments on commit 88d7467

Please sign in to comment.