From d268e988b8875a081a3d4994c792166c10710778 Mon Sep 17 00:00:00 2001 From: Jonathan Colon Date: Mon, 8 May 2023 20:52:08 -0400 Subject: [PATCH 01/14] Update README.md --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d8effc8..0f25153 100644 --- a/README.md +++ b/README.md @@ -71,6 +71,7 @@ PowerShell 5.1 and the following PowerShell modules are required for generating - [Hyper-V Module](https://docs.microsoft.com/en-us/powershell/module/hyper-v/?view=windowsserver2022-ps) - [DhcpServer Module](https://docs.microsoft.com/en-us/powershell/module/dhcpserver/?view=windowsserver2019-ps) - [DnsServer Module](https://docs.microsoft.com/en-us/powershell/module/dnsserver/?view=windowsserver2019-ps) +- [FailoverClusters Module](https://learn.microsoft.com/en-us/powershell/module/failoverclusters/?view=windowsserver2022-ps) ### Linux & macOS @@ -105,7 +106,7 @@ Install-WindowsFeature -Name RSAT-Clustering-PowerShell ``` -### PowerShell v5.x running on Windows client computer +### PowerShell v5.x running on Windows client computer (Target) ```powershell Install-Module AsBuiltReport.Microsoft.Windows From b73aec3c0080541d54b50115d1b1a237b2836def Mon Sep 17 00:00:00 2001 From: oolejniczak Date: Tue, 9 May 2023 11:22:26 +0200 Subject: [PATCH 02/14] Update Get-AbrWinHyperVHostVM.ps1 Fix various bugs, spelling mistakes.. --- Src/Private/Get-AbrWinHyperVHostVM.ps1 | 502 +++++++++++++------------ 1 file changed, 254 insertions(+), 248 deletions(-) diff --git a/Src/Private/Get-AbrWinHyperVHostVM.ps1 b/Src/Private/Get-AbrWinHyperVHostVM.ps1 index 4709552..a3aec13 100644 --- a/Src/Private/Get-AbrWinHyperVHostVM.ps1 +++ b/Src/Private/Get-AbrWinHyperVHostVM.ps1 @@ -1,267 +1,273 @@ + function Get-AbrWinHyperVHostVM { - <# - .SYNOPSIS - Used by As Built Report to retrieve Windows Server Hyper-V VM information. - .DESCRIPTION - Documents the configuration of Microsoft Windows Server in Word/HTML/Text formats using PScribo. - .NOTES - Version: 0.2.0 - Author: Andrew Ramsay - Editor: Jonathan Colon - Twitter: @asbuiltreport - Github: AsBuiltReport - Credits: Iain Brighton (@iainbrighton) - PScribo module + <# + .SYNOPSIS + Used by As Built Report to retrieve Windows Server Hyper-V VM information. + .DESCRIPTION + Documents the configuration of Microsoft Windows Server in Word/HTML/Text formats using PScribo. + .NOTES + Version: 0.2.0 + Author: Andrew Ramsay + Editor: Jonathan Colon + Twitter: @asbuiltreport + Github: AsBuiltReport + Credits: Iain Brighton (@iainbrighton) - PScribo module - .LINK - https://github.com/AsBuiltReport/AsBuiltReport.Microsoft.Windows - #> - [CmdletBinding()] - param ( - ) + .LINK + https://github.com/AsBuiltReport/AsBuiltReport.Microsoft.Windows + #> + [CmdletBinding()] + param ( + ) - begin { - Write-PScriboMessage "Hyper-V InfoLevel set at $($InfoLevel.HyperV)." - Write-PscriboMessage "Collecting Hyper-V VM information." - } + begin { + Write-PScriboMessage "Hyper-V InfoLevel set at $($InfoLevel.HyperV)." + Write-PscriboMessage "Collecting Hyper-V VM information." + } - process { - if ($InfoLevel.HyperV -ge 1) { - $Vms = Get-VM -CimSession $TempCimSession - if ($Vms) { - try { - Section -Style Heading2 'Hyper-V VMs' { - Paragraph 'The following section details the Hyper-V VMs running on this host' - Blankline - $VmSummary = @() - foreach ($Vm in $Vms) { - try { - $TempVmSummary = [PSCustomObject]@{ - 'VM Name' = $Vm.Name - 'vCPU Count' = $Vm.ProcessorCount - 'Memory (GB)' = [Math]::Round($Vm.MemoryAssigned / 1gb) - 'Memory Type' = $Vm.DynamicMemoryEnabled - 'Generation' = $Vm.Generation - 'Version' = $Vm.Version - 'Numa Aligned' = $Vm.NumaAligned - } - $VmSummary += $TempVmSummary - } - catch { - Write-PscriboMessage -IsWarning $_.Exception.Message + process { + if ($InfoLevel.HyperV -ge 1) { + #$Vms = Get-VM -CimSession $TempCimSession + $global:Vms = Invoke-Command -Session $TempPssSession { Get-VM } + + if ($Vms) { + try { + Section -Style Heading2 'Hyper-V VMs' { + Paragraph 'The following section details the Hyper-V VMs running on this host' + Blankline + $VmSummary = @() + foreach ($Vm in $Vms) { + try { + $TempVmSummary = [PSCustomObject]@{ + 'VM Name' = $Vm.Name + 'State' = $Vm.State + 'Version' = $Vm.Version + } + $VmSummary += $TempVmSummary + } + catch { + Write-PscriboMessage -IsWarning $_.Exception.Message + } + } + $TableParams = @{ + Name = "Virtual Machines" + List = $false + #ColumnWidths = 50, 50 + } + if ($Report.ShowTableCaptions) { + $TableParams['Caption'] = "- $($TableParams.Name)" + } + $VmSummary | Sort-Object 'VM Name' | Table @TableParams + + foreach ($Vm in $Vms) { + try { + Section -Style Heading3 ($Vm.Name) { + Paragraph 'The following sections detail the VM configuration settings' + Blankline + try { + Section -Style Heading4 'Virtual Machine Configuration' { + Blankline + $VmConfiguration = [PSCustomObject]@{ + 'VM id' = $Vm.VMid + 'VM Path' = $Vm.Path + 'Uptime' = $Vm.Uptime + 'vCPU Count' = $Vm.ProcessorCount + 'Memory Assigned (GB)' = [Math]::Round($Vm.MemoryAssigned / 1gb) + 'Dynamic Memory Enabled' = $Vm.DynamicMemoryEnabled + 'Memory Startup (GB)' = [Math]::Round($Vm.MemoryStartup / 1gb) + 'Memory Minimum (GB)' = [Math]::Round($Vm.MemoryMinimum / 1gb) + 'Memory Maximum (GB)' = [Math]::Round($Vm.MemoryMaximum / 1gb) + 'Numa Aligned' = $Vm.NumaAligned + 'Nuber of Numa Nodes' = $Vm.NumaNodesCount + 'Number of Numa Sockets' = $Vm.NumaSocketCount + 'Check Point Type' = $Vm.CheckpointType + 'Parent Snapshot Id' = $Vm.ParentSnapshotId + 'Parent Snapshot Name' = $Vm.ParentSnapshotName + 'Generation' = $Vm.Generation + 'DVD Drives' = $Vm.DVDDrives -Join "," + } + $TableParams = @{ + Name = "Virtual Machines" + List = $true + ColumnWidths = 40, 60 + } + if ($Report.ShowTableCaptions) { + $TableParams['Caption'] = "- $($TableParams.Name)" + } + $VmConfiguration | Table @TableParams + } + } + catch { + Write-PscriboMessage -IsWarning $_.Exception.Message + } + try { + Section -Style Heading4 'Virtual Machine Guest Integration Service' { + Paragraph 'The following section details the status of Integration Services' + Blankline + $VmIntegrationServiceSummary = @() + $VMIntegrationService = Invoke-Command -Session $TempPssSession -ScriptBlock{param($VmName) Get-VMIntegrationService -VMName $VmName} -ArgumentList $Vm.Name + Foreach ($Service in $VMIntegrationService) { + try { + $TempVmIntegrationServiceSummary = [PSCustomObject]@{ + 'Service Name' = $Service.Name + 'Service State' = $Service.Enabled + 'Primary Status' = $Service.PrimaryStatusDescription + } + $VmIntegrationServiceSummary += $TempVmIntegrationServiceSummary + } + catch { + Write-PscriboMessage -IsWarning $_.Exception.Message + } + } + $TableParams = @{ + Name = "Integration Service" + List = $false + ColumnWidths = 40, 30, 30 + } + if ($Report.ShowTableCaptions) { + $TableParams['Caption'] = "- $($TableParams.Name)" + } + $VmIntegrationServiceSummary | Table @TableParams + } + } + catch { + Write-PscriboMessage -IsWarning $_.Exception.Message + } + try { + #$VmNetworkAdapters = Get-VMNetworkAdapter -CimSession $TempCimSession -VMName $VM.Name + $VmNetworkAdapters = Invoke-Command -Session $TempPssSession -ScriptBlock{param($VmName) Get-VMNetworkAdapter -VMName $VmName} -ArgumentList $Vm.Name + if ($VmNetworkAdapters) { + Section -Style Heading4 'VM Network Adapters' { + Paragraph 'The following table details the network adapter details' + BlankLine + $VmNetworkAdapterReport = @() + ForEach ($Adapter in $VmNetworkAdapters) { + try { + $TempVmNetworkAdapter = [PSCustomObject]@{ + 'Name' = $Adapter.Name + 'Mac Address' = $Adapter.MacAddress + 'IP Address' = $Adapter.IPAddresses[0] + 'Switch Name' = $Adapter.SwitchName } + $VmNetworkAdapterReport += $TempVmNetworkAdapter + } + catch { + Write-PscriboMessage -IsWarning $_.Exception.Message + } } + $TableParams = @{ - Name = "Virtual Machines" - List = $false - ColumnWidths = 50, 50 + Name = "VM Network Adapters" + List = $false + ColumnWidths = 25, 25, 25, 25 } if ($Report.ShowTableCaptions) { - $TableParams['Caption'] = "- $($TableParams.Name)" + $TableParams['Caption'] = "- $($TableParams.Name)" } - $VmSummary | Sort-Object 'VM Name' | Table @TableParams - foreach ($Vm in $Vms) { - try { - Section -Style Heading3 ($Vm.Name) { - Paragraph 'The following sections detail the VM configuration settings' - Blankline - try { - Section -Style Heading4 'Virtual Machine Configuration' { - Blankline - $VmConfiguration = [PSCustomObject]@{ - 'VM id' = $Vm.VMid - 'VM Path' = $Vm.Path - 'Uptime' = $Vm.Uptime - 'vCPU Count' = $Vm.ProcessorCount - 'Memory Assigned (GB)' = [Math]::Round($Vm.MemoryAssigned / 1gb) - 'Dynamic Memory Enabled' = $Vm.DynamicMemoryEnabled - 'Memory Startup (GB)' = [Math]::Round($Vm.MemoryStartup / 1gb) - 'Memory Minimum (GB)' = [Math]::Round($Vm.MemoryMinimum / 1gb) - 'Memory Maximum (GB)' = [Math]::Round($Vm.MemoryMaximum / 1gb) - 'Numa Aligned' = $Vm.NumaAligned - 'Nuber of Numa Nodes' = $Vm.NumaNodesCount - 'Number of Numa Sockets' = $Vm.NumaSocketCount - 'Check Point Type' = $Vm.CheckpointType - 'Parent Snapshot Id' = $Vm.ParentSnapshotId - 'Parent Snapshot Name' = $Vm.ParentSnapshotName - 'Generation' = $Vm.Generation - 'DVD Drives' = $Vm.DVDDrives -Join "," - } - $TableParams = @{ - Name = "Virtual Machines" - List = $true - ColumnWidths = 40, 60 - } - if ($Report.ShowTableCaptions) { - $TableParams['Caption'] = "- $($TableParams.Name)" - } - $VmConfiguration | Table @TableParams - } - } - catch { - Write-PscriboMessage -IsWarning $_.Exception.Message - } - try { - Section -Style Heading4 'Virtual Machine Guest Integration Service' { - Paragraph 'The following section details the status of Integration Services' - Blankline - $VmIntegrationServiceSummary = @() - Foreach ($Service in ($Vm.VMIntegrationService)) { - try { - $TempVmIntegrationServiceSummary = [PSCustomObject]@{ - 'Service Name' = $Service.Name - 'Service State' = $Service.Enabled - 'Primary Status' = $Service.PrimaryStatusDescription - } - $VmIntegrationServiceSummary += $TempVmIntegrationServiceSummary - } - catch { - Write-PscriboMessage -IsWarning $_.Exception.Message - } - } - $TableParams = @{ - Name = "Integration Service" - List = $false - ColumnWidths = 40, 30, 30 - } - if ($Report.ShowTableCaptions) { - $TableParams['Caption'] = "- $($TableParams.Name)" - } - $VmIntegrationServiceSummary | Table @TableParams - } - } - catch { - Write-PscriboMessage -IsWarning $_.Exception.Message - } - try { - $VmNetworkAdapters = Get-VMNetworkAdapter -CimSession $TempCimSession -VMName $VM.Name - if ($VmNetworkAdapters) { - Section -Style Heading4 'VM Network Adapters' { - Paragraph 'The following table details the network adapter details' - BlankLine - $VmNetworkAdapterReport = @() - ForEach ($Adapter in $VmNetworkAdapters) { - try { - $TempVmNetworkAdapter = [PSCustomObject]@{ - 'Name' = $Adapter.Name - 'Mac Address' = $Adapter.MacAddress - 'IP Address' = $Adapter.IPAddresses[0] - 'Switch Name' = $Adapter.SwitchName - } - $VmNetworkAdapterReport += $TempVmNetworkAdapter - } - catch { - Write-PscriboMessage -IsWarning $_.Exception.Message - } - } - - $TableParams = @{ - Name = "VM Network Adapters" - List = $false - ColumnWidths = 25, 25, 25, 25 - } - if ($Report.ShowTableCaptions) { - $TableParams['Caption'] = "- $($TableParams.Name)" - } - $VmNetworkAdapterReport | Sort-Object -Property 'Name' | Table @TableParams - } - } - } - catch { - Write-PscriboMessage -IsWarning $_.Exception.Message - } - try { - $VmAdapterVlan = Get-VMNetworkAdapterVlan -CimSession $TempCimSession -VMName $VM.Name - if ($VmAdapterVlan) { - Section -Style Heading4 'VM Network Adpater VLANs' { - Paragraph 'The following section details the VLAN configuration of VM Network Adapters' - BlankLine - $VmAdapterVlanReport = @() - ForEach ($Adapter in $VmAdapterVlan) { - try { - $TempVmAdapterVlanReport = [PSCustomObject]@{ - 'Adapter Name' = $Adapter.ParentAdapter.Name - 'Operation Mode' = $Adapter.OperationMode - 'Vlan ID' = $Adapter.AccessVlanId - 'Trunk Vlans' = $Adapter.AllowedVlanIdList -Join "," - } - $VmAdapterVlanReport += $TempVmAdapterVlanReport - } - catch { - Write-PscriboMessage -IsWarning $_.Exception.Message - } - } - - $TableParams = @{ - Name = "VM Network Adapter Vlans" - List = $false - ColumnWidths = 25, 25, 25, 25 - } - if ($Report.ShowTableCaptions) { - $TableParams['Caption'] = "- $($TableParams.Name)" - } - $VmAdapterVlanReport | Sort-Object -Property 'Adapter Name' | Table @TableParams - } - } - } - catch { - Write-PscriboMessage -IsWarning $_.Exception.Message - } - try { - $VmHardDisks = Get-VMHardDiskDrive -CimSession $TempCimSession -VMName $VM.Name - if ($VmHardDisks) { - Section -Style Heading4 'VM Hard Disks' { - Paragraph 'The following table details the VM hard disks' - BlankLine - $VmDiskReport = @() - foreach ($VmHardDisk in $VMHardDisks) { - try { - $VmVhd = Get-VHD -CimSession $TempCimSession -Path $VmHardDisk.Path - $TempVmDiskReport = [PSCustomObject]@{ - 'Disk Path' = $VmVhd.Path - 'Disk Format' = $VmVhd.VhdFormat - 'Disk Type' = $VmVhd.VhdType - 'Disk Used(GB)' = [Math]::Round($VmVhd.FileSize / 1gb) - 'Disk Max(GB)' = [Math]::Round($VmVhd.Size / 1gb) - 'Bus Type' = $VmHardDisk.ControllerType - 'Bus No' = $VmHardDisk.ControllerNumber - 'Bus Location' = $VmHardDisk.ControllerLocation - } - $VmDiskReport += $TempVmDiskReport - } - catch { - Write-PscriboMessage -IsWarning $_.Exception.Message - } - } - - $TableParams = @{ - Name = "VM Hard disks" - List = $false - ColumnWidths = 30, 10, 10, 10, 10, 10, 10, 10 - } - if ($Report.ShowTableCaptions) { - $TableParams['Caption'] = "- $($TableParams.Name)" - } - $VmDiskReport | Sort-Object -Property 'Disk Path' | Table @TableParams - } - } - } - catch { - Write-PscriboMessage -IsWarning $_.Exception.Message - } - } + $VmNetworkAdapterReport | Sort-Object -Property 'Name' | Table @TableParams + } + } + } + catch { + Write-PscriboMessage -IsWarning $_.Exception.Message + } + try { + #$VmAdapterVlan = Get-VMNetworkAdapterVlan -CimSession $TempCimSession -VMName $VM.Name + $VmAdapterVlan = Invoke-Command -Session $TempPssSession -ScriptBlock{param($VmName) Get-VMNetworkAdapterVlan -VMName $VmName} -ArgumentList $Vm.Name + if ($VmAdapterVlan) { + Section -Style Heading4 'VM Network Adapter VLANs' { + Paragraph 'The following section details the VLAN configuration of VM Network Adapters' + BlankLine + $VmAdapterVlanReport = @() + ForEach ($Adapter in $VmAdapterVlan) { + try { + $TempVmAdapterVlanReport = [PSCustomObject]@{ + 'Adapter Name' = $Adapter.ParentAdapter.Name + 'Operation Mode' = $Adapter.OperationMode + 'Vlan ID' = $Adapter.AccessVlanId + 'Trunk Vlans' = $Adapter.AllowedVlanIdList -Join "," } - catch { - Write-PscriboMessage -IsWarning $_.Exception.Message + $VmAdapterVlanReport += $TempVmAdapterVlanReport + } + catch { + Write-PscriboMessage -IsWarning $_.Exception.Message + } + } + + $TableParams = @{ + Name = "VM Network Adapter Vlans" + List = $false + ColumnWidths = 25, 25, 25, 25 + } + if ($Report.ShowTableCaptions) { + $TableParams['Caption'] = "- $($TableParams.Name)" + } + $VmAdapterVlanReport | Sort-Object -Property 'Adapter Name' | Table @TableParams + } + } + } + catch { + Write-PscriboMessage -IsWarning $_.Exception.Message + } + try { + #$VmHardDisks = Get-VMHardDiskDrive -CimSession $TempCimSession -VMName $VM.Name + $VmHardDisks =Invoke-Command -Session $TempPssSession -ScriptBlock{param($VmName) Get-VMHardDiskDrive -VMName $VmName} -ArgumentList $Vm.Name + if ($VmHardDisks) { + Section -Style Heading4 'VM Hard Disks' { + Paragraph 'The following table details the VM hard disks' + BlankLine + $VmDiskReport = @() + foreach ($VmHardDisk in $VMHardDisks) { + try { + $VmVhd = Get-VHD -CimSession $TempCimSession -Path $VmHardDisk.Path + $TempVmDiskReport = [PSCustomObject]@{ + 'Disk Path' = $VmVhd.Path + 'Disk Format' = $VmVhd.VhdFormat + 'Disk Type' = $VmVhd.VhdType + 'Disk Used(GB)' = [Math]::Round($VmVhd.FileSize / 1gb) + 'Disk Max(GB)' = [Math]::Round($VmVhd.Size / 1gb) + 'Bus Type' = $VmHardDisk.ControllerType + 'Bus No' = $VmHardDisk.ControllerNumber + 'Bus Location' = $VmHardDisk.ControllerLocation } + $VmDiskReport += $TempVmDiskReport + } + catch { + Write-PscriboMessage -IsWarning $_.Exception.Message + } } + + $TableParams = @{ + Name = "VM Hard disks" + List = $false + ColumnWidths = 30, 10, 10, 10, 10, 10, 10, 10 + } + if ($Report.ShowTableCaptions) { + $TableParams['Caption'] = "- $($TableParams.Name)" + } + $VmDiskReport | Sort-Object -Property 'Disk Path' | Table @TableParams + } } - } - catch { + } + catch { Write-PscriboMessage -IsWarning $_.Exception.Message + } } - } + } + catch { + Write-PscriboMessage -IsWarning $_.Exception.Message + } + } + + + } + } + catch { + Write-PscriboMessage -IsWarning $_.Exception.Message } + } } + } - end {} -} \ No newline at end of file + end {} +} From 5754585a39fa1c5c8d95f9c9c8b56b4e93a24865 Mon Sep 17 00:00:00 2001 From: oolejniczak Date: Tue, 9 May 2023 11:23:32 +0200 Subject: [PATCH 03/14] Update Invoke-AsBuiltReport.Microsoft.Windows.ps1 remove comment before : Get-AbrWinHyperVHostVM --- Src/Public/Invoke-AsBuiltReport.Microsoft.Windows.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Src/Public/Invoke-AsBuiltReport.Microsoft.Windows.ps1 b/Src/Public/Invoke-AsBuiltReport.Microsoft.Windows.ps1 index f4dcd40..716aea1 100644 --- a/Src/Public/Invoke-AsBuiltReport.Microsoft.Windows.ps1 +++ b/Src/Public/Invoke-AsBuiltReport.Microsoft.Windows.ps1 @@ -190,7 +190,7 @@ function Invoke-AsBuiltReport.Microsoft.Windows { # Hyper-V Networking Get-AbrWinHyperVNetworking # Hyper-V VM Information (Buggy as hell) - #Get-AbrWinHyperVHostVM + Get-AbrWinHyperVHostVM } } else { Get-RequiredFeature -Name Hyper-V-PowerShell -OSType $OSType.Value -Service "Hyper-V" From 3ee01e33a09f98299457b8b0a9b9d4f7b8218814 Mon Sep 17 00:00:00 2001 From: oolejniczak Date: Wed, 10 May 2023 14:52:07 +0200 Subject: [PATCH 04/14] Update Get-AbrWinHyperVHostVM.ps1 --- Src/Private/Get-AbrWinHyperVHostVM.ps1 | 502 ++++++++++++------------- 1 file changed, 248 insertions(+), 254 deletions(-) diff --git a/Src/Private/Get-AbrWinHyperVHostVM.ps1 b/Src/Private/Get-AbrWinHyperVHostVM.ps1 index a3aec13..a77f926 100644 --- a/Src/Private/Get-AbrWinHyperVHostVM.ps1 +++ b/Src/Private/Get-AbrWinHyperVHostVM.ps1 @@ -1,273 +1,267 @@ - function Get-AbrWinHyperVHostVM { - <# - .SYNOPSIS - Used by As Built Report to retrieve Windows Server Hyper-V VM information. - .DESCRIPTION - Documents the configuration of Microsoft Windows Server in Word/HTML/Text formats using PScribo. - .NOTES - Version: 0.2.0 - Author: Andrew Ramsay - Editor: Jonathan Colon - Twitter: @asbuiltreport - Github: AsBuiltReport - Credits: Iain Brighton (@iainbrighton) - PScribo module + <# + .SYNOPSIS + Used by As Built Report to retrieve Windows Server Hyper-V VM information. + .DESCRIPTION + Documents the configuration of Microsoft Windows Server in Word/HTML/Text formats using PScribo. + .NOTES + Version: 0.2.0 + Author: Andrew Ramsay + Editor: Jonathan Colon + Twitter: @asbuiltreport + Github: AsBuiltReport + Credits: Iain Brighton (@iainbrighton) - PScribo module - .LINK - https://github.com/AsBuiltReport/AsBuiltReport.Microsoft.Windows - #> - [CmdletBinding()] - param ( - ) + .LINK + https://github.com/AsBuiltReport/AsBuiltReport.Microsoft.Windows + #> + [CmdletBinding()] + param ( + ) - begin { - Write-PScriboMessage "Hyper-V InfoLevel set at $($InfoLevel.HyperV)." - Write-PscriboMessage "Collecting Hyper-V VM information." - } + begin { + Write-PScriboMessage "Hyper-V InfoLevel set at $($InfoLevel.HyperV)." + Write-PscriboMessage "Collecting Hyper-V VM information." + } - process { - if ($InfoLevel.HyperV -ge 1) { - #$Vms = Get-VM -CimSession $TempCimSession - $global:Vms = Invoke-Command -Session $TempPssSession { Get-VM } - - if ($Vms) { - try { - Section -Style Heading2 'Hyper-V VMs' { - Paragraph 'The following section details the Hyper-V VMs running on this host' - Blankline - $VmSummary = @() - foreach ($Vm in $Vms) { - try { - $TempVmSummary = [PSCustomObject]@{ - 'VM Name' = $Vm.Name - 'State' = $Vm.State - 'Version' = $Vm.Version - } - $VmSummary += $TempVmSummary - } - catch { - Write-PscriboMessage -IsWarning $_.Exception.Message - } - } - $TableParams = @{ - Name = "Virtual Machines" - List = $false - #ColumnWidths = 50, 50 - } - if ($Report.ShowTableCaptions) { - $TableParams['Caption'] = "- $($TableParams.Name)" - } - $VmSummary | Sort-Object 'VM Name' | Table @TableParams - - foreach ($Vm in $Vms) { - try { - Section -Style Heading3 ($Vm.Name) { - Paragraph 'The following sections detail the VM configuration settings' - Blankline - try { - Section -Style Heading4 'Virtual Machine Configuration' { - Blankline - $VmConfiguration = [PSCustomObject]@{ - 'VM id' = $Vm.VMid - 'VM Path' = $Vm.Path - 'Uptime' = $Vm.Uptime - 'vCPU Count' = $Vm.ProcessorCount - 'Memory Assigned (GB)' = [Math]::Round($Vm.MemoryAssigned / 1gb) - 'Dynamic Memory Enabled' = $Vm.DynamicMemoryEnabled - 'Memory Startup (GB)' = [Math]::Round($Vm.MemoryStartup / 1gb) - 'Memory Minimum (GB)' = [Math]::Round($Vm.MemoryMinimum / 1gb) - 'Memory Maximum (GB)' = [Math]::Round($Vm.MemoryMaximum / 1gb) - 'Numa Aligned' = $Vm.NumaAligned - 'Nuber of Numa Nodes' = $Vm.NumaNodesCount - 'Number of Numa Sockets' = $Vm.NumaSocketCount - 'Check Point Type' = $Vm.CheckpointType - 'Parent Snapshot Id' = $Vm.ParentSnapshotId - 'Parent Snapshot Name' = $Vm.ParentSnapshotName - 'Generation' = $Vm.Generation - 'DVD Drives' = $Vm.DVDDrives -Join "," - } - $TableParams = @{ - Name = "Virtual Machines" - List = $true - ColumnWidths = 40, 60 - } - if ($Report.ShowTableCaptions) { - $TableParams['Caption'] = "- $($TableParams.Name)" - } - $VmConfiguration | Table @TableParams - } - } - catch { - Write-PscriboMessage -IsWarning $_.Exception.Message - } - try { - Section -Style Heading4 'Virtual Machine Guest Integration Service' { - Paragraph 'The following section details the status of Integration Services' - Blankline - $VmIntegrationServiceSummary = @() - $VMIntegrationService = Invoke-Command -Session $TempPssSession -ScriptBlock{param($VmName) Get-VMIntegrationService -VMName $VmName} -ArgumentList $Vm.Name - Foreach ($Service in $VMIntegrationService) { - try { - $TempVmIntegrationServiceSummary = [PSCustomObject]@{ - 'Service Name' = $Service.Name - 'Service State' = $Service.Enabled - 'Primary Status' = $Service.PrimaryStatusDescription - } - $VmIntegrationServiceSummary += $TempVmIntegrationServiceSummary - } - catch { - Write-PscriboMessage -IsWarning $_.Exception.Message - } - } - $TableParams = @{ - Name = "Integration Service" - List = $false - ColumnWidths = 40, 30, 30 - } - if ($Report.ShowTableCaptions) { - $TableParams['Caption'] = "- $($TableParams.Name)" - } - $VmIntegrationServiceSummary | Table @TableParams - } - } - catch { - Write-PscriboMessage -IsWarning $_.Exception.Message - } - try { - #$VmNetworkAdapters = Get-VMNetworkAdapter -CimSession $TempCimSession -VMName $VM.Name - $VmNetworkAdapters = Invoke-Command -Session $TempPssSession -ScriptBlock{param($VmName) Get-VMNetworkAdapter -VMName $VmName} -ArgumentList $Vm.Name - if ($VmNetworkAdapters) { - Section -Style Heading4 'VM Network Adapters' { - Paragraph 'The following table details the network adapter details' - BlankLine - $VmNetworkAdapterReport = @() - ForEach ($Adapter in $VmNetworkAdapters) { - try { - $TempVmNetworkAdapter = [PSCustomObject]@{ - 'Name' = $Adapter.Name - 'Mac Address' = $Adapter.MacAddress - 'IP Address' = $Adapter.IPAddresses[0] - 'Switch Name' = $Adapter.SwitchName + process { + if ($InfoLevel.HyperV -ge 1) { + #$Vms = Get-VM -CimSession $TempCimSession + $global:Vms = Invoke-Command -Session $TempPssSession { Get-VM } + if ($Vms) { + try { + Section -Style Heading2 'Hyper-V VMs' { + Paragraph 'The following section details the Hyper-V VMs running on this host' + Blankline + $VmSummary = @() + foreach ($Vm in $Vms) { + try { + $TempVmSummary = [PSCustomObject]@{ + 'VM Name' = $Vm.Name + 'State' = $Vm.State + } + $VmSummary += $TempVmSummary } - $VmNetworkAdapterReport += $TempVmNetworkAdapter - } - catch { - Write-PscriboMessage -IsWarning $_.Exception.Message - } - } - - $TableParams = @{ - Name = "VM Network Adapters" - List = $false - ColumnWidths = 25, 25, 25, 25 - } - if ($Report.ShowTableCaptions) { - $TableParams['Caption'] = "- $($TableParams.Name)" - } - $VmNetworkAdapterReport | Sort-Object -Property 'Name' | Table @TableParams - } - } - } - catch { - Write-PscriboMessage -IsWarning $_.Exception.Message - } - try { - #$VmAdapterVlan = Get-VMNetworkAdapterVlan -CimSession $TempCimSession -VMName $VM.Name - $VmAdapterVlan = Invoke-Command -Session $TempPssSession -ScriptBlock{param($VmName) Get-VMNetworkAdapterVlan -VMName $VmName} -ArgumentList $Vm.Name - if ($VmAdapterVlan) { - Section -Style Heading4 'VM Network Adapter VLANs' { - Paragraph 'The following section details the VLAN configuration of VM Network Adapters' - BlankLine - $VmAdapterVlanReport = @() - ForEach ($Adapter in $VmAdapterVlan) { - try { - $TempVmAdapterVlanReport = [PSCustomObject]@{ - 'Adapter Name' = $Adapter.ParentAdapter.Name - 'Operation Mode' = $Adapter.OperationMode - 'Vlan ID' = $Adapter.AccessVlanId - 'Trunk Vlans' = $Adapter.AllowedVlanIdList -Join "," + catch { + Write-PscriboMessage -IsWarning $_.Exception.Message } - $VmAdapterVlanReport += $TempVmAdapterVlanReport - } - catch { - Write-PscriboMessage -IsWarning $_.Exception.Message - } } - $TableParams = @{ - Name = "VM Network Adapter Vlans" - List = $false - ColumnWidths = 25, 25, 25, 25 + Name = "Virtual Machines" + List = $false + ColumnWidths = 50, 50 } if ($Report.ShowTableCaptions) { - $TableParams['Caption'] = "- $($TableParams.Name)" - } - $VmAdapterVlanReport | Sort-Object -Property 'Adapter Name' | Table @TableParams - } - } - } - catch { - Write-PscriboMessage -IsWarning $_.Exception.Message - } - try { - #$VmHardDisks = Get-VMHardDiskDrive -CimSession $TempCimSession -VMName $VM.Name - $VmHardDisks =Invoke-Command -Session $TempPssSession -ScriptBlock{param($VmName) Get-VMHardDiskDrive -VMName $VmName} -ArgumentList $Vm.Name - if ($VmHardDisks) { - Section -Style Heading4 'VM Hard Disks' { - Paragraph 'The following table details the VM hard disks' - BlankLine - $VmDiskReport = @() - foreach ($VmHardDisk in $VMHardDisks) { - try { - $VmVhd = Get-VHD -CimSession $TempCimSession -Path $VmHardDisk.Path - $TempVmDiskReport = [PSCustomObject]@{ - 'Disk Path' = $VmVhd.Path - 'Disk Format' = $VmVhd.VhdFormat - 'Disk Type' = $VmVhd.VhdType - 'Disk Used(GB)' = [Math]::Round($VmVhd.FileSize / 1gb) - 'Disk Max(GB)' = [Math]::Round($VmVhd.Size / 1gb) - 'Bus Type' = $VmHardDisk.ControllerType - 'Bus No' = $VmHardDisk.ControllerNumber - 'Bus Location' = $VmHardDisk.ControllerLocation - } - $VmDiskReport += $TempVmDiskReport - } - catch { - Write-PscriboMessage -IsWarning $_.Exception.Message - } + $TableParams['Caption'] = "- $($TableParams.Name)" } + $VmSummary | Sort-Object 'VM Name' | Table @TableParams + foreach ($Vm in $Vms) { + try { + Section -Style Heading3 ($Vm.Name) { + Paragraph 'The following sections detail the VM configuration settings' + Blankline + try { + Section -Style Heading4 'Virtual Machine Configuration' { + Blankline + $VmConfiguration = [PSCustomObject]@{ + 'VM id' = $Vm.VMid + 'VM Path' = $Vm.Path + 'Uptime' = $Vm.Uptime + 'vCPU Count' = $Vm.ProcessorCount + 'Memory Assigned (GB)' = [Math]::Round($Vm.MemoryAssigned / 1gb) + 'Dynamic Memory Enabled' = $Vm.DynamicMemoryEnabled + 'Memory Startup (GB)' = [Math]::Round($Vm.MemoryStartup / 1gb) + 'Memory Minimum (GB)' = [Math]::Round($Vm.MemoryMinimum / 1gb) + 'Memory Maximum (GB)' = [Math]::Round($Vm.MemoryMaximum / 1gb) + 'Numa Aligned' = $Vm.NumaAligned + 'Nuber of Numa Nodes' = $Vm.NumaNodesCount + 'Number of Numa Sockets' = $Vm.NumaSocketCount + 'Check Point Type' = $Vm.CheckpointType + 'Parent Snapshot Id' = $Vm.ParentSnapshotId + 'Parent Snapshot Name' = $Vm.ParentSnapshotName + 'Generation' = $Vm.Generation + 'DVD Drives' = $Vm.DVDDrives -Join "," + } + $TableParams = @{ + Name = "Virtual Machines" + List = $true + ColumnWidths = 40, 60 + } + if ($Report.ShowTableCaptions) { + $TableParams['Caption'] = "- $($TableParams.Name)" + } + $VmConfiguration | Table @TableParams + } + } + catch { + Write-PscriboMessage -IsWarning $_.Exception.Message + } + try { + Section -Style Heading4 'Virtual Machine Guest Integration Service' { + Paragraph 'The following section details the status of Integration Services' + Blankline + $VmIntegrationServiceSummary = @() + $VMIntegrationService = Invoke-Command -Session $TempPssSession -ScriptBlock{param($VmName) Get-VMIntegrationService -VMName $VmName} -ArgumentList $Vm.Name + Foreach ($Service in $VMIntegrationService) { + try { + $TempVmIntegrationServiceSummary = [PSCustomObject]@{ + 'Service Name' = $Service.Name + 'Service State' = $Service.Enabled + 'Primary Status' = $Service.PrimaryStatusDescription + } + $VmIntegrationServiceSummary += $TempVmIntegrationServiceSummary + } + catch { + Write-PscriboMessage -IsWarning $_.Exception.Message + } + } + $TableParams = @{ + Name = "Integration Service" + List = $false + ColumnWidths = 40, 30, 30 + } + if ($Report.ShowTableCaptions) { + $TableParams['Caption'] = "- $($TableParams.Name)" + } + $VmIntegrationServiceSummary | Table @TableParams + } + } + catch { + Write-PscriboMessage -IsWarning $_.Exception.Message + } + try { + #$VmNetworkAdapters = Get-VMNetworkAdapter -CimSession $TempCimSession -VMName $VM.Name + $VmNetworkAdapters = Invoke-Command -Session $TempPssSession -ScriptBlock{param($VmName) Get-VMNetworkAdapter -VMName $VmName} -ArgumentList $Vm.Name + if ($VmNetworkAdapters) { + Section -Style Heading4 'VM Network Adapters' { + Paragraph 'The following table details the network adapter details' + BlankLine + $VmNetworkAdapterReport = @() + ForEach ($Adapter in $VmNetworkAdapters) { + try { + $TempVmNetworkAdapter = [PSCustomObject]@{ + 'Name' = $Adapter.Name + 'Mac Address' = $Adapter.MacAddress + 'IP Address' = $Adapter.IPAddresses[0] + 'Switch Name' = $Adapter.SwitchName + } + $VmNetworkAdapterReport += $TempVmNetworkAdapter + } + catch { + Write-PscriboMessage -IsWarning $_.Exception.Message + } + } - $TableParams = @{ - Name = "VM Hard disks" - List = $false - ColumnWidths = 30, 10, 10, 10, 10, 10, 10, 10 - } - if ($Report.ShowTableCaptions) { - $TableParams['Caption'] = "- $($TableParams.Name)" + $TableParams = @{ + Name = "VM Network Adapters" + List = $false + ColumnWidths = 25, 25, 25, 25 + } + if ($Report.ShowTableCaptions) { + $TableParams['Caption'] = "- $($TableParams.Name)" + } + $VmNetworkAdapterReport | Sort-Object -Property 'Name' | Table @TableParams + } + } + } + catch { + Write-PscriboMessage -IsWarning $_.Exception.Message + } + try { + #$VmAdapterVlan = Get-VMNetworkAdapterVlan -CimSession $TempCimSession -VMName $VM.Name + $VmAdapterVlan = Invoke-Command -Session $TempPssSession -ScriptBlock{param($VmName) Get-VMNetworkAdapterVlan -VMName $VmName} -ArgumentList $Vm.Name + if ($VmAdapterVlan) { + Section -Style Heading4 'VM Network Adapter VLANs' { + Paragraph 'The following section details the VLAN configuration of VM Network Adapters' + BlankLine + $VmAdapterVlanReport = @() + ForEach ($Adapter in $VmAdapterVlan) { + try { + $TempVmAdapterVlanReport = [PSCustomObject]@{ + 'Adapter Name' = $Adapter.ParentAdapter.Name + 'Operation Mode' = $Adapter.OperationMode + 'Vlan ID' = $Adapter.AccessVlanId + 'Trunk Vlans' = $Adapter.AllowedVlanIdList -Join "," + } + $VmAdapterVlanReport += $TempVmAdapterVlanReport + } + catch { + Write-PscriboMessage -IsWarning $_.Exception.Message + } + } + + $TableParams = @{ + Name = "VM Network Adapter Vlans" + List = $false + ColumnWidths = 25, 25, 25, 25 + } + if ($Report.ShowTableCaptions) { + $TableParams['Caption'] = "- $($TableParams.Name)" + } + $VmAdapterVlanReport | Sort-Object -Property 'Adapter Name' | Table @TableParams + } + } + } + catch { + Write-PscriboMessage -IsWarning $_.Exception.Message + } + try { + #$VmHardDisks = Get-VMHardDiskDrive -CimSession $TempCimSession -VMName $VM.Name + $VmHardDisks =Invoke-Command -Session $TempPssSession -ScriptBlock{param($VmName) Get-VMHardDiskDrive -VMName $VmName} -ArgumentList $Vm.Name + if ($VmHardDisks) { + Section -Style Heading4 'VM Hard Disks' { + Paragraph 'The following table details the VM hard disks' + BlankLine + $VmDiskReport = @() + foreach ($VmHardDisk in $VMHardDisks) { + try { + $VmVhd = Get-VHD -CimSession $TempCimSession -Path $VmHardDisk.Path + $TempVmDiskReport = [PSCustomObject]@{ + 'Disk Path' = $VmVhd.Path + 'Disk Format' = $VmVhd.VhdFormat + 'Disk Type' = $VmVhd.VhdType + 'Disk Used(GB)' = [Math]::Round($VmVhd.FileSize / 1gb) + 'Disk Max(GB)' = [Math]::Round($VmVhd.Size / 1gb) + 'Bus Type' = $VmHardDisk.ControllerType + 'Bus No' = $VmHardDisk.ControllerNumber + 'Bus Location' = $VmHardDisk.ControllerLocation + } + $VmDiskReport += $TempVmDiskReport + } + catch { + Write-PscriboMessage -IsWarning $_.Exception.Message + } + } + + $TableParams = @{ + Name = "VM Hard disks" + List = $false + ColumnWidths = 30, 10, 10, 10, 10, 10, 10, 10 + } + if ($Report.ShowTableCaptions) { + $TableParams['Caption'] = "- $($TableParams.Name)" + } + $VmDiskReport | Sort-Object -Property 'Disk Path' | Table @TableParams + } + } + } + catch { + Write-PscriboMessage -IsWarning $_.Exception.Message + } + } + } + catch { + Write-PscriboMessage -IsWarning $_.Exception.Message + } } - $VmDiskReport | Sort-Object -Property 'Disk Path' | Table @TableParams - } } - } - catch { + } + catch { Write-PscriboMessage -IsWarning $_.Exception.Message - } } - } - catch { - Write-PscriboMessage -IsWarning $_.Exception.Message - } - } - - - } - } - catch { - Write-PscriboMessage -IsWarning $_.Exception.Message + } } - } } - } - end {} -} + end {} +} From 1f5b72c7ec57ba6ad222a497234d72166353f43d Mon Sep 17 00:00:00 2001 From: Jonathan Colon Date: Wed, 10 May 2023 16:24:02 -0400 Subject: [PATCH 05/14] Create .gitignore --- .gitignore | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..12ce087 --- /dev/null +++ b/.gitignore @@ -0,0 +1,21 @@ +debug.log +.gitignore +# Created by https://www.toptal.com/developers/gitignore/api/powershell +# Edit at https://www.toptal.com/developers/gitignore?templates=powershell + +### PowerShell ### +# Exclude packaged modules +*.zip + +# Exclude .NET assemblies from source +*.dll + +# End of https://www.toptal.com/developers/gitignore/api/powershell + +### vscode ### +.vscode/tasks.json +.vscode/launch.json +.vscode/extensions.json +*.code-workspace + +# End of https://www.toptal.com/developers/gitignore/api/hugo,vscode From d20ef3eec13ee5f3498e9caeacd30f6b3a2e9bf6 Mon Sep 17 00:00:00 2001 From: Jonathan Colon Date: Wed, 10 May 2023 16:54:09 -0400 Subject: [PATCH 06/14] Misc improvements --- Src/Private/Get-AbrWinHyperVHostVM.ps1 | 42 +++++++++++++------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/Src/Private/Get-AbrWinHyperVHostVM.ps1 b/Src/Private/Get-AbrWinHyperVHostVM.ps1 index a77f926..07fb76a 100644 --- a/Src/Private/Get-AbrWinHyperVHostVM.ps1 +++ b/Src/Private/Get-AbrWinHyperVHostVM.ps1 @@ -30,7 +30,7 @@ function Get-AbrWinHyperVHostVM { $global:Vms = Invoke-Command -Session $TempPssSession { Get-VM } if ($Vms) { try { - Section -Style Heading2 'Hyper-V VMs' { + Section -Style Heading3 'Hyper-V VMs' { Paragraph 'The following section details the Hyper-V VMs running on this host' Blankline $VmSummary = @() @@ -57,30 +57,30 @@ function Get-AbrWinHyperVHostVM { $VmSummary | Sort-Object 'VM Name' | Table @TableParams foreach ($Vm in $Vms) { try { - Section -Style Heading3 ($Vm.Name) { + Section -Style Heading4 ($Vm.Name) { Paragraph 'The following sections detail the VM configuration settings' Blankline try { - Section -Style Heading4 'Virtual Machine Configuration' { - Blankline + Section -ExcludeFromTOC -Style NOTOCHeading5 'Virtual Machine Configuration' { + $DVDDrives = Invoke-Command -Session $TempPssSession -ScriptBlock{ Get-VMDvdDrive -VMName ($using:Vm).Name} $VmConfiguration = [PSCustomObject]@{ 'VM id' = $Vm.VMid 'VM Path' = $Vm.Path 'Uptime' = $Vm.Uptime 'vCPU Count' = $Vm.ProcessorCount 'Memory Assigned (GB)' = [Math]::Round($Vm.MemoryAssigned / 1gb) - 'Dynamic Memory Enabled' = $Vm.DynamicMemoryEnabled + 'Dynamic Memory Enabled' = ConvertTo-TextYN $Vm.DynamicMemoryEnabled 'Memory Startup (GB)' = [Math]::Round($Vm.MemoryStartup / 1gb) 'Memory Minimum (GB)' = [Math]::Round($Vm.MemoryMinimum / 1gb) 'Memory Maximum (GB)' = [Math]::Round($Vm.MemoryMaximum / 1gb) - 'Numa Aligned' = $Vm.NumaAligned + 'Numa Aligned' = ConvertTo-EmptyToFiller $Vm.NumaAligned 'Nuber of Numa Nodes' = $Vm.NumaNodesCount 'Number of Numa Sockets' = $Vm.NumaSocketCount 'Check Point Type' = $Vm.CheckpointType - 'Parent Snapshot Id' = $Vm.ParentSnapshotId - 'Parent Snapshot Name' = $Vm.ParentSnapshotName + 'Parent Snapshot Id' = ConvertTo-EmptyToFiller $Vm.ParentSnapshotId + 'Parent Snapshot Name' = ConvertTo-EmptyToFiller $Vm.ParentSnapshotName 'Generation' = $Vm.Generation - 'DVD Drives' = $Vm.DVDDrives -Join "," + 'DVD Drives' = $DVDDrives | ForEach-Object {"Controller Type: $($_.ControllerType), Media Type: $($_.DvdMediaType), Path: $($_.Path)"} } $TableParams = @{ Name = "Virtual Machines" @@ -97,17 +97,17 @@ function Get-AbrWinHyperVHostVM { Write-PscriboMessage -IsWarning $_.Exception.Message } try { - Section -Style Heading4 'Virtual Machine Guest Integration Service' { + Section -ExcludeFromTOC -Style NOTOCHeading5 'Virtual Machine Guest Integration Service' { Paragraph 'The following section details the status of Integration Services' Blankline $VmIntegrationServiceSummary = @() - $VMIntegrationService = Invoke-Command -Session $TempPssSession -ScriptBlock{param($VmName) Get-VMIntegrationService -VMName $VmName} -ArgumentList $Vm.Name + $VMIntegrationService = Invoke-Command -Session $TempPssSession -ScriptBlock{ Get-VMIntegrationService -VMName ($using:Vm).Name} Foreach ($Service in $VMIntegrationService) { try { $TempVmIntegrationServiceSummary = [PSCustomObject]@{ 'Service Name' = $Service.Name - 'Service State' = $Service.Enabled - 'Primary Status' = $Service.PrimaryStatusDescription + 'Service State' = ConvertTo-TextYN $Service.Enabled + 'Primary Status' = ConvertTo-EmptyToFiller $Service.PrimaryStatusDescription } $VmIntegrationServiceSummary += $TempVmIntegrationServiceSummary } @@ -131,9 +131,9 @@ function Get-AbrWinHyperVHostVM { } try { #$VmNetworkAdapters = Get-VMNetworkAdapter -CimSession $TempCimSession -VMName $VM.Name - $VmNetworkAdapters = Invoke-Command -Session $TempPssSession -ScriptBlock{param($VmName) Get-VMNetworkAdapter -VMName $VmName} -ArgumentList $Vm.Name + $VmNetworkAdapters = Invoke-Command -Session $TempPssSession -ScriptBlock{ Get-VMNetworkAdapter -VMName ($using:Vm).Name } if ($VmNetworkAdapters) { - Section -Style Heading4 'VM Network Adapters' { + Section -ExcludeFromTOC -Style NOTOCHeading5 'VM Network Adapters' { Paragraph 'The following table details the network adapter details' BlankLine $VmNetworkAdapterReport = @() @@ -142,7 +142,7 @@ function Get-AbrWinHyperVHostVM { $TempVmNetworkAdapter = [PSCustomObject]@{ 'Name' = $Adapter.Name 'Mac Address' = $Adapter.MacAddress - 'IP Address' = $Adapter.IPAddresses[0] + 'IP Address' = ConvertTo-EmptyToFiller ($Adapter.IPAddresses) 'Switch Name' = $Adapter.SwitchName } $VmNetworkAdapterReport += $TempVmNetworkAdapter @@ -169,9 +169,9 @@ function Get-AbrWinHyperVHostVM { } try { #$VmAdapterVlan = Get-VMNetworkAdapterVlan -CimSession $TempCimSession -VMName $VM.Name - $VmAdapterVlan = Invoke-Command -Session $TempPssSession -ScriptBlock{param($VmName) Get-VMNetworkAdapterVlan -VMName $VmName} -ArgumentList $Vm.Name + $VmAdapterVlan = Invoke-Command -Session $TempPssSession -ScriptBlock{ Get-VMNetworkAdapterVlan -VMName ($using:Vm).Name | Select-Object -Property * } if ($VmAdapterVlan) { - Section -Style Heading4 'VM Network Adapter VLANs' { + Section -ExcludeFromTOC -Style NOTOCHeading5 'VM Network Adapter VLANs' { Paragraph 'The following section details the VLAN configuration of VM Network Adapters' BlankLine $VmAdapterVlanReport = @() @@ -207,15 +207,15 @@ function Get-AbrWinHyperVHostVM { } try { #$VmHardDisks = Get-VMHardDiskDrive -CimSession $TempCimSession -VMName $VM.Name - $VmHardDisks =Invoke-Command -Session $TempPssSession -ScriptBlock{param($VmName) Get-VMHardDiskDrive -VMName $VmName} -ArgumentList $Vm.Name + $VmHardDisks =Invoke-Command -Session $TempPssSession -ScriptBlock{ Get-VMHardDiskDrive -VMName ($using:Vm).Name } if ($VmHardDisks) { - Section -Style Heading4 'VM Hard Disks' { + Section -ExcludeFromTOC -Style NOTOCHeading5 'VM Hard Disks' { Paragraph 'The following table details the VM hard disks' BlankLine $VmDiskReport = @() foreach ($VmHardDisk in $VMHardDisks) { try { - $VmVhd = Get-VHD -CimSession $TempCimSession -Path $VmHardDisk.Path + $VmVhd = Invoke-Command -Session $TempPssSession -ScriptBlock{ Get-VHD -Path ($using:VmHardDisk).Path } $TempVmDiskReport = [PSCustomObject]@{ 'Disk Path' = $VmVhd.Path 'Disk Format' = $VmVhd.VhdFormat From 803dd484ee92b5ece3b3d6e2d1bbb11a4f353040 Mon Sep 17 00:00:00 2001 From: Jonathan Colon Date: Wed, 10 May 2023 17:04:08 -0400 Subject: [PATCH 07/14] Update Invoke-AsBuiltReport.Microsoft.Windows.ps1 --- Src/Public/Invoke-AsBuiltReport.Microsoft.Windows.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Src/Public/Invoke-AsBuiltReport.Microsoft.Windows.ps1 b/Src/Public/Invoke-AsBuiltReport.Microsoft.Windows.ps1 index 716aea1..df2eb6b 100644 --- a/Src/Public/Invoke-AsBuiltReport.Microsoft.Windows.ps1 +++ b/Src/Public/Invoke-AsBuiltReport.Microsoft.Windows.ps1 @@ -189,7 +189,7 @@ function Invoke-AsBuiltReport.Microsoft.Windows { Get-AbrWinHyperVNuma # Hyper-V Networking Get-AbrWinHyperVNetworking - # Hyper-V VM Information (Buggy as hell) + # Hyper-V VM Information Get-AbrWinHyperVHostVM } } else { From b82a2acd2b843817eec381b53b15363d76f7308f Mon Sep 17 00:00:00 2001 From: Jonathan Colon Date: Wed, 10 May 2023 17:25:46 -0400 Subject: [PATCH 08/14] Enabled Hyper-V Management OS Adapters section --- Src/Private/Get-AbrWinHyperVNetworking.ps1 | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/Src/Private/Get-AbrWinHyperVNetworking.ps1 b/Src/Private/Get-AbrWinHyperVNetworking.ps1 index 78b6e92..c513f68 100644 --- a/Src/Private/Get-AbrWinHyperVNetworking.ps1 +++ b/Src/Private/Get-AbrWinHyperVNetworking.ps1 @@ -57,9 +57,8 @@ function Get-AbrWinHyperVNetworking { catch { Write-PscriboMessage -IsWarning $_.Exception.Message } - <# Buggy as hell try { - $VmOsAdapters = Get-VMNetworkAdapter -CimSession $TempCimSession -ManagementOS + $VmOsAdapters = Invoke-Command -Session $TempPssSession { Get-VMNetworkAdapter -ManagementOS | Select-Object -Property * } if ($VmOsAdapters) { Section -Style Heading3 "Hyper-V Management OS Adapters" { Paragraph 'The following table details the Management OS Virtual Adapters created on Virtual Switches' @@ -67,12 +66,12 @@ function Get-AbrWinHyperVNetworking { $VmOsAdapterReport = @() Foreach ($VmOsAdapter in $VmOsAdapters) { try { - $AdapterVlan = Get-VMNetworkAdapterVlan -CimSession $TempCimSession -ManagementOS -VMNetworkAdapterName $VmOsAdapter.Name + $AdapterVlan = Invoke-Command -Session $TempPssSession { Get-VMNetworkAdapterVlan -ManagementOS -VMNetworkAdapterName ($using:VmOsAdapter).Name | Select-Object -Property * } $TempVmOsAdapterReport = [PSCustomObject]@{ 'Name' = $VmOsAdapter.Name 'Switch Name' = $VmOsAdapter.SwitchName 'Mac Address' = $VmOsAdapter.MacAddress - 'IPv4 Address' = $VmOsAdapter.IPAddresses -Join "," + 'IPv4 Address' = ConvertTo-EmptyToFiller $VmOsAdapter.IPAddresses 'Adapter Mode' = $AdapterVlan.OperationMode 'Vlan ID' = $AdapterVlan.AccessVlanId } @@ -84,7 +83,7 @@ function Get-AbrWinHyperVNetworking { } $TableParams = @{ Name = "VM Management OS Adapters" - List = $false + List = $true ColumnWidths = 50, 50 } if ($Report.ShowTableCaptions) { @@ -96,7 +95,7 @@ function Get-AbrWinHyperVNetworking { } catch { Write-PscriboMessage -IsWarning $_.Exception.Message - }#> + } try { $VmSwitches = Invoke-Command -Session $TempPssSession { Get-VMSwitch } if ($VmSwitches) { @@ -110,7 +109,7 @@ function Get-AbrWinHyperVNetworking { 'Switch Name' = $VmSwitch.Name 'Switch Type' = $VmSwitch.SwitchType 'Embedded Team' = ConvertTo-TextYN $VmSwitch.EmbeddedTeamingEnabled - 'Interface Description' = $VmSwitch.NetAdapterInterfaceDescription + 'Interface Description' = ConvertTo-EmptyToFiller $VmSwitch.NetAdapterInterfaceDescription } $VmSwitchesReport += $TempVmSwitchesReport } @@ -176,4 +175,4 @@ function Get-AbrWinHyperVNetworking { } } end {} -} \ No newline at end of file +} From d9bd5176f211b8ce4f5efc43eca7abd15c969f87 Mon Sep 17 00:00:00 2001 From: Jonathan Colon Date: Wed, 10 May 2023 21:28:18 -0400 Subject: [PATCH 09/14] Remove unused paragraph code --- Src/Private/Get-AbrWinHostHWSummary.ps1 | 1 + Src/Private/Get-AbrWinHostStorageMPIO.ps1 | 2 +- Src/Private/Get-AbrWinHyperVHostVM.ps1 | 10 +--------- Src/Private/Get-AbrWinHyperVNetworking.ps1 | 6 +----- Src/Private/Get-AbrWinHyperVNuma.ps1 | 2 -- Src/Private/Get-AbrWinLocalAdmin.ps1 | 2 -- Src/Private/Get-AbrWinLocalGroup.ps1 | 2 -- Src/Private/Get-AbrWinLocalUser.ps1 | 2 -- Src/Private/Get-AbrWinNetAdapter.ps1 | 2 -- Src/Private/Get-AbrWinNetAdapterMTU.ps1 | 2 -- Src/Private/Get-AbrWinNetFirewall.ps1 | 2 -- Src/Private/Get-AbrWinOSDriver.ps1 | 2 -- Src/Private/Get-AbrWinOSHotfix.ps1 | 2 -- Src/Private/Get-AbrWinOSRoleFeature.ps1 | 4 ---- Src/Public/Invoke-AsBuiltReport.Microsoft.Windows.ps1 | 2 +- 15 files changed, 5 insertions(+), 38 deletions(-) diff --git a/Src/Private/Get-AbrWinHostHWSummary.ps1 b/Src/Private/Get-AbrWinHostHWSummary.ps1 index 1a55ab1..290a3ee 100644 --- a/Src/Private/Get-AbrWinHostHWSummary.ps1 +++ b/Src/Private/Get-AbrWinHostHWSummary.ps1 @@ -29,6 +29,7 @@ function Get-AbrWinHostHWSummary { try { Section -Style Heading2 'Host Hardware Settings' { Paragraph 'The following section details hardware settings for the host' + BlankLine $HostHardware = [PSCustomObject] @{ 'Manufacturer' = $HostComputer.Manufacturer 'Model' = $HostComputer.Model diff --git a/Src/Private/Get-AbrWinHostStorageMPIO.ps1 b/Src/Private/Get-AbrWinHostStorageMPIO.ps1 index 15c0806..3edf1f8 100644 --- a/Src/Private/Get-AbrWinHostStorageMPIO.ps1 +++ b/Src/Private/Get-AbrWinHostStorageMPIO.ps1 @@ -40,7 +40,7 @@ function Get-AbrWinHostStorageMPIO $MpioAutoClaim = Invoke-Command -Session $TempPssSession -ScriptBlock { Get-MSDSMAutomaticClaimSettings | Select-Object -ExpandProperty Keys } if ($MpioAutoClaim) { Section -Style Heading4 'Multipath I/O AutoClaim' { - Paragraph 'The Following table details the BUS types MPIO will automatically claim for' + Paragraph 'The following table details the BUS types MPIO will automatically claim for' Blankline $MpioAutoClaimReport = @() foreach ($key in $MpioAutoClaim) { diff --git a/Src/Private/Get-AbrWinHyperVHostVM.ps1 b/Src/Private/Get-AbrWinHyperVHostVM.ps1 index 07fb76a..db485ae 100644 --- a/Src/Private/Get-AbrWinHyperVHostVM.ps1 +++ b/Src/Private/Get-AbrWinHyperVHostVM.ps1 @@ -57,7 +57,7 @@ function Get-AbrWinHyperVHostVM { $VmSummary | Sort-Object 'VM Name' | Table @TableParams foreach ($Vm in $Vms) { try { - Section -Style Heading4 ($Vm.Name) { + Section -ExcludeFromTOC -Style NOTOCHeading4 ($Vm.Name) { Paragraph 'The following sections detail the VM configuration settings' Blankline try { @@ -98,8 +98,6 @@ function Get-AbrWinHyperVHostVM { } try { Section -ExcludeFromTOC -Style NOTOCHeading5 'Virtual Machine Guest Integration Service' { - Paragraph 'The following section details the status of Integration Services' - Blankline $VmIntegrationServiceSummary = @() $VMIntegrationService = Invoke-Command -Session $TempPssSession -ScriptBlock{ Get-VMIntegrationService -VMName ($using:Vm).Name} Foreach ($Service in $VMIntegrationService) { @@ -134,8 +132,6 @@ function Get-AbrWinHyperVHostVM { $VmNetworkAdapters = Invoke-Command -Session $TempPssSession -ScriptBlock{ Get-VMNetworkAdapter -VMName ($using:Vm).Name } if ($VmNetworkAdapters) { Section -ExcludeFromTOC -Style NOTOCHeading5 'VM Network Adapters' { - Paragraph 'The following table details the network adapter details' - BlankLine $VmNetworkAdapterReport = @() ForEach ($Adapter in $VmNetworkAdapters) { try { @@ -172,8 +168,6 @@ function Get-AbrWinHyperVHostVM { $VmAdapterVlan = Invoke-Command -Session $TempPssSession -ScriptBlock{ Get-VMNetworkAdapterVlan -VMName ($using:Vm).Name | Select-Object -Property * } if ($VmAdapterVlan) { Section -ExcludeFromTOC -Style NOTOCHeading5 'VM Network Adapter VLANs' { - Paragraph 'The following section details the VLAN configuration of VM Network Adapters' - BlankLine $VmAdapterVlanReport = @() ForEach ($Adapter in $VmAdapterVlan) { try { @@ -210,8 +204,6 @@ function Get-AbrWinHyperVHostVM { $VmHardDisks =Invoke-Command -Session $TempPssSession -ScriptBlock{ Get-VMHardDiskDrive -VMName ($using:Vm).Name } if ($VmHardDisks) { Section -ExcludeFromTOC -Style NOTOCHeading5 'VM Hard Disks' { - Paragraph 'The following table details the VM hard disks' - BlankLine $VmDiskReport = @() foreach ($VmHardDisk in $VMHardDisks) { try { diff --git a/Src/Private/Get-AbrWinHyperVNetworking.ps1 b/Src/Private/Get-AbrWinHyperVNetworking.ps1 index c513f68..dbb02f9 100644 --- a/Src/Private/Get-AbrWinHyperVNetworking.ps1 +++ b/Src/Private/Get-AbrWinHyperVNetworking.ps1 @@ -29,8 +29,6 @@ function Get-AbrWinHyperVNetworking { try { try { Section -Style Heading3 "Hyper-V MAC Pool settings" { - Paragraph 'The following table details the Hyper-V MAC Pool' - Blankline $VmHostMacPool = [PSCustomObject]@{ 'Mac Address Minimum' = Switch (($VmHost.MacAddressMinimum).Length) { 0 {"-"} @@ -130,9 +128,7 @@ function Get-AbrWinHyperVNetworking { Foreach ($VmSwitch in $VmSwitches) { try { - Section -Style Heading4 ($VmSwitch.Name) { - Paragraph 'The following table details the Hyper-V vSwitch' - Blankline + Section -ExcludeFromTOC -Style NOTOCHeading4 ($VmSwitch.Name) { $VmSwitchReport = [PSCustomObject]@{ 'Switch Name' = $VmSwitch.Name 'Switch Type' = $VmSwitch.SwitchType diff --git a/Src/Private/Get-AbrWinHyperVNuma.ps1 b/Src/Private/Get-AbrWinHyperVNuma.ps1 index 42949c3..ecd136a 100644 --- a/Src/Private/Get-AbrWinHyperVNuma.ps1 +++ b/Src/Private/Get-AbrWinHyperVNuma.ps1 @@ -30,8 +30,6 @@ function Get-AbrWinHyperVNuma { $VmHostNumaNodes = Invoke-Command -Session $TempPssSession { Get-VMHostNumaNode } if ($VmHostNumaNodes) { Section -Style Heading3 "Hyper-V NUMA Boundaries" { - Paragraph 'The following table details the NUMA nodes on the host' - Blankline [array]$VmHostNumaReport = @() foreach ($Node in $VmHostNumaNodes) { try { diff --git a/Src/Private/Get-AbrWinLocalAdmin.ps1 b/Src/Private/Get-AbrWinLocalAdmin.ps1 index 7f16965..d0265e9 100644 --- a/Src/Private/Get-AbrWinLocalAdmin.ps1 +++ b/Src/Private/Get-AbrWinLocalAdmin.ps1 @@ -29,8 +29,6 @@ function Get-AbrWinLocalAdmin { try { if ($LocalAdmins) { Section -Style Heading3 'Local Administrators' { - Paragraph 'The following table lists Local Administrators' - Blankline $LocalAdminsReport = @() ForEach ($LocalAdmin in $LocalAdmins) { try { diff --git a/Src/Private/Get-AbrWinLocalGroup.ps1 b/Src/Private/Get-AbrWinLocalGroup.ps1 index 1d60f85..a8ce650 100644 --- a/Src/Private/Get-AbrWinLocalGroup.ps1 +++ b/Src/Private/Get-AbrWinLocalGroup.ps1 @@ -29,8 +29,6 @@ function Get-AbrWinLocalGroup { try { if ($LocalGroups) { Section -Style Heading3 'Local Groups' { - Paragraph 'The following table details local groups configured' - Blankline $LocalGroupsReport = @() ForEach ($LocalGroup in $LocalGroups) { try { diff --git a/Src/Private/Get-AbrWinLocalUser.ps1 b/Src/Private/Get-AbrWinLocalUser.ps1 index 8dc9874..c1d1f83 100644 --- a/Src/Private/Get-AbrWinLocalUser.ps1 +++ b/Src/Private/Get-AbrWinLocalUser.ps1 @@ -29,8 +29,6 @@ function Get-AbrWinLocalUser { try { if ($LocalUsers) { Section -Style Heading3 'Local Users' { - Paragraph 'The following table details local users' - Blankline $LocalUsersReport = @() ForEach ($LocalUser in $LocalUsers) { try { diff --git a/Src/Private/Get-AbrWinNetAdapter.ps1 b/Src/Private/Get-AbrWinNetAdapter.ps1 index c51bb48..7d22323 100644 --- a/Src/Private/Get-AbrWinNetAdapter.ps1 +++ b/Src/Private/Get-AbrWinNetAdapter.ps1 @@ -30,8 +30,6 @@ function Get-AbrWinNetAdapter { $HostAdapters = Invoke-Command -Session $TempPssSession { Get-NetAdapter } if ($HostAdapters) { Section -Style Heading3 'Network Adapters' { - Paragraph 'The Following table details host network adapters' - Blankline $HostAdaptersReport = @() ForEach ($HostAdapter in $HostAdapters) { try { diff --git a/Src/Private/Get-AbrWinNetAdapterMTU.ps1 b/Src/Private/Get-AbrWinNetAdapterMTU.ps1 index b9a741e..c7cec06 100644 --- a/Src/Private/Get-AbrWinNetAdapterMTU.ps1 +++ b/Src/Private/Get-AbrWinNetAdapterMTU.ps1 @@ -30,8 +30,6 @@ function Get-AbrWinNetAdapterMTU { $NetMtus = Invoke-Command -Session $TempPssSession { Get-NetAdapterAdvancedProperty | Where-Object { $_.DisplayName -eq 'Jumbo Packet' } } if ($NetMtus) { Section -Style Heading3 'Network Adapter MTU' { - Paragraph 'The following table lists Network Adapter MTU settings' - Blankline $NetMtuReport = @() ForEach ($NetMtu in $NetMtus) { try { diff --git a/Src/Private/Get-AbrWinNetFirewall.ps1 b/Src/Private/Get-AbrWinNetFirewall.ps1 index bfd5309..f11e1ee 100644 --- a/Src/Private/Get-AbrWinNetFirewall.ps1 +++ b/Src/Private/Get-AbrWinNetFirewall.ps1 @@ -30,8 +30,6 @@ function Get-AbrWinNetFirewall { $NetFirewallProfile = Get-NetFirewallProfile -CimSession $TempCimSession if ($NetFirewallProfile) { Section -Style Heading2 'Windows Firewall' { - Paragraph 'The Following table is a the Windowss Firewall Summary' - Blankline $NetFirewallProfileReport = @() Foreach ($FirewallProfile in $NetFireWallProfile) { try { diff --git a/Src/Private/Get-AbrWinOSDriver.ps1 b/Src/Private/Get-AbrWinOSDriver.ps1 index 7bc4fb0..e60adda 100644 --- a/Src/Private/Get-AbrWinOSDriver.ps1 +++ b/Src/Private/Get-AbrWinOSDriver.ps1 @@ -30,8 +30,6 @@ function Get-AbrWinOSDriver { $HostDriversList = Invoke-Command -Session $TempPssSession { Get-WindowsDriver -Online } if ($HostDriversList) { Section -Style Heading3 'Drivers' { - Paragraph 'The following section details host drivers' - Blankline Invoke-Command -Session $TempPssSession { Import-Module DISM } $HostDriverReport = @() ForEach ($HostDriver in $HostDriversList) { diff --git a/Src/Private/Get-AbrWinOSHotfix.ps1 b/Src/Private/Get-AbrWinOSHotfix.ps1 index e8c6654..15fb9b2 100644 --- a/Src/Private/Get-AbrWinOSHotfix.ps1 +++ b/Src/Private/Get-AbrWinOSHotfix.ps1 @@ -30,8 +30,6 @@ function Get-AbrWinOSHotfix { $HotFixes = Invoke-Command -Session $TempPssSession -ScriptBlock { Get-HotFix } if ($HotFixes) { Section -Style Heading3 'Installed Hotfixes' { - Paragraph 'The following table details the OS Hotfixes installed' - Blankline $HotFixReport = @() Foreach ($HotFix in $HotFixes) { try { diff --git a/Src/Private/Get-AbrWinOSRoleFeature.ps1 b/Src/Private/Get-AbrWinOSRoleFeature.ps1 index 5850eb4..26cc81e 100644 --- a/Src/Private/Get-AbrWinOSRoleFeature.ps1 +++ b/Src/Private/Get-AbrWinOSRoleFeature.ps1 @@ -30,8 +30,6 @@ function Get-AbrWinOSRoleFeature { $HostRolesAndFeatures = Invoke-Command -Session $TempPssSession -ScriptBlock{ Get-WindowsFeature | Where-Object { $_.Installed -eq $True } } if ($HostRolesAndFeatures) { Section -Style Heading3 'Roles' { - Paragraph 'The following settings details host roles installed' - Blankline [array]$HostRolesAndFeaturesReport = @() ForEach ($HostRoleAndFeature in $HostRolesAndFeatures) { if ( $HostRoleAndFeature.FeatureType -eq 'Role') { @@ -60,8 +58,6 @@ function Get-AbrWinOSRoleFeature { try { if ($HostRolesAndFeatures) { Section -Style Heading3 'Features and Role Services' { - Paragraph 'The following settings details host features and role services installed' - Blankline [array]$HostRolesAndFeaturesReport = @() ForEach ($HostRoleAndFeature in $HostRolesAndFeatures) { if ( $HostRoleAndFeature.FeatureType -eq 'Role Service' -or $HostRoleAndFeature.FeatureType -eq 'Feature') { diff --git a/Src/Public/Invoke-AsBuiltReport.Microsoft.Windows.ps1 b/Src/Public/Invoke-AsBuiltReport.Microsoft.Windows.ps1 index df2eb6b..d7b2546 100644 --- a/Src/Public/Invoke-AsBuiltReport.Microsoft.Windows.ps1 +++ b/Src/Public/Invoke-AsBuiltReport.Microsoft.Windows.ps1 @@ -114,7 +114,7 @@ function Invoke-AsBuiltReport.Microsoft.Windows { $LocalAdmins = Invoke-Command -Session $TempPssSession { Get-LocalGroupMember -Name 'Administrators' -ErrorAction SilentlyContinue } if ($LocalUsers -or $LocalGroups -or $LocalAdmins) { Section -Style Heading2 'Local Users and Groups' { - Paragraph 'The following section details local users and groups configured' + Paragraph 'The following section details local configured users and groups' Blankline #Local Users Get-AbrWinLocalUser From 062e5717eabb108d98360ed9c3a11d5157f7b094 Mon Sep 17 00:00:00 2001 From: Jonathan Colon Date: Mon, 15 May 2023 11:56:58 -0400 Subject: [PATCH 10/14] Update CHANGELOG.md --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 72c863a..2b8ac0e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # :arrows_counterclockwise: Microsoft Windows As Built Report Changelog +## [0.5.1] - 2023-05-15 + +### Added + +- Added Hyper-V per VM configuration reporting @oolejniczak +- Added Hyper-V Management OS Adapters table @rebelinux + ## [0.5.0] - 2023-05-08 ### Added From 11d8bb39af67fa779869170bc907608c1ee5abe6 Mon Sep 17 00:00:00 2001 From: Jonathan Colon Date: Mon, 15 May 2023 11:57:18 -0400 Subject: [PATCH 11/14] Update AsBuiltReport.Microsoft.Windows.psd1 --- AsBuiltReport.Microsoft.Windows.psd1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AsBuiltReport.Microsoft.Windows.psd1 b/AsBuiltReport.Microsoft.Windows.psd1 index 61756ce..a07e7d7 100644 --- a/AsBuiltReport.Microsoft.Windows.psd1 +++ b/AsBuiltReport.Microsoft.Windows.psd1 @@ -12,7 +12,7 @@ RootModule = 'AsBuiltReport.Microsoft.Windows.psm1' # Version number of this module. -ModuleVersion = '0.5.0' +ModuleVersion = '0.5.1' # Supported PSEditions # CompatiblePSEditions = @() From f65ecee6b5fc38ccb93a3ff68604bfdd6f6e5a8f Mon Sep 17 00:00:00 2001 From: Jonathan Colon Date: Tue, 16 May 2023 10:33:28 -0400 Subject: [PATCH 12/14] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2b8ac0e..9894453 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # :arrows_counterclockwise: Microsoft Windows As Built Report Changelog -## [0.5.1] - 2023-05-15 +## [0.5.1] - 2023-05-16 ### Added From 181e4bcf873ec643e0d60fc95ffff3efabfb2711 Mon Sep 17 00:00:00 2001 From: Jonathan Colon Date: Tue, 16 May 2023 10:45:48 -0400 Subject: [PATCH 13/14] Fix Hyper-V VMs section heading --- Src/Private/Get-AbrWinHyperVHostVM.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Src/Private/Get-AbrWinHyperVHostVM.ps1 b/Src/Private/Get-AbrWinHyperVHostVM.ps1 index db485ae..c4e32ef 100644 --- a/Src/Private/Get-AbrWinHyperVHostVM.ps1 +++ b/Src/Private/Get-AbrWinHyperVHostVM.ps1 @@ -57,7 +57,7 @@ function Get-AbrWinHyperVHostVM { $VmSummary | Sort-Object 'VM Name' | Table @TableParams foreach ($Vm in $Vms) { try { - Section -ExcludeFromTOC -Style NOTOCHeading4 ($Vm.Name) { + Section -Style Heading4 ($Vm.Name) { Paragraph 'The following sections detail the VM configuration settings' Blankline try { From 4bea7dfc658050becc6ccc7daaf25ada2b725f2f Mon Sep 17 00:00:00 2001 From: Jonathan Colon Date: Tue, 16 May 2023 10:48:06 -0400 Subject: [PATCH 14/14] Update AsBuiltReport.Microsoft.Windows.psd1 --- AsBuiltReport.Microsoft.Windows.psd1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AsBuiltReport.Microsoft.Windows.psd1 b/AsBuiltReport.Microsoft.Windows.psd1 index a07e7d7..f3a9ac7 100644 --- a/AsBuiltReport.Microsoft.Windows.psd1 +++ b/AsBuiltReport.Microsoft.Windows.psd1 @@ -27,7 +27,7 @@ Author = 'Andrew Ramsay' # CompanyName = 'Unknown' # Copyright statement for this module -Copyright = '(c) 2022 Andrew Ramsay. All rights reserved.' +Copyright = '(c) 2023 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.'