Skip to content

Commit 599e28d

Browse files
committed
🔧 Configure PSScriptAnalyzer for the project #5
- Added the following settings files to the root folder: + `PSScriptAnalyzerSettings.psd1` + `PSScriptAnalyzerSettings.desktop-3.0-windows.psd1` - Enabled `PSUseCompatibleCmdlets` and `PSUseCompatibleSyntax` rules to ensure the scripts are compatible with the target PowerShell version + `PSScriptAnalyzerSettings.psd1`: PowerShell 2.0 or higher + `...desktop-3.0-windows.psd1`: PowerShell 3.0 to 5.0 desktop version Fixes [#5](#5)
1 parent 130d6b0 commit 599e28d

File tree

2 files changed

+46
-0
lines changed

2 files changed

+46
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
@{
2+
Severity = @('Error', 'Warning')
3+
Rules = @{
4+
PSUseCompatibleCmdlets = @{
5+
Compatibility = @(
6+
'desktop-3.0-windows'
7+
'desktop-4.0-windows'
8+
'desktop-5.1.14393.206-windows'
9+
)
10+
}
11+
PSUseCompatibleSyntax = @{
12+
TargetedVersions = @(
13+
'6.0'
14+
'5.1'
15+
'4.0'
16+
'3.0'
17+
'2.0'
18+
)
19+
}
20+
}
21+
ExcludeRules = @('PSAvoidUsingWriteHost')
22+
}

PSScriptAnalyzerSettings.psd1

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
@{
2+
Severity = @('Error', 'Warning')
3+
Rules = @{
4+
PSUseCompatibleCmdlets = @{
5+
Compatibility = @(
6+
'desktop-2.0-windows'
7+
'desktop-3.0-windows'
8+
'desktop-4.0-windows'
9+
'desktop-5.1.14393.206-windows'
10+
'core-6.1.0-windows'
11+
)
12+
}
13+
PSUseCompatibleSyntax = @{
14+
TargetedVersions = @(
15+
'6.0'
16+
'5.1'
17+
'4.0'
18+
'3.0'
19+
'2.0'
20+
)
21+
}
22+
}
23+
ExcludeRules = @('PSAvoidUsingWriteHost')
24+
}

0 commit comments

Comments
 (0)