forked from BornToBeRoot/PowerShell
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNew-Object.ps1
More file actions
20 lines (16 loc) · 706 Bytes
/
New-Object.ps1
File metadata and controls
20 lines (16 loc) · 706 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# Create a new object
$Result = New-Object -TypeName PSObject
Add-Member -InputObject $Result -MemberType NoteProperty -Name Parameter1 -Value Result1
Add-Member -InputObject $Result -MemberType NoteProperty -Name Parameter2 -Value Result2
return $Result
###################################################################################################
# Create a new object
$Results = @()
foreach($Line in $Lines)
{
$Result = New-Object -TypeName PSObject
Add-Member -InputObject $Result -MemberType NoteProperty -Name Parameter1 -Value $Line.Result1
Add-Member -InputObject $Result -MemberType NoteProperty -Name Parameter2 -Value $Line.Result2
$Results += $Result
}
return $Results