![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
br> br> |
| |||||||
![]() |
| | Thread Tools | Display Modes |
| | #1 (permalink) |
| Guest | variables problems Hi, i've got a problem with some variable parameters in a function : function FindUser($parametres,$UserLastName,$UserFirstName) { "------------------" $parametres $UserFirstName $UserLastName Write-Host " -- " $UserLastName } if i call : FindUser($args[0],$args[1],$args[2]) , i will obtain the following reult : 3 arguments ------------------ t nicolas chaussard -- so the write-host doesn't return anything... why ?? bye Nico |
My System Specs![]() |
| | #2 (permalink) |
| Guest | Re: variables problems On 3 mai, 11:10, Nicopilami <n.chauss...@gmail.com> wrote: > Hi, i've got a problem with some variable parameters in a function : > > function FindUser($parametres,$UserLastName,$UserFirstName) > { > "------------------" > $parametres > $UserFirstName > $UserLastName > > Write-Host " -- " $UserLastName > > } > > if i call : FindUser($args[0],$args[1],$args[2]) > > , i will obtain the following reult : > > 3 arguments > ------------------ > t > nicolas > chaussard > -- > > so the write-host doesn't return anything... why ?? > > bye > Nico i've found the answer on the internet : the call procedure of a function is not FindUser($args[0],$args[1], $args[2]) but FindUser $args[0] $args[1] $args[2] this works fine Thanks Nico |
My System Specs![]() |
| | #3 (permalink) |
| Guest | Re: variables problems "Nicopilami" <n.chaussard@gmail.com> wrote in message news:1178184051.293535.195450@n76g2000hsh.googlegroups.com... > On 3 mai, 11:10, Nicopilami <n.chauss...@gmail.com> wrote: > i've found the answer on the internet : > the call procedure of a function is not FindUser($args[0],$args[1], > $args[2]) but FindUser $args[0] $args[1] $args[2] > this works fine Calling PowerShell functions using a parens enclosed comma separated parameter list (as opposed to just spaces) is near the top of my PowerShell gotchas list. :-) -- Keith |
My System Specs![]() |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Vista environement variables and registry - problems | wojtek.ch | Vista General | 0 | 01-12-2008 05:49 AM |
| $Variables | Guy Thomas | PowerShell | 5 | 06-01-2007 05:05 AM |
| not using variables | IT Staff | PowerShell | 1 | 01-09-2007 09:50 PM |
| Sundeep Raina(Iopsis): Is variables being handled in Workflow and How to declare New Variables | sunny | Avalon | 0 | 06-30-2006 01:31 AM |