You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You might also consider to link this type of rules to the #Requires -Version x.x statement.
(In case it doesn't exist in the concerned script: simply suppress the warning.)
The
New-Object
cmdlet is basically* legacy.Since PowerShell V3.0 (12 years ago), PowerShell supports type accelerators which perform much better, see: PowerShell scripting performance considerations / object creation.
*) Exceptions left there (e.g. with the use of the
[-ComObject] <String>
parameter)Therefore I think that it makes sense to have a
AvoidNewObjectCmdlet
rule.related: Avoid New-Object Hashtable
#60
The text was updated successfully, but these errors were encountered: