Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not possible to disable PSScriptAnalyzer in properties #59

Open
FLeven opened this issue Feb 19, 2022 · 0 comments
Open

Not possible to disable PSScriptAnalyzer in properties #59

FLeven opened this issue Feb 19, 2022 · 0 comments

Comments

@FLeven
Copy link

FLeven commented Feb 19, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant