Syphirint
Syphirint

Reputation: 1131

Object manipulation in PowerShell

Is there a way to manipulate the content of the Object so that the output shows the applications present on DESKTOP A?

$DB_struct = Import-Csv -Path $path
$DB_struct =

bundle              app
DESKTOP A            A
DESKTOP A            B
DESKTOP A            C
DESKTOP A            D
DESKTOP B            E
DESKTOP B            F
DESKTOP B            G
DESKTOP B            H
DESKTOP C            I
DESKTOP C            J
DESKTOP C            K
DESKTOP C            L

EDIT: Changed Export-Csv to Import-Csv.

Upvotes: 0

Views: 78

Answers (1)

Bacon Bits
Bacon Bits

Reputation: 32220

I'm assuming you mean Import-Csv and not Export-Csv.

$DB_struct | Where-Object { $_.bundle -eq 'DESKTOP A' } | Select-Object -Property app

Although, depending on what you're doing, you might need:

$DB_struct | Where-Object { $_.bundle -eq 'DESKTOP A' } | Select-Object -ExpandProperty app

Upvotes: 1

Related Questions