From 5ab468b8e23e371eb8dc446aeac9187e3e8dc9e2 Mon Sep 17 00:00:00 2001 From: Jonathan Colon Date: Thu, 21 Mar 2024 09:44:49 -0400 Subject: [PATCH 1/4] Fix #25 --- CHANGELOG.md | 4 +++- Src/Private/Get-AbrWinApplication.ps1 | 13 +++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fc1d129..2b52217 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [0.5.4] - Unreleased -### Added +### Fixed + +- Fix #25 ## [0.5.3] - 2024-03-06 diff --git a/Src/Private/Get-AbrWinApplication.ps1 b/Src/Private/Get-AbrWinApplication.ps1 index 9f57723..ff8f65a 100644 --- a/Src/Private/Get-AbrWinApplication.ps1 +++ b/Src/Private/Get-AbrWinApplication.ps1 @@ -5,7 +5,7 @@ function Get-AbrWinApplication { .DESCRIPTION Documents the configuration of Microsoft Windows Server in Word/HTML/Text formats using PScribo. .NOTES - Version: 0.5.2 + Version: 0.5.4 Author: Andrew Ramsay Editor: Jonathan Colon Twitter: @asbuiltreport @@ -40,14 +40,15 @@ function Get-AbrWinApplication { $TempAddRemoveReport = [PSCustomObject]@{ 'Application Name' = $App.DisplayName 'Publisher' = $App.Publisher - 'Version' = Switch ([string]::IsNullOrEmpty($App.Version)) { + 'Version' = Switch ([string]::IsNullOrEmpty($App.DisplayVersion)) { $true { "--" } - $false { $App.Version } + $false { $App.DisplayVersion } default { "Unknown" } } - 'Install Date' = Switch (($App.InstallDate).count) { - 0 { "--" } - default { $App.InstallDate } + 'Install Date' = Switch ([string]::IsNullOrEmpty($App.InstallDate)) { + $true { "--" } + $false {$App.InstallDate} + default { 'Unknown' } } } $AddRemoveReport += $TempAddRemoveReport From 94fb7b7c8823bd5cb1ee80641d0dc0d5614be843 Mon Sep 17 00:00:00 2001 From: Jonathan Colon Date: Wed, 3 Apr 2024 23:02:18 -0400 Subject: [PATCH 2/4] Misc changes --- .github/workflows/codeql.yml | 2 -- Src/Private/Get-AbrWinDNSZone.ps1 | 2 +- Src/Private/Get-AbrWinFOCluster.ps1 | 12 +++++------- Src/Private/Get-AbrWinFOClusterFaultDomain.ps1 | 12 ++++++------ Src/Private/Get-AbrWinNetDNSClient.ps1 | 4 ++-- Src/Private/Get-AbrWinSQLBuild.ps1 | 2 +- 6 files changed, 15 insertions(+), 19 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 25480fd..cadfeb5 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -14,8 +14,6 @@ on: branches: [ "dev" ] pull_request: branches: [ "dev" ] - schedule: - - cron: '20 14 * * 1' permissions: contents: read diff --git a/Src/Private/Get-AbrWinDNSZone.ps1 b/Src/Private/Get-AbrWinDNSZone.ps1 index bbb467e..8204abb 100644 --- a/Src/Private/Get-AbrWinDNSZone.ps1 +++ b/Src/Private/Get-AbrWinDNSZone.ps1 @@ -1,7 +1,7 @@ function Get-AbrWinDNSZone { <# .SYNOPSIS - Used by As Built Report to retrieve Microsoft Windows Domain Name System Zone information. + Used by As Built Report to retrieve Microsoft Windows Domain Name System Zone information. .DESCRIPTION Documents the configuration of Microsoft Windows Server in Word/HTML/Text formats using PScribo. .NOTES diff --git a/Src/Private/Get-AbrWinFOCluster.ps1 b/Src/Private/Get-AbrWinFOCluster.ps1 index ba6e8a8..e462258 100644 --- a/Src/Private/Get-AbrWinFOCluster.ps1 +++ b/Src/Private/Get-AbrWinFOCluster.ps1 @@ -21,7 +21,7 @@ function Get-AbrWinFOCluster { begin { Write-PScriboMessage "FailOverCluster InfoLevel set at $($InfoLevel.FailOverCluster)." - Write-PscriboMessage "Collecting Host FailOver Cluster Server information." + Write-PScriboMessage "Collecting Host FailOver Cluster Server information." } process { @@ -38,9 +38,8 @@ function Get-AbrWinFOCluster { 'Description' = ConvertTo-EmptyToFiller $Settings.Description } $OutObj += [pscustomobject]$inobj - } - catch { - Write-PscriboMessage -IsWarning $_.Exception.Message + } catch { + Write-PScriboMessage -IsWarning $_.Exception.Message } $TableParams = @{ @@ -53,9 +52,8 @@ function Get-AbrWinFOCluster { } $OutObj | Table @TableParams } - } - catch { - Write-PscriboMessage -IsWarning $_.Exception.Message + } catch { + Write-PScriboMessage -IsWarning $_.Exception.Message } } diff --git a/Src/Private/Get-AbrWinFOClusterFaultDomain.ps1 b/Src/Private/Get-AbrWinFOClusterFaultDomain.ps1 index 4128adb..9281b3f 100644 --- a/Src/Private/Get-AbrWinFOClusterFaultDomain.ps1 +++ b/Src/Private/Get-AbrWinFOClusterFaultDomain.ps1 @@ -36,14 +36,14 @@ function Get-AbrWinFOClusterFaultDomain { 'Name' = $Setting.Name 'Type' = $Setting.Type 'Parent Name' = Switch ([string]::IsNullOrEmpty($Setting.ParentName)) { - $true {"--"} - $false {$Setting.ParentName} - default {'Unknown'} + $true { "--" } + $false { $Setting.ParentName } + default { 'Unknown' } } 'Children Names' = Switch ([string]::IsNullOrEmpty($Setting.ChildrenNames)) { - $true {"--"} - $false {$Setting.ChildrenNames} - default {'Unknown'} + $true { "--" } + $false { $Setting.ChildrenNames } + default { 'Unknown' } } 'Location' = ConvertTo-EmptyToFiller $Setting.Location } diff --git a/Src/Private/Get-AbrWinNetDNSClient.ps1 b/Src/Private/Get-AbrWinNetDNSClient.ps1 index 1b981d8..77827b3 100644 --- a/Src/Private/Get-AbrWinNetDNSClient.ps1 +++ b/Src/Private/Get-AbrWinNetDNSClient.ps1 @@ -30,7 +30,7 @@ function Get-AbrWinNetDNSClient { $DnsClient = Invoke-Command -Session $TempPssSession { Get-DnsClientGlobalSetting } if ($DnsClient) { Section -Style Heading3 'DNS Client' { - Paragraph 'The following table details the DNS Seach Domains' + Paragraph 'The following table details the DNS Search Domains' BlankLine $DnsClientReport = [PSCustomObject]@{ 'DNS Suffix' = $DnsClient.SuffixSearchList -Join "," @@ -39,7 +39,7 @@ function Get-AbrWinNetDNSClient { 'Devolution Level' = $DnsClient.DevolutionLevel } $TableParams = @{ - Name = "DNS Seach Domain" + Name = "DNS Search Domain" List = $false ColumnWidths = 40, 20, 20, 20 } diff --git a/Src/Private/Get-AbrWinSQLBuild.ps1 b/Src/Private/Get-AbrWinSQLBuild.ps1 index b97cb5b..c5d066d 100644 --- a/Src/Private/Get-AbrWinSQLBuild.ps1 +++ b/Src/Private/Get-AbrWinSQLBuild.ps1 @@ -31,7 +31,7 @@ function Get-AbrWinSQLBuild { $Build = Get-DbaBuild -SqlInstance $SQLServer -WarningAction SilentlyContinue if ($Properties) { Section -Style Heading3 'General Information' { - Paragraph 'The following table details sql server Properties information' + Paragraph 'The following table details sql server properties information' BlankLine [array]$SQLServerObjt = @() $TempSQLServerObjt = [PSCustomObject]@{ From 124621eb6900cf3942936bac91aaea2ee14cd99a Mon Sep 17 00:00:00 2001 From: Jonathan Colon Date: Sun, 7 Apr 2024 13:36:34 -0400 Subject: [PATCH 3/4] New-AsBuiltReport : Exception calling "Save" with "1" argument(s): "'.', hexadecimal value 0x00, is an invalid character." #26 --- Src/Private/Get-AbrWinHostStorageVolume.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Src/Private/Get-AbrWinHostStorageVolume.ps1 b/Src/Private/Get-AbrWinHostStorageVolume.ps1 index 8814443..c5ddc74 100644 --- a/Src/Private/Get-AbrWinHostStorageVolume.ps1 +++ b/Src/Private/Get-AbrWinHostStorageVolume.ps1 @@ -27,7 +27,7 @@ function Get-AbrWinHostStorageVolume { process { if ($InfoLevel.Storage -ge 1) { try { - $HostVolumes = Invoke-Command -Session $TempPssSession -ScriptBlock { Get-Volume | Where-Object {$_.DriveType -ne "CD-ROM" -and $NUll -ne $_.DriveLetter} } + $HostVolumes = Invoke-Command -Session $TempPssSession -ScriptBlock { Get-Volume | Where-Object {$_.DriveType -ne "CD-ROM" -and $_.DriveLetter} } if ($HostVolumes) { Section -Style Heading3 'Host Volumes' { Paragraph 'The following section details local volumes on the host' From 1c3d3667bd22808e391e52ee9177e27d6592df16 Mon Sep 17 00:00:00 2001 From: Jonathan Colon Date: Sun, 7 Apr 2024 14:06:27 -0400 Subject: [PATCH 4/4] New-AsBuiltReport : Exception calling "Save" with "1" argument(s): "'.', hexadecimal value 0x00, is an invalid character." #26 --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2b52217..9b4bc73 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed -- Fix #25 +- Fix [#25](https://github.com/AsBuiltReport/AsBuiltReport.Microsoft.Windows/issues/25) +- Fix [#26](https://github.com/AsBuiltReport/AsBuiltReport.Microsoft.Windows/issues/26) ## [0.5.3] - 2024-03-06