Skip to content

about_Object_Creation lacks a description of the static ::new() method exposed on types #3209

Closed

Description

Since v5, the static ::new() method has been available on types, as a way to call a given type's constructors - as an alternative to the New-Object cmdlet; e.g.

# Equivalent to: 
#    New-Object regex -Args .*, SingleLine
PS> [regex]::new('.*', 'SingleLine')

On a side note: the two commands are currently not fully equivalent, but that's an issue that must be resolved separately - see PowerShell/PowerShell#5579.

A description of the ::new() method is currently absent from topic about-Object_Creation.

Version(s) of document impacted

  • Impacts 6.next document
  • Impacts 6 document
  • Impacts 5.1 document
  • Impacts 5.0 document
  • Impacts 4.0 document
  • Impacts 3.0 document

Reason(s) for not selecting all version of documents

  • The documented feature was introduced in selected version of PowerShell
  • This issue only shows up in selected version of the document

Activity

  1. added
    area-core
    area-engine
    and removed
    area-core
    on Oct 30, 2018
  2. added a commit that references this issue on Jun 3, 2019
    deb0d4b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

area-engine

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions