From c78fb8123ae25a51a211a77406424216e700bae5 Mon Sep 17 00:00:00 2001 From: Oliver Lipkau Date: Fri, 1 Jun 2018 23:28:50 +0200 Subject: [PATCH 1/2] Fixed installation of PSScriptAnalyzer --- Tools/build.requirements.psd1 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Tools/build.requirements.psd1 b/Tools/build.requirements.psd1 index 2c0e1b26..7c0668f0 100644 --- a/Tools/build.requirements.psd1 +++ b/Tools/build.requirements.psd1 @@ -17,5 +17,10 @@ Version = "4.1.1" } platyPS = "latest" - PSScriptAnalyzer = "latest" + PSScriptAnalyzer = @{ + Parameters = @{ + SkipPublisherCheck = $true + } + Version = "latest" + } } From 23ab6c65a65e550ad376c952b35f58fe7e81c954 Mon Sep 17 00:00:00 2001 From: Oliver Lipkau Date: Sat, 2 Jun 2018 09:14:14 +0200 Subject: [PATCH 2/2] IMplemented workaround to PSScriptAnalyzer error message --- Tests/JiraPS.Tests.ps1 | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Tests/JiraPS.Tests.ps1 b/Tests/JiraPS.Tests.ps1 index 635e734e..3512d171 100644 --- a/Tests/JiraPS.Tests.ps1 +++ b/Tests/JiraPS.Tests.ps1 @@ -186,7 +186,13 @@ Describe "JiraPS" { if ($PSVersionTable.PSVersion.Major -gt 3) { Import-Module $manifestFile -Force -ErrorAction Stop - $analysis = Invoke-ScriptAnalyzer -Path "$moduleRoot" -Recurse -Settings "$projectRoot/PSScriptAnalyzerSettings.psd1" + $invokeScriptAnalyzerSplat = @{ + Path = "$moduleRoot" + Settings = "$projectRoot/PSScriptAnalyzerSettings.psd1" + Recurse = $true + ErrorAction = 'SilentlyContinue' + } + $analysis = Invoke-ScriptAnalyzer @invokeScriptAnalyzerSplat $scriptAnalyzerRules = Get-ScriptAnalyzerRule forEach ($rule in $scriptAnalyzerRules) {