Skip to content

Rule request: AvoidNewObjectCmdlet #2046

Open
@iRon7

Description

@iRon7

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions