This PR adds a check to determine if there are any Module or Script files to be analyzed before proceeding to attempt to pass a potentially NULL variable to PSScriptAnalyzer.
Motivation and Context
The Chocolatey GUI Licensed project includes script files but not modules files which was causing it's build to fail due to the resulting attempt to analyze a NULL path resulting in the error message is:
Cannot validate argument on parameter 'Path'. The argument is null. Provide a valid value for the argument, and then try running the command again.
Testing
This has been tested on a non-production build agent by manually editing the run-psscriptanalyzer.ps1 script and re-running the build.
Operating Systems Testing
Windows Server 2019
Change Types Made
[X] Bug fix (non-breaking change).
[ ] Feature / Enhancement (non-breaking change).
[ ] Breaking change (fix or feature that could cause existing functionality to change).
Description Of Changes
This PR adds a check to determine if there are any Module or Script files to be analyzed before proceeding to attempt to pass a potentially NULL variable to PSScriptAnalyzer.
Motivation and Context
The Chocolatey GUI Licensed project includes script files but not modules files which was causing it's build to fail due to the resulting attempt to analyze a NULL path resulting in the error message is:
Cannot validate argument on parameter 'Path'. The argument is null. Provide a valid value for the argument, and then try running the command again.
Testing
This has been tested on a non-production build agent by manually editing the
run-psscriptanalyzer.ps1
script and re-running the build.Operating Systems Testing
Windows Server 2019
Change Types Made
Change Checklist
Related Issue
Fixes #142