shell - Import-CSV cmdlet in powershell -


got problem powershell script.

the import-csv cmdlet not working want it...

what want do? - import single names out of 1 column header "name" create paths.

name jack thomas john

this code function:

$users = import-csv -path "$csvpath" -header "name" $path = ("d:\users\" + $users) foreach ($user in $users) {write-host $path}

but output i'm getting "d:\users\"

i'm not pro in coding can't see failure :d

new update:

$users = import-csv -path "$csvpath" -header "name" 

changed :

$users = import-csv -path "$csvpath" 

you can not $path, because $users not string.

$path = ("d:\users\" + $users) 

instead, can this

foreach ($user in $users) {$path = "d:\users\" + $user ; write-host $path} 

but think want this:

foreach ($user in $users) {$path = "d:\users\" + $user.name ; write-host $path} 

==================================================

this works in pc. further information?

screen copy


Comments

Popular posts from this blog

Spring Boot + JPA + Hibernate: Unable to locate persister -

go - Golang: panic: runtime error: invalid memory address or nil pointer dereference using bufio.Scanner -

c - double free or corruption (fasttop) -