AsBuiltReport / AsBuiltReport.Core

Repository for AsBuiltReport core module
https://www.asbuiltreport.com
MIT License
54 stars 23 forks source link

AsBuiltReport fails when multiple versions of the same AsBuiltReport report module exist #21

Closed tpcarman closed 4 years ago

tpcarman commented 5 years ago

Describe the bug If multiple versions of the same report module (eg. AsBuiltReport.VMware.vSphere) are installed, an error may appear when running either of these commands,

Error Message

Copy-Item : Cannot find path 'C:\Program Files\WindowsPowerShell\Modules\AsBuiltReport.VMware.vSphere\1.0.6 C:\Program
Files\WindowsPowerShell\Modules\AsBuiltReport.VMware.vSphere\1.0.0\AsBuiltReport.VMware.vSphere AsBuiltReport.VMware.vSphere.json' because it does not exist.
At C:\Program Files\WindowsPowerShell\Modules\AsBuiltReport.Core\1.0.0\Src\Public\New-AsBuiltReportConfig.ps1:78 char:17
+ ...             Copy-Item -Path "$($Module.ModuleBase)\$($Module.Name).js ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (C:\Program File...re.vSphere.json:String) [Copy-Item], ItemNotFoundException
    + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.CopyItemCommand

Workaround 1

  1. Uninstall older versions of the report modules Uninstall-module -Name AsBuiltReport.<Report.Module> -RequiredVersion <version to uninstall>

Workaround 2 Run New-AsBuiltReport and specify existing configuration files

  1. Specify AsBuiltReport config using -AsBuiltConfigPath parameter
  2. Specify Report config using -ReportConfigPath parameter
tpcarman commented 4 years ago

Fixed in d76e460