diff --git a/AsBuiltReport.Core/AsBuiltReport.Core.psd1 b/AsBuiltReport.Core/AsBuiltReport.Core.psd1 index 83c82d8..dbdf81a 100644 --- a/AsBuiltReport.Core/AsBuiltReport.Core.psd1 +++ b/AsBuiltReport.Core/AsBuiltReport.Core.psd1 @@ -13,7 +13,7 @@ # Version number of this module. - ModuleVersion = '1.5.0' + ModuleVersion = '1.5.1' # Supported PSEditions CompatiblePSEditions = @('Desktop', 'Core') diff --git a/AsBuiltReport.Core/Src/Public/New-AsBuiltReport.ps1 b/AsBuiltReport.Core/Src/Public/New-AsBuiltReport.ps1 index 9742226..671699c 100644 --- a/AsBuiltReport.Core/Src/Public/New-AsBuiltReport.ps1 +++ b/AsBuiltReport.Core/Src/Public/New-AsBuiltReport.ps1 @@ -266,12 +266,12 @@ function New-AsBuiltReport { [String] $Orientation = 'Portrait', [Parameter( - Mandatory = $true, + Mandatory = $false, HelpMessage = 'Please provide the path to the document output file' )] [ValidateNotNullOrEmpty()] [Alias('OutputPath')] - [String] $OutputFolderPath, + [String] $OutputFolderPath = (Get-Location).Path, [Parameter( Mandatory = $false, diff --git a/CHANGELOG.md b/CHANGELOG.md index 1035d53..39b9bf2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [1.5.1] - 2025-11-17 + +### Changed +- `OutputFolderPath` parameter is now optional. If not specified, the report will be saved to the current folder location. Resolves [#65](https://github.com/AsBuiltReport/AsBuiltReport.Core/issues/65). + ## [1.5.0] - 2025-10-21 ### Added diff --git a/README.md b/README.md index 10b0933..ec15086 100644 --- a/README.md +++ b/README.md @@ -152,7 +152,7 @@ If you are unable to use the PowerShell Gallery, you can still install the `AsBu 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`. +3. Copy the sub-folder `AsBuiltReport.Core` to a path that is set in `$env:PSModulePath`. 4. For Windows users only, 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 @@ -262,8 +262,8 @@ Get-Help New-AsBuiltReportConfig -Full Here are some examples to get you going. ```powershell -# Generate a VMware vSphere AsBuiltReport in HTML & Word formats. Perform a health check to highlight particular issues which exist within the VMware vSphere environment. Save the report to the 'H:\Documents\' folder. -New-AsBuiltReport -Report 'VMware.vSphere' -Target '192.168.1.100' -Username 'admin' -Password 'admin' -Format HTML,Word -EnableHealthCheck -OutputFolderPath 'H:\Documents\' +# Generate a VMware vSphere AsBuiltReport in HTML & Word formats. Perform a health check to highlight particular issues which exist within the VMware vSphere environment. Save the report to the current folder. +New-AsBuiltReport -Report 'VMware.vSphere' -Target '192.168.1.100' -Username 'admin' -Password 'admin' -Format HTML,Word -EnableHealthCheck # Generate a Nutanix Prism Element AsBuiltReport using specified username and password credentials. Specify the report configuration file to be used. Export report to Text, HTML & DOCX formats. Use the default report style. Save the report to the '/Users/Tim/Documents' folder. Display verbose messages to the console. New-AsBuiltReport -Report 'Nutanix.PrismElement' -Target 'prism.nutanix.local' -Username 'demo' -Password 'demo' -Format Text,Html,Word -OutputFolderPath '/Users/Tim/Documents' -ReportConfigFilePath '/Users/Tim/AsBuiltReport/AsBuiltReport.Nutanix.PrismElement.json' -Verbose @@ -296,4 +296,4 @@ New-AsBuiltReport -Report Veeam.VBR -Target veeam01.corp.local -Username admin - - **Images are missing from reports generated using Linux or macOS** - Unfortunately due to [breaking changes](https://learn.microsoft.com/en-gb/dotnet/core/compatibility/core-libraries/6.0/system-drawing-common-windows-only) in .NET 6, images are no longer supported for reports generated using Linux or macOS. \ No newline at end of file + Unfortunately due to [breaking changes](https://learn.microsoft.com/en-gb/dotnet/core/compatibility/core-libraries/6.0/system-drawing-common-windows-only) in .NET 6, images are no longer supported for reports generated using Linux or macOS. diff --git a/Tests/Unit/New-AsBuiltReport.Tests.ps1 b/Tests/Unit/New-AsBuiltReport.Tests.ps1 index 7e8ad81..f98c9b0 100644 --- a/Tests/Unit/New-AsBuiltReport.Tests.ps1 +++ b/Tests/Unit/New-AsBuiltReport.Tests.ps1 @@ -20,11 +20,6 @@ Describe 'New-AsBuiltReport Unit Tests' { ($TargetParam.Attributes | Where-Object { $_ -is [System.Management.Automation.ParameterAttribute] }).Mandatory | Should -Contain $true } - It 'Should have OutputFolderPath parameter as mandatory' { - $OutputParam = $Command.Parameters['OutputFolderPath'] - ($OutputParam.Attributes | Where-Object { $_ -is [System.Management.Automation.ParameterAttribute] }).Mandatory | Should -Contain $true - } - It 'Should have Credential parameter in Credential parameter set' { $CredentialParam = $Command.Parameters['Credential'] $CredentialParam | Should -Not -BeNullOrEmpty @@ -80,6 +75,10 @@ Describe 'New-AsBuiltReport Unit Tests' { $TargetParam.ParameterType.Name | Should -Be 'String[]' } + It 'Should have OutputFolderPath parameter' { + $Command.Parameters.Keys | Should -Contain 'OutputFolderPath' + } + It 'Should have Timestamp parameter' { $Command.Parameters.Keys | Should -Contain 'Timestamp' }