Skip to content

Commit e65e764

Browse files
committed
Release 1.290.2025
1 parent deb963e commit e65e764

File tree

8 files changed

+453
-178
lines changed

8 files changed

+453
-178
lines changed

.github/workflows/test.yml

Lines changed: 329 additions & 169 deletions
Large diffs are not rendered by default.

Functions/GenXdev.Coding.PowerShell.Modules/Assert-GenXdevTest.ps1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,7 @@ function Assert-GenXdevTest {
364364
# skip internal cmdlets that start with underscore
365365

366366
if ($nextCmdlet.Name -like "_*") { continue }
367+
if ($nextCmdlet.ScriptFilePath.EndsWith(".cs")) { continue }
367368

368369
Microsoft.PowerShell.Utility\Write-Progress `
369370
-Activity "Analyzing $($nextCmdlet.Name)" `

Functions/GenXdev.Coding.PowerShell.Modules/Invoke-GenXdevScriptAnalyzer.ps1

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@ function Invoke-GenXdevScriptAnalyzer {
7878
ParameterSetName = 'Path',
7979
HelpMessage = 'Specifies the path to the script file.'
8080
)]
81-
[string] $Path,
81+
[Alias('Path', 'FullName')]
82+
[string] $ScriptFilePath,
8283
#
8384
[Parameter(
8485
Mandatory = $true,
@@ -160,7 +161,7 @@ function Invoke-GenXdevScriptAnalyzer {
160161

161162
# configure parameters for path-based analysis
162163
$invocationParams = @{
163-
Path = $Path
164+
Path = $ScriptFilePath
164165
IncludeRule = $settings.IncludeRules
165166
ExcludeRule = $settings.ExcludeRules
166167
CustomRulePath = $settings.CustomRulePath
@@ -175,7 +176,7 @@ function Invoke-GenXdevScriptAnalyzer {
175176

176177
# output verbose information about path analysis
177178
Microsoft.PowerShell.Utility\Write-Verbose `
178-
"Analyzing script file: $Path"
179+
"Analyzing script file: $ScriptFilePath"
179180
}
180181
else {
181182

@@ -251,8 +252,8 @@ function Invoke-GenXdevScriptAnalyzer {
251252
# create error output for general exceptions
252253
$errorResult = @{
253254
Message = $_.Exception.Message
254-
RuleName = ($null -eq $Path ? '?' : `
255-
[System.IO.Path]::GetFileNameWithoutExtension($Path)) + `
255+
RuleName = ($null -eq $ScriptFilePath ? '?' : `
256+
[System.IO.Path]::GetFileNameWithoutExtension($ScriptFilePath)) + `
256257
' @ Invocation in Invoke-GenXdevScriptAnalyzer'
257258
Description = 'An error occurred while invoking the Script Analyzer.'
258259
}

Functions/GenXdev.Coding.PowerShell.Modules/PSScriptAnalyzerSettings.psd1

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,5 +84,122 @@
8484
PSUseFullyQualifiedCmdletNames = @{
8585
Enabled = $true
8686
}
87+
PSAvoidDefaultValueSwitchParameter = @{
88+
Enabled = $true
89+
}
90+
PSAvoidUsingCmdletAliases = @{
91+
Enabled = $true
92+
}
93+
PSAvoidAssignmentToAutomaticVariable = @{
94+
Enabled = $true
95+
}
96+
PSAvoidDefaultValueForMandatoryParameter = @{
97+
Enabled = $true
98+
}
99+
PSAvoidExclaimOperator = @{
100+
Enabled = $true
101+
}
102+
PSAvoidGlobalAliases = @{
103+
Enabled = $true
104+
}
105+
PSAvoidGlobalFunctions = @{
106+
Enabled = $true
107+
}
108+
PSAvoidGlobalVars = @{
109+
Enabled = $true
110+
}
111+
PSAvoidLongLines = @{
112+
Enabled = $true
113+
}
114+
PSAvoidNullOrEmptyHelpMessageAttribute = @{
115+
Enabled = $true
116+
}
117+
PSAvoidOverwritingBuiltInCmdlets = @{
118+
Enabled = $true
119+
}
120+
PSReservedCmdletChar = @{
121+
Enabled = $true
122+
}
123+
PSReservedParams = @{
124+
Enabled = $true
125+
}
126+
PSAvoidSemicolonsAsLineTerminators = @{
127+
Enabled = $true
128+
}
129+
PSAvoidShouldContinueWithoutForce = @{
130+
Enabled = $true
131+
}
132+
PSAvoidTrailingWhitespace = @{
133+
Enabled = $true
134+
}
135+
PSAvoidUsingDeprecatedManifestFields = @{
136+
Enabled = $true
137+
}
138+
PSAvoidUsingDoubleQuotesForConstantString = @{
139+
Enabled = $true
140+
}
141+
PSMisleadingBacktick = @{
142+
Enabled = $true
143+
}
144+
PSMissingModuleManifestField = @{
145+
Enabled = $true
146+
}
147+
PSPlaceOpenBrace = @{
148+
Enabled = $true
149+
}
150+
PSPossibleIncorrectComparisonWithNull = @{
151+
Enabled = $true
152+
}
153+
PSPossibleIncorrectUsageOfAssignmentOperator = @{
154+
Enabled = $true
155+
}
156+
PSPossibleIncorrectUsageOfRedirectionOperator = @{
157+
Enabled = $true
158+
}
159+
PSUseApprovedVerbs = @{
160+
Enabled = $true
161+
}
162+
PSUseCmdletCorrectly = @{
163+
Enabled = $true
164+
}
165+
PSUseCompatibleCmdlets = @{
166+
Enabled = $true
167+
}
168+
PSUseConsistentIndentation = @{
169+
Enabled = $true
170+
}
171+
PSUseConsistentWhitespace = @{
172+
Enabled = $true
173+
}
174+
PSUseDeclaredVarsMoreThanAssignments = @{
175+
Enabled = $true
176+
}
177+
PSUseLiteralInitializerForHashtable = @{
178+
Enabled = $true
179+
}
180+
PSUseOutputTypeCorrectly = @{
181+
Enabled = $true
182+
}
183+
PSUseProcessBlockForPipelineCommand = @{
184+
Enabled = $true
185+
}
186+
PSShouldProcess = @{
187+
Enabled = $true
188+
}
189+
PSUseShouldProcessForStateChangingFunctions = @{
190+
Enabled = $true
191+
}
192+
PSUseSingularNouns = @{
193+
Enabled = $true
194+
}
195+
PSUseSupportsShouldProcess = @{
196+
Enabled = $true
197+
}
198+
PSUseToExportFieldsInManifest = @{
199+
Enabled = $true
200+
}
201+
PSUseUsingScopeModifierInNewRunspaces = @{
202+
Enabled = $true
203+
}
87204
}
88205
}

Functions/GenXdev.Coding.PowerShell.Modules/SplitUpPsm1File.ps1

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,6 @@ if (-not `$IsWindows) {
170170
171171
`$osVersion = [System.Environment]::OSVersion.Version
172172
`$major = `$osVersion.Major
173-
`$build = `$osVersion.Build
174173
175174
if (`$major -ne 10) {
176175
throw "This module only supports Windows 10+ x64 with PowerShell 7.5+ x64"

GenXdev.Coding.Git.psm1

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ if (-not $IsWindows) {
44

55
$osVersion = [System.Environment]::OSVersion.Version
66
$major = $osVersion.Major
7-
$build = $osVersion.Build
87

98
if ($major -ne 10) {
109
throw "This module only supports Windows 10+ x64 with PowerShell 7.5+ x64"

GenXdev.Coding.PowerShell.Modules.psm1

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ if (-not $IsWindows) {
44

55
$osVersion = [System.Environment]::OSVersion.Version
66
$major = $osVersion.Major
7-
$build = $osVersion.Build
87

98
if ($major -ne 10) {
109
throw "This module only supports Windows 10+ x64 with PowerShell 7.5+ x64"

GenXdev.Coding.psm1

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ if (-not $IsWindows) {
44

55
$osVersion = [System.Environment]::OSVersion.Version
66
$major = $osVersion.Major
7-
$build = $osVersion.Build
87

98
if ($major -ne 10) {
109
throw "This module only supports Windows 10+ x64 with PowerShell 7.5+ x64"

0 commit comments

Comments
 (0)