none
Why I get this output? RRS feed

  • Question

  • Hi 

    I am running this script:

    $users = Import-Csv D:\users.csv
    Foreach ($user in $users){
    $givenname = ($user -split " ")[0]
    $surname = ($user -split " ")[1]
    Write-Host $givenname
    Write-Host $surname
    }

    I am getting this output!

    @{Name=Jordan
    Tucker}
    @{Name=Simone
    Roache}
    @{Name=Stefanie
    Willmot}
    @{Name=Angie
    Tomassini}
    @{Name=Michelle
    Christiansen}
    @{Name=David
    Piggot}
    @{Name=Madeline
    Turnbull}
    @{Name=Shitaab
    Ali}
    @{Name=Elizabeth
    Vasilopoulous}
    @{Name=Anthony
    Milic}
    @{Name=Delwyn
    Connell}
    @{Name=Dylan
    Lara}
    @{Name=Mary
    Piteo}
    @{Name=Margaret
    Lazaros}
    @{Name=Regina
    Brooks}
    @{Name=David
    Barry}
    @{Name=Laura
    Brincat}
    @{Name=Becky
    Hancock}
    @{Name=Jedrek
    Afele}
    @{Name=Jake
    Couchman}
    @{Name=Amataga
    Iu}
    @{Name=Amelia
    Baillie}
    @{Name=Moi
    Kaufononga}
    @{Name=Andalib
    Alam}

    Any Idea why?

    Wednesday, October 4, 2017 3:02 AM

Answers

All replies