Skip to content
This repository was archived by the owner on Jul 6, 2022. It is now read-only.

Commit c31ee79

Browse files
authored
Update issue templates (#57)
* Update issue templates * debug PSScriptAnalyzer
1 parent c45490a commit c31ee79

File tree

2 files changed

+50
-19
lines changed

2 files changed

+50
-19
lines changed

.github/ISSUE_TEMPLATE/default.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
name: Default
3+
about: Use this template if nothing seems to work.
4+
title: ":question: "
5+
labels: question
6+
assignees: ''
7+
8+
---
9+
10+
#### :grey_question: Simply ask your question here: :grey_question:
11+
12+
<!-- Take your time an think about your problem.... -->

tools/DroneIO.psm1

Lines changed: 38 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -33,35 +33,35 @@ function Invoke-InstallDependencies {
3333
$ErrorActionPreference = 'Stop'
3434
try {
3535
$ParamsPSScript = @{
36-
Name = 'PSScriptAnalyzer'
37-
Scope = 'CurrentUser'
38-
RequiredVersion = '1.20.0'
39-
Force = $true
36+
Name = 'PSScriptAnalyzer'
37+
Scope = 'CurrentUser'
38+
RequiredVersion = '1.20.0'
39+
Force = $true
4040
SkipPublisherCheck = $true
41-
AllowClobber = $true
42-
Verbose = $VerbosePreference
41+
AllowClobber = $true
42+
Verbose = $VerbosePreference
4343
}
4444
Install-Module @ParamsPSScript
4545

4646
$ParamsPester = @{
47-
Name = 'Pester'
48-
Scope = 'CurrentUser'
49-
RequiredVersion = '5.3.3'
50-
Force = $true
47+
Name = 'Pester'
48+
Scope = 'CurrentUser'
49+
RequiredVersion = '5.3.3'
50+
Force = $true
5151
SkipPublisherCheck = $true
52-
AllowClobber = $true
53-
Verbose = $VerbosePreference
52+
AllowClobber = $true
53+
Verbose = $VerbosePreference
5454
}
5555
Install-Module @ParamsPester
5656

5757
$ParamsPosh = @{
58-
Name = 'posh-git'
59-
Scope = 'CurrentUser'
60-
RequiredVersion = '1.1.0'
61-
Force = $true
58+
Name = 'posh-git'
59+
Scope = 'CurrentUser'
60+
RequiredVersion = '1.1.0'
61+
Force = $true
6262
SkipPublisherCheck = $true
63-
AllowClobber = $true
64-
Verbose = $VerbosePreference
63+
AllowClobber = $true
64+
Verbose = $VerbosePreference
6565
#ErrorAction = 'Stop'
6666
}
6767
Install-Module @ParamsPosh
@@ -96,8 +96,27 @@ function Invoke-Linter {
9696
Recurse = $true
9797
Settings = './tools/PSScriptAnalyzerSettings.psd1'
9898
ReportSummary = $true
99+
ErrorAction = 'Stop'
100+
}
101+
try {
102+
$AnalyzerResults = Invoke-ScriptAnalyzer @AnalyzerSettings
103+
if ( $AnalyzerResults ) {
104+
$AnalyzerResults | Sort-Object -Property @(
105+
"ScriptName",
106+
"Line"
107+
) | Format-Table @(
108+
"Severity",
109+
"ScriptName",
110+
"Line",
111+
"RuleName",
112+
"Message"
113+
) -AutoSize | Out-String | Write-Verbose -Verbose
114+
}
115+
}
116+
catch {
117+
Write-Error -Message 'PSScriptAnalyzer failer'
118+
Write-Error -Message $_.Exception.Message -ErrorAction 'Stop'
99119
}
100-
Invoke-ScriptAnalyzer @AnalyzerSettings
101120
}
102121
}
103122

0 commit comments

Comments
 (0)