Skip to content

Commit 51ab704

Browse files
committed
feat: PSAvoidUsingNewObject
1 parent ea70855 commit 51ab704

File tree

8 files changed

+596
-6
lines changed

8 files changed

+596
-6
lines changed

Engine/Commands/InvokeScriptAnalyzerCommand.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -340,11 +340,11 @@ protected override void BeginProcessing()
340340
settingsObj?.CustomRulePath?.ToArray(),
341341
this.SessionState,
342342
combRecurseCustomRulePath);
343-
combRulePaths = rulePaths == null
344-
? settingsCustomRulePath
345-
: settingsCustomRulePath == null
346-
? rulePaths
347-
: rulePaths.Concat(settingsCustomRulePath).ToArray();
343+
combRulePaths = rulePaths == null
344+
? settingsCustomRulePath
345+
: settingsCustomRulePath == null
346+
? rulePaths
347+
: rulePaths.Concat(settingsCustomRulePath).ToArray();
348348
}
349349
catch (Exception exception)
350350
{

Engine/Settings/PSGallery.psd1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
'PSAvoidGlobalVars',
1717
'PSUseDeclaredVarsMoreThanAssignments',
1818
'PSAvoidUsingInvokeExpression',
19+
'PSAvoidUsingNewObject',
1920
'PSAvoidUsingPlainTextForPassword',
2021
'PSAvoidUsingComputerNameHardcoded',
2122
'PSUsePSCredentialType',

Engine/Settings/ScriptFunctions.psd1

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,6 @@
77
'PSAvoidUsingPositionalParameters',
88
'PSAvoidGlobalVars',
99
'PSUseDeclaredVarsMoreThanAssignments',
10-
'PSAvoidUsingInvokeExpression')
10+
'PSAvoidUsingInvokeExpression',
11+
'PSAvoidUsingNewObject')
1112
}

0 commit comments

Comments
 (0)