Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
72 lines (50 loc) · 1.06 KB

File metadata and controls

72 lines (50 loc) · 1.06 KB
Copy raw file
Download raw file
Outline
Edit and raw actions

New-PSObject

SYNOPSIS

Helper function to create PSCustomObjects based on array of names and array of properties.

Script file

Utils\New-PSObject.ps1

SYNTAX

New-PSObject [-PropertyNames] <Array> [-Values] <Object>

DESCRIPTION

Enables rapid creation of PSCustomObjects

EXAMPLES

-------------------------- EXAMPLE 1 --------------------------

$props= echo City Country CurrencySymbol


$result = & {
    new-psobject $props Berlin Germany EUR
    new-psobject $props Zurich Switzerland CHF
}
$result

PARAMETERS

-PropertyNames

An array of property names

Type: Array
Parameter Sets: (All)
Aliases: 

Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Values

The values to be assigned to the properties in the same order as the property names

Type: Object
Parameter Sets: (All)
Aliases: 

Required: True
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

INPUTS

OUTPUTS

NOTES

RELATED LINKS

Morty Proxy This is a proxified and sanitized view of the page, visit original site.