Windows Vista Forums

variable probleme
  1. #1


    steph Guest

    variable probleme

    Hi

    I would like to do this :

    $list="get-command","get-service"
    foreach ($l in $list)
    {
    echo $l
    foreach($i in $l)
    {
    $a=$i.name
    echo $a
    }
    }
    The probleme is :
    The variable in the second foreach ($ l) appears to be seen as a string and
    not a command.do anyone have an idea ?
    Thanks



      My System SpecsSystem Spec

  2. #2


    Vadims Podans Guest

    Re: variable probleme

    your $list contains strings, not commands. What you want to get?

    "steph" <steph@xxxxxx> rakstīja ziņojumā
    "news:1C916815-6FC5-4B0F-A39C-24CA307A0BE8@xxxxxx"...

    > Hi
    >
    > I would like to do this :
    >
    > $list="get-command","get-service"
    > foreach ($l in $list)
    > {
    > echo $l
    > foreach($i in $l)
    > {
    > $a=$i.name
    > echo $a
    > }
    > }
    > The probleme is :
    > The variable in the second foreach ($ l) appears to be seen as a string
    > and
    > not a command.do anyone have an idea ?
    > Thanks

      My System SpecsSystem Spec

variable probleme problems?

Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: problme Luc Vista mail 0 18 Jul 2009
Re: probleme Rainald Taesler Vista mail 0 25 Jun 2009
probleme zafirou1 Vista General 1 10 Apr 2008
Probleme claudia Vista mail 2 30 Oct 2007
How can I ensure that a variable is a built-in powershell variable? Sung M Kim PowerShell 7 22 Sep 2006