AsBuiltReport / AsBuiltReport.VMware.vSphere

Repository for AsBuiltReport VMware vSphere module
https://www.asbuiltreport.com
MIT License
112 stars 39 forks source link

Cannot validate argument on parameter 'Name' ... #62

Closed brianladish closed 5 years ago

brianladish commented 5 years ago

Hello, receiving a "Cannot validate argument" error when running New-AsBuiltReport command. This is only happening when I try to use the -ReportConfigPath and -AsBuiltConfigPath parameters. If I don't include these parameters the report is generated correctly.

The path and files specified by -ReportConfigPath and -AsBuiltConfigPath are correct and the json files were actually generated by running the command and saving the files during the prompts.

Command: New-AsBuiltReport -Target vcentername -Credential $mycred -Report VMware.vSphere -Format Html,Word -ReportConfigPath 'C:\Scripts\Config\AsBuiltReport.json' -AsBuiltConfigPath 'C:\Scripts\Config\AsBuiltReport.VMware.vSphere.json' -OutputPath 'C:\Scripts\Output\ASBuilt\' -Timestamp

Error: Cannot validate argument on parameter 'Name'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again. At line:1 char:1

Expected behavior I expected the command to accept the input for the parameters as configuration and run the report.

System (please provide the following information about the system from which you are trying to generate a report):

tpcarman commented 5 years ago

Hi @brianladish,

You appear to have the JSON config files switched around the wrong way.

AsBuiltReport.VMware.vSphere.json is the Report Config JSON AsBuiltReport.json is the AsBuiltReport Config JSON

It should read as follows;

New-AsBuiltReport -Target vcentername -Credential $mycred -Report VMware.vSphere -Format Html,Word -ReportConfigPath 'C:\Scripts\Config\AsBuiltReport.VMware.vSphere.json' -AsBuiltConfigPath 'C:\Scripts\Config\AsBuiltReport.json' -OutputPath 'C:\Scripts\Output\ASBuilt' -Timestamp

Please let me know if this resolves your issue.

brianladish commented 5 years ago

Sigh sorry to bother you on something I should have realized. That was the issue.

Thanks for your help and Thanks for all the work you have done on these reports!