Author Posts

May 3, 2017 at 11:44 am

$Status=invoke-command -ComputerName "MasterSErver.com" {bpimagelist -U -client ClientSErver.com -hoursago 1 }

$Status gives me the below output, however couldn't filter it as Policy and Sched Type

Backed Up Expires Files KB C Sched Type On Hold Policy
—————- ———- ——– ——– – ————— ——- ————
05/03/2017 01:00 07/04/2017 13158 4567 N Differential In 0 INT_DFS

Some one please help!

May 3, 2017 at 11:59 am

Use ConvertFrom-Csv with appropriate parameters

(-Delimiter, may be -Header if you want skip first two lines)

May 4, 2017 at 2:48 pm

What do you mean by filtering in this case?

Just to output those two values or sorting or?
What have you tried so far?

Also what you can do and how you need to solve it may also depend on the datatype of status.
So if you do:

$Status.gettype()

I would guess that bpimagelist is command line program and not a powershell command?
In that case $status is most likely just a string and not an array or hashtable.
So you would need to process the string to get the information the way you want it and so forth.

/Fredrik