Skip to content

Commit

Permalink
Merge pull request #40 from AsBuiltReport/dev
Browse files Browse the repository at this point in the history
v1.2.0
  • Loading branch information
tpcarman authored Feb 11, 2022
2 parents b00ff86 + 1624fff commit ecdc327
Show file tree
Hide file tree
Showing 10 changed files with 287 additions and 72 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/PSScriptAnalyzer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: PSScriptAnalyzer
on: [push, pull_request]
jobs:
lint:
name: Run PSScriptAnalyzer
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: lint
uses: devblackops/github-action-psscriptanalyzer@master
with:
sendComment: true
failOnErrors: true
failOnWarnings: false
failOnInfos: false
repoToken: ${{ secrets.GITHUB_TOKEN }}
settingsPath: .github/workflows/PSScriptAnalyzerSettings.psd1
8 changes: 8 additions & 0 deletions .github/workflows/PSScriptAnalyzerSettings.psd1
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
@{
ExcludeRules = @(
'PSUseToExportFieldsInManifest',
'PSReviewUnusedParameter',
'PSUseDeclaredVarsMoreThanAssignments',
'PSAvoidGlobalVars'
)
}
38 changes: 38 additions & 0 deletions .github/workflows/Release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Publish PowerShell Module

on:
release:
types: [published]

jobs:
publish-to-gallery:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set PSRepository to Trusted for PowerShell Gallery
shell: pwsh
run: |
Set-PSRepository -Name PSGallery -InstallationPolicy Trusted
- name: Install PScribo module
shell: pwsh
run: |
Install-Module -Name PScribo -Repository PSGallery -Force
- name: Publish module to PowerShell Gallery
shell: pwsh
run: |
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 }}
1 change: 0 additions & 1 deletion .gitignore

This file was deleted.

4 changes: 2 additions & 2 deletions AsBuiltReport.Core.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

# Version number of this module.

ModuleVersion = '1.1.0'
ModuleVersion = '1.2.0'

# Supported PSEditions
# CompatiblePSEditions = 'Desktop'
Expand Down Expand Up @@ -54,7 +54,7 @@
# Modules that must be imported into the global environment prior to importing this module
RequiredModules = @(
@{
ModuleName = 'PScribo';
ModuleName = 'PScribo';
ModuleVersion = '0.9.1'
}
)
Expand Down
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
# :arrows_counterclockwise: AsBuiltReport.Core Changelog

## [1.2.0] - 2022-02-11
### Added
* Added new `Token` and `MFA` parameters and subsequent parameter sets to `New-AsBuiltReport` cmdlet to allow alternative authentication methods

### Changed
* Updated GitHub Action release workflow to send automated tweets on each release
## [1.1.0] - 2020-08-16
### Changed
### Changed
- Updated `New-AsBuiltReport` parameter names to provide clarity of input requirements. Aliases used to prevent breaking changes.
- `OutputPath` now an alias for `OutputFolderPath`
- `StylePath` now an alias for `StyleFilePath`
Expand Down
162 changes: 131 additions & 31 deletions CONTRIBUTING.md

Large diffs are not rendered by default.

28 changes: 16 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<p align="center">
<a href="https://www.asbuiltreport.com/" alt="AsBuiltReport"></a>
<a href="https://www.asbuiltreport.com/" alt="AsBuiltReport"></a>
<img src='https://raw.githubusercontent.com/AsBuiltReport/AsBuiltReport/master/AsBuiltReport.png' width="8%" height="8%" /></a>
</p>
<p align="center">
Expand Down Expand Up @@ -35,9 +35,9 @@ The following simple list of instructions will get you started with the AsBuiltR
### **PowerShell**
This report is compatible with the following PowerShell versions;

| Windows PowerShell 5.1 | PowerShell Core | PowerShell 7 |
|:----------------------:|:------------------:|:------------------:|
| :white_check_mark: | :white_check_mark: | :white_check_mark: |
| Windows PowerShell 5.1 | PowerShell 7 |
|:----------------------:|:------------------:|
| :white_check_mark: | :white_check_mark: |

## :wrench: System Requirements

Expand Down Expand Up @@ -71,7 +71,7 @@ If you are unable to use the PowerShell Gallery, you can still install the modul
1. Download the [latest release](https://github.com/AsBuiltReport/AsBuiltReport.Core/releases/latest) zip from GitHub
2. Extract the zip file
3. Copy the folder `AsBuiltReport.Core` to a path that is set in `$env:PSModulePath`. By default this could be `C:\Program Files\WindowsPowerShell\Modules` or `C:\Users\<user>\Documents\WindowsPowerShell\Modules`
4. Open a PowerShell terminal window and unblock the downloaded files with
4. Open a PowerShell terminal window and unblock the downloaded files with
```powershell
$path = (Get-Module -Name AsBuiltReport.Core -ListAvailable).ModuleBase; Unblock-File -Path $path\*.psd1; Unblock-File -Path $path\Src\Public\*.ps1
```
Expand All @@ -97,6 +97,10 @@ The `New-AsBuiltReport` cmdlet is used to generate as built reports. The type of
Specifies the username for the target system.
.PARAMETER Password
Specifies the password for the target system.
.PARAMETER Token
Specifies an API token to authenticate to the target system.
.PARAMETER MFA
Use multifactor authentication to authenticate to the target system.
.PARAMETER Format
Specifies the output format of the report.
The supported output formats are WORD, HTML & TEXT.
Expand All @@ -120,7 +124,7 @@ The `New-AsBuiltReport` cmdlet is used to generate as built reports. The type of
Sends report to specified recipients as email attachments.
.PARAMETER AsBuiltConfigFilePath
Enter the full path to the As Built Report configuration JSON file.
If this parameter is not specified, the user will be prompted for this configuration information on first
If this parameter is not specified, the user will be prompted for this configuration information on first
run, with the option to save the configuration to a file.
.PARAMETER ReportConfigFilePath
Enter the full path to a report JSON configuration file.
Expand All @@ -136,7 +140,7 @@ Get-Help New-AsBuiltReport -Full

### **New-AsBuiltConfig**
`New-AsBuiltConfig` starts a menu-driven procedure in the powershell console and asks the user a series of questions. Answers to these questions are optionally saved in a JSON configuration file which can then be referenced using the `-AsBuiltConfigFilePath` parameter using `New-AsBuiltReport`, to save having to answer these questions again and also to allow the automation of `New-AsBuiltReport`.

`New-AsBuiltConfig` will automatically be called by `New-AsBuiltReport` if the `-AsBuiltConfigFilePath` parameter is not specified. If a user wants to generate a new As Built JSON configuration without running a new report, this cmdlet can be called as a standalone cmdlet.

### **New-AsBuiltReportConfig**
Expand All @@ -154,10 +158,10 @@ The `New-AsBuiltReportConfig` cmdlet is used to create JSON configuration files
.PARAMETER Force
Specifies to overwrite any existing report JSON configuration file
.EXAMPLE
Creates a report JSON configuration file for VMware vSphere, named 'vSphere_Report_Config' in 'C:\Reports' folder.
Creates a report JSON configuration file for VMware vSphere, named 'vSphere_Report_Config' in 'C:\Reports' folder.
New-AsBuiltReportConfig -Report VMware.vSphere -FolderPath 'C:\Reports' -Filename 'vSphere_Report_Config'
.EXAMPLE
Creates a report JSON configuration file for Nutanix Prism Central, named 'AsBuiltReport.Nutanix.PrismCentral' in 'C:\Reports' folder, overwriting any existing file.
Creates a report JSON configuration file for Nutanix Prism Central, named 'AsBuiltReport.Nutanix.PrismCentral' in 'C:\Reports' folder, overwriting any existing file.
New-AsBuiltReportConfig -Report Nutanix.PrismCentral -FolderPath 'C:\Reports' -Force
```

Expand Down Expand Up @@ -193,10 +197,10 @@ PS C:\>New-AsBuiltReport -Report VMware.NSXv -Target 192.168.1.100 -Username adm
## :pencil: Notes
- Table Of Contents (TOC) may be missing in Word formatted report

When opening the DOCX report, MS Word prompts the following
When opening the DOCX report, MS Word prompts the following

`"This document contains fields that may refer to other files. Do you want to update the fields in this document?"`

`Yes / No`

Clicking `No` will prevent the TOC fields being updated and leaving the TOC empty.
Expand Down
Loading

0 comments on commit ecdc327

Please sign in to comment.