Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions .github/workflows/PSScriptAnalyzer.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
name: PSScriptAnalyzer
on: [push, pull_request]
jobs:
lint:
name: Run PSScriptAnalyzer
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- 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
lint:
name: Run PSScriptAnalyzer
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- 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
96 changes: 44 additions & 52 deletions .github/workflows/Release.yml
Original file line number Diff line number Diff line change
@@ -1,57 +1,49 @@
name: Publish PowerShell Module

on:
release:
types: [published]
release:
types: [published]

jobs:
publish-to-gallery:
runs-on: windows-2022
steps:
- uses: actions/checkout@v4
- name: Set PSRepository to Trusted for PowerShell Gallery
shell: pwsh
run: |
Set-PSRepository -Name PSGallery -InstallationPolicy Trusted
- name: Install DBAtools module
shell: pwsh
run: |
Install-Module -Name dbatools -Repository PSGallery -Force
- 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.Microsoft.Windows.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@v2
# 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 }} #Microsoft #Windows #AsBuiltReport #PowerShell #MVPBuzz"
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 }}
bsky-post:
needs: publish-to-gallery
runs-on: ubuntu-latest
steps:
- uses: zentered/bluesky-post-action@v0.2.0
with:
post: "[New Release] ${{ github.event.repository.name }} ${{ github.event.release.tag_name }}! Check out what's new! ${{ github.event.release.html_url }} #Microsoft #Windows #AsBuiltReport #PowerShell #MVPBuzz"
env:
BSKY_IDENTIFIER: ${{ secrets.BSKY_IDENTIFIER }}
BSKY_PASSWORD: ${{ secrets.BSKY_PASSWORD }}
publish-to-gallery:
runs-on: windows-latest
steps:
- uses: actions/checkout@v7
- name: Set PSRepository to Trusted for PowerShell Gallery
shell: pwsh
run: |
Set-PSRepository -Name PSGallery -InstallationPolicy Trusted
- name: Install DBAtools module
shell: pwsh
run: |
Install-Module -Name dbatools -Repository PSGallery -Force
- name: Install AsBuiltReport.Core module
shell: pwsh
run: |
Install-Module -Name AsBuiltReport.Core -Repository PSGallery -Force
- name: Install AsBuiltReport.Chart module
shell: pwsh
run: |
Install-Module -Name AsBuiltReport.Chart -Repository PSGallery -Force
- name: Install AsBuiltReport.Diagram module
shell: pwsh
run: |
Install-Module -Name AsBuiltReport.Diagram -Repository PSGallery -Force
- name: Test Module Manifest
shell: pwsh
run: |
Test-ModuleManifest .\AsBuiltReport.Microsoft.Windows\AsBuiltReport.Microsoft.Windows.psd1
- name: Publish module to PowerShell Gallery
shell: pwsh
run: |
Publish-Module -Path ./AsBuiltReport.Microsoft.Windows -NuGetApiKey ${{ secrets.PSGALLERY_API_KEY }} -Verbose
bsky-post:
needs: publish-to-gallery
runs-on: ubuntu-latest
steps:
- uses: zentered/bluesky-post-action@v0.4.0
with:
post: "[New Release] ${{ github.event.repository.name }} ${{ github.event.release.tag_name }}! Check out what's new! ${{ github.event.release.html_url }} #Microsoft #Windows #AsBuiltReport #PowerShell #MVPBuzz"
env:
BSKY_IDENTIFIER: ${{ secrets.BSKY_IDENTIFIER }}
BSKY_PASSWORD: ${{ secrets.BSKY_PASSWORD }}
58 changes: 29 additions & 29 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,38 +10,38 @@
name: CodeQL

on:
push:
branches: [ "dev" ]
pull_request:
branches: [ "dev" ]
push:
branches: ["dev"]
pull_request:
branches: ["dev"]

permissions:
contents: read
contents: read

jobs:
build:
permissions:
contents: read # for actions/checkout to fetch code
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
name: PSScriptAnalyzer
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
build:
permissions:
contents: read # for actions/checkout to fetch code
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
name: PSScriptAnalyzer
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7

- name: Run PSScriptAnalyzer
uses: microsoft/psscriptanalyzer-action@v1.1
with:
# Check https://github.com/microsoft/action-psscriptanalyzer for more info about the options.
# The below set up runs PSScriptAnalyzer to your entire repository and runs some basic security rules.
path: .\
recurse: true
# Include your own basic security rules. Removing this option will run all the rules
excludeRule: '"PSAvoidUsingPlainTextForPassword", "PSAvoidUsingUsernameAndPasswordParams", "PSAvoidUsingConvertToSecureStringWithPlainText"'
output: results.sarif
- name: Run PSScriptAnalyzer
uses: microsoft/psscriptanalyzer-action@v1.1
with:
# Check https://github.com/microsoft/action-psscriptanalyzer for more info about the options.
# The below set up runs PSScriptAnalyzer to your entire repository and runs some basic security rules.
path: .\
recurse: true
# Include your own basic security rules. Removing this option will run all the rules
excludeRule: '"PSAvoidUsingPlainTextForPassword", "PSAvoidUsingUsernameAndPasswordParams", "PSAvoidUsingConvertToSecureStringWithPlainText"'
output: results.sarif

# Upload the SARIF file generated in the previous step
- name: Upload SARIF results file
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: results.sarif
# Upload the SARIF file generated in the previous step
- name: Upload SARIF results file
uses: github/codeql-action/upload-sarif@v4
with:
sarif_file: results.sarif

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
RootModule = 'AsBuiltReport.Microsoft.Windows.psm1'

# Version number of this module.
ModuleVersion = '0.5.7'
ModuleVersion = '0.6.0'

# Supported PSEditions
# CompatiblePSEditions = @()
Expand All @@ -27,7 +27,7 @@
# CompanyName = 'Unknown'

# Copyright statement for this module
Copyright = '(c) 2024 Andrew Ramsay. All rights reserved.'
Copyright = '(c) 2026 Andrew Ramsay. All rights reserved.'

# Description of the functionality provided by this module
Description = 'A PowerShell module to generate an as built report on the configuration of Microsoft Windows.'
Expand All @@ -54,11 +54,19 @@
RequiredModules = @(
@{
ModuleName = 'AsBuiltReport.Core';
ModuleVersion = '1.4.3'
ModuleVersion = '1.6.4'
},
@{
ModuleName = 'AsBuiltReport.Chart';
ModuleVersion = '0.3.3'
},
@{
ModuleName = 'AsBuiltReport.Diagram';
ModuleVersion = '1.0.8'
},
@{
ModuleName = 'dbatools';
ModuleVersion = '2.5.1'
ModuleVersion = '2.8.2'
}
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function Get-AbrWinApplication {

begin {
Write-PScriboMessage "Operating System InfoLevel set at $($InfoLevel.OperatingSystem)."
Write-PScriboMessage "Collecting Application Inventory information."
Write-PScriboMessage 'Collecting Application Inventory information.'
}

process {
Expand All @@ -35,18 +35,18 @@ function Get-AbrWinApplication {
Paragraph 'The following settings details applications listed in Add/Remove Programs'
BlankLine
$OutObj = @()
ForEach ($App in $AddRemove) {
foreach ($App in $AddRemove) {
try {
$inObj = [ordered] @{
'Application Name' = $App.DisplayName
'Publisher' = $App.Publisher
'Version' = Switch ([string]::IsNullOrEmpty($App.DisplayVersion)) {
$true { "--" }
'Version' = switch ([string]::IsNullOrEmpty($App.DisplayVersion)) {
$true { '--' }
$false { $App.DisplayVersion }
default { "Unknown" }
default { 'Unknown' }
}
'Install Date' = Switch ([string]::IsNullOrEmpty($App.InstallDate)) {
$true { "--" }
'Install Date' = switch ([string]::IsNullOrEmpty($App.InstallDate)) {
$true { '--' }
$false { $App.InstallDate }
default { 'Unknown' }
}
Expand All @@ -57,7 +57,7 @@ function Get-AbrWinApplication {
}
}
$TableParams = @{
Name = "Installed Applications"
Name = 'Installed Applications'
List = $false
ColumnWidths = 30, 30, 20, 20
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function Get-AbrWinDHCPInfrastructure {

begin {
Write-PScriboMessage "DHCP InfoLevel set at $($InfoLevel.DHCP)."
Write-PScriboMessage "Collecting Host DHCP Server information."
Write-PScriboMessage 'Collecting Host DHCP Server information.'
}

process {
Expand All @@ -41,12 +41,12 @@ function Get-AbrWinDHCPInfrastructure {
'Database Path' = $Database.FileName
'Database Backup Path' = $Database.BackupPath
'Database Backup Interval' = switch ([string]::IsNullOrEmpty($Database.BackupInterval)) {
$true { "--" }
$true { '--' }
$false { "$($Database.BackupInterval) min" }
default { 'Unknown' }
}
'Database Logging Enabled' = Switch ([string]::IsNullOrEmpty($Database.LoggingEnabled)) {
$true { "--" }
'Database Logging Enabled' = switch ([string]::IsNullOrEmpty($Database.LoggingEnabled)) {
$true { '--' }
$false { $Database.LoggingEnabled }
default { 'Unknown' }
}
Expand All @@ -61,12 +61,12 @@ function Get-AbrWinDHCPInfrastructure {
if ($HealthCheck.DHCP.BP) {
$OutObj | Where-Object { $_.'Conflict Detection Attempts' -eq 0 } | Set-Style -Style Warning -Property 'Conflict Detection Attempts'
$OutObj | Where-Object { $_.'Authorized' -like 'No' } | Set-Style -Style Warning -Property 'Authorized'
$OutObj | Where-Object { $_.'User Name' -like "--" } | Set-Style -Style Warning -Property 'User Name', 'Domain Name'
$OutObj | Where-Object { $_.'User Name' -like '--' } | Set-Style -Style Warning -Property 'User Name', 'Domain Name'

}

$TableParams = @{
Name = "DHCP Servers Settings - $($System.toUpper().split(".")[0])"
Name = "DHCP Servers Settings - $($System.toUpper().split('.')[0])"
List = $true
ColumnWidths = 40, 60
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,22 @@ function Get-AbrWinDHCPv4PerScopeSetting {

begin {
Write-PScriboMessage "DHCP InfoLevel set at $($InfoLevel.DHCP)."
Write-PScriboMessage "Collecting Host DHCP Server Scope information."
Write-PScriboMessage 'Collecting Host DHCP Server Scope information.'
}

process {
try {
$DHCPScopes = Get-DhcpServerv4Scope -CimSession $TempCimSession | Select-Object -ExpandProperty ScopeId
if ($DHCPScopes) {
Section -Style Heading3 "Per Scope Options" {
Paragraph "The following section provides a summary of the DHCP servers Scope Server Options information."
Section -Style Heading3 'Per Scope Options' {
Paragraph 'The following section provides a summary of the DHCP servers Scope Server Options information.'
BlankLine
foreach ($Scope in $DHCPScopes) {
try {
$DHCPScopeOptions = Get-DhcpServerv4OptionValue -CimSession $TempCIMSession -ScopeId $Scope
if ($DHCPScopeOptions) {
Section -Style Heading4 "$Scope" {
Paragraph "The following table details Scope Server Options Settings."
Paragraph 'The following table details Scope Server Options Settings.'
BlankLine
$OutObj = @()
foreach ($Option in $DHCPScopeOptions) {
Expand Down
Loading