@@ -21,15 +21,14 @@ function New-AsBuiltConfig {
2121 param ()
2222
2323 begin {
24- # Clear-Host
2524 # Run section to prompt user for information about the As Built Report to be exported to JSON format (if saved)
2625 $global :Config = @ { }
27- $DirectorySeparatorChar = [System.IO.Path ]::DirectorySeparatorChar
2826 Initialize-LocalizedData - ModuleType ' Core' - ModuleBasePath (Split-Path (Split-Path $PSScriptRoot - Parent) - Parent) - LanguageFile ' New-AsBuiltConfig'
2927
3028 }
3129
3230 process {
31+ Clear-Host
3332 # region Report configuration
3433 # Show As Built Report configuration banner
3534 Draw- AsciiBanner - Lines @ ($translate.ReportInfo.BannerTitle ) - ExtraPadding 4 - TextColor ' Cyan' - BorderColor ' Cyan'
@@ -298,9 +297,10 @@ function New-AsBuiltConfig {
298297 Clear-Host
299298 # Show Rerport configuration banner
300299 Draw- AsciiBanner - Lines @ ($translate.ReportConfig.BannerTitle ) - ExtraPadding 4 - TextColor ' Cyan' - BorderColor ' Cyan'
301- $ReportConfigFolder = Read-Host - Prompt ($translate.ReportConfig.ReportConfigFolder -f $ ($Home + $DirectorySeparatorChar + " AsBuiltReport" ))
300+ $DefaultConfigFolder = Join-Path - Path $Home - ChildPath " AsBuiltReport"
301+ $ReportConfigFolder = Read-Host - Prompt ($translate.ReportConfig.ReportConfigFolder -f $DefaultConfigFolder )
302302 if (($null -eq $ReportConfigFolder ) -or ($ReportConfigFolder -eq " " )) {
303- $ReportConfigFolder = Join-Path - Path $Home - ChildPath " AsBuiltReport "
303+ $ReportConfigFolder = $DefaultConfigFolder
304304 }
305305
306306 # If the folder doesn't exist, create it
@@ -392,9 +392,10 @@ function New-AsBuiltConfig {
392392 $AsBuiltExportPath = $ReportConfigFolderPath
393393 }
394394 } else {
395- $AsBuiltExportPath = Read-Host - Prompt ($translate.ReportConfig.AsBuiltExportPath -f $ ($Home + $DirectorySeparatorChar + ' AsBuiltReport' ))
395+ $DefaultConfigFolder = Join-Path - Path $Home - ChildPath " AsBuiltReport"
396+ $AsBuiltExportPath = Read-Host - Prompt ($translate.ReportConfig.AsBuiltExportPath -f $DefaultConfigFolder )
396397 if (($null -eq $AsBuiltExportPath ) -or ($AsBuiltExportPath -eq " " )) {
397- $AsBuiltExportPath = Join-Path - Path $Home - ChildPath " AsBuiltReport "
398+ $AsBuiltExportPath = $DefaultConfigFolder
398399 }
399400 }
400401 if (-not (Test-Path - Path $AsBuiltExportPath )) {
0 commit comments