PowerShellBuild icon indicating copy to clipboard operation
PowerShellBuild copied to clipboard

Not possible to disable PSScriptAnalyzer in properties

Open FLeven opened this issue 3 years ago • 0 comments

I chose to override some properties in pssake.ps1:

properties {

# Set this to $true to create a module with a monolithic PSM1
$PSBPreference.Build.CompileModule = $false
$PSBPreference.Help.DefaultLocale = 'en-US'
$PSBPreference.Test.OutputFile = 'out/testResults.xml'
# These settings overwrite values supplied from the PowerShellBuild
# module and govern how those tasks are executed
$PSBPreference.Test.ScriptAnalysisEnabled = $false
$PSBPreference.Test.CodeCoverage.Enabled  = $false
$PSBPreference.Publish.PSRepository = 'pwsh'
}

Expected Behavior

It should be possible to enable or disable CodeCoverage or PSScriptAnalyzer Tasks

Current Behavior

I can enable or disable CodeCoverage or override the name of the PSGallery used without any problem, but it is not possible to disable the PSScriptanalyzer as describe.

Possible Solution

For now I disable the Analyze Step in build.properties.ps1 on my build agent, because the Analyze Step fails ?randomly? from time to time.

Steps to Reproduce (for bugs)

  1. add $PSBPreference.Test.ScriptAnalysisEnabled = $false to pssake.ps1
  2. add $PSBPreference.Test.CodeCoverage.Enabled = $true to pssake.ps1
  3. Build

Context

Your Environment

Powershell 5.1 I always use all the required dependency's in the required version

FLeven avatar Feb 19 '22 11:02 FLeven