Filtering the output

Welcome Forums General PowerShell Q&A Filtering the output

This topic contains 2 replies, has 3 voices, and was last updated by

 
Participant
1 year, 6 months ago.

  • Author
    Posts
  • #70002
    Ram

    Participant
    Points: 0
    Rank: Member

    $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!

  • #70011

    Participant
    Points: 0
    Rank: Member

    Use ConvertFrom-Csv with appropriate parameters

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

  • #70014

    Participant
    Points: 151
    Helping Hand
    Rank: Participant

    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

The topic ‘Filtering the output’ is closed to new replies.