[X] I have verified this is the correct repository for opening this issue.
[X] I have verified no other issues exist related to my problem.
[X] I have verified this is not an issue for a specific package.
[X] I have verified this issue is not security related.
[X] I confirm I am using official, and not unofficial, or modified, Chocolatey products.
What You Are Seeing?
When running a build using this recipe with the Run-PSScriptAnalyzer step enabled, the build fails if the project being built happens to not have any module or script files to analyze.
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.
What is Expected?
This step should gracefully skip analysis of script or module files if there are none to analyze, outputting this fact to the console.
How Did You Get This To Happen?
Bump project (specifically Chocolatey GUI Licensed) to Chocolatey.Cake.Recipe 0.26.3
Run the build (build.bat --verbosity=diagnostic --target=CI --testExecutionType=unit --shouldRunOpenCover=false)
See the build fail with the message Cannot validate argument on parameter 'Path'. The argument is null. Provide a valid value for the argument, and then try running the command again.
System Details
Non-production TeamCity server
Installed Packages
N/A
Output Log
23:52:58 ========================================
23:52:58 Run-PSScriptAnalyzer
23:52:58 ========================================
23:52:58 Executing: &"C:/buildAgent/work/e281d7b6ca240c5/tools/Chocolatey.Cake.Recipe.0.26.3/Content/install-module.ps1" -ModuleName PSScriptAnalyzer -RequiredVersion 1.21.0
23:52:59 Install Module PSScriptAnalyzer with version 1.21.0...
23:53:41 Executing: &"C:/buildAgent/work/e281d7b6ca240c5/tools/Chocolatey.Cake.Recipe.0.26.3/Content/install-module.ps1" -ModuleName ConvertToSARIF -RequiredVersion 1.0.0
23:53:41 Install Module ConvertToSARIF with version 1.0.0...
23:53:50 There are no PSScriptAnalyzer Settings defined for this build, running with default format checking settings.
23:53:50 Executing: &"C:/buildAgent/work/e281d7b6ca240c5/tools/Chocolatey.Cake.Recipe.0.26.3/Content/run-psscriptanalyzer.ps1" -AnalyzePath "C:/buildAgent/work/e281d7b6ca240c5" -SettingsPath "C:/buildAgent/work/e281d7b6ca240c5/tools/Chocolatey.Cake.Recipe.0.26.3/Content/formatting-settings.psd1" -OutputPath "C:/buildAgent/work/e281d7b6ca240c5/code_drop/TestResults/PSScriptAnalyzer" -ExcludePaths tools, code_drop, src\*\bin\Debug, Source\*\bin\Debug, src\*\bin\Release, Source\*\bin\Release, src\packages, Source\packages
23:53:51 The 'Microsoft.PowerShell.Management' module was not imported because the 'Microsoft.PowerShell.Management' snap-in was already imported.
23:53:51 The 'Microsoft.PowerShell.Utility' module was not imported because the 'Microsoft.PowerShell.Utility' snap-in was already imported.
23:53:51 Analyzing module files...
23:53:53 Cannot validate argument on parameter 'Path'. The argument is null. Provide a valid value for the argument, and then try running the command again.
23:53:53 No rule violations found in Module Files.
23:53:53 Analyzing script files...
23:53:55 Violations found in Script Files...
[clipped]
Checklist
What You Are Seeing?
When running a build using this recipe with the
Run-PSScriptAnalyzer
step enabled, the build fails if the project being built happens to not have any module or script files to analyze.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.
What is Expected?
This step should gracefully skip analysis of script or module files if there are none to analyze, outputting this fact to the console.
How Did You Get This To Happen?
build.bat --verbosity=diagnostic --target=CI --testExecutionType=unit --shouldRunOpenCover=false
)Cannot validate argument on parameter 'Path'. The argument is null. Provide a valid value for the argument, and then try running the command again.
System Details
Non-production TeamCity server
Installed Packages
Output Log
Additional Context
N/A