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
Actually this presumably counts for any object creation including something like: New-Object System.Drawing.Size(800, 600) --> [System.Drawing.Size]::new(800, 600)
Type of issue
Missing information
Feedback
Even it is implied in the section Avoid wrapping cmdlet pipelines section and covered in the Everything you wanted to know about PSCustomObject / Legacy approach. Creating
PSCustomObject
is a very common use case and the impact of using theNew-Object
cmdlet vs[PSCustomObject]@{ ... }
type initiator is quite severe:New-Object
[PSCustomObject]
I recommend to make a special note in this performance document too.
Page URL
https://learn.microsoft.com/en-us/powershell/scripting/dev-cross-plat/performance/script-authoring-considerations?view=powershell-7.4
Content source URL
https://github.com/MicrosoftDocs/PowerShell-Docs/blob/main/reference/docs-conceptual/dev-cross-plat/performance/script-authoring-considerations.md
Author
@sdwheeler
Document Id
9818d91b-8c5f-337a-f5e1-7a40abd5fd1a
The text was updated successfully, but these errors were encountered: