pscustomobject help

  • Hi gang,

    I have an array, $Data, having a bunch of elements, $Datum, each of which contains something like this:

    @{Date =30-Nov-12; Billing

    Week=1; Billing

    Month=DECEMBER; Q=Q1; Weekday=Friday; Calendar

    Month=November; Day=30; Year=2012; Time Due=8:00 AM)

    So for each $Datum, how can access the value, that's on the other side of "Date = " for example?

    P

  • If I understand correctly you have an array of hashes something like this.$x = @{Date ='30-Nov-12';

    BillingWeek='1';

    BillingMonth='DECEMBER';

    Q='Q1';

    Weekday='Friday';

    CalendarMonth='November';

    Day='30';

    Year='2012';

    TimeDue='8:00 AM'

    }

    $y = @{Date ='29-Oct-13';

    BillingWeek='2';

    BillingMonth='November';

    Q='Q2';

    Weekday='Thursday';

    CalendarMonth='October';

    Day='29';

    Year='2013';

    TimeDue='9:00 AM'

    }

    $data = @($x, $y)

    If so here’s one way to pick out individual values.

    $data[0].Date # 30-Nov-12

    $data[1].Date # 29-Oct-13

    $data[0].Weekday # Friday

  • Yup, got it. Was not getting any values for Date because column name had a trailing space.

    Thanks Bruce.

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply