Windows Vista Forums
Vista Forums Home Join Vista Forums Donate Vista Tutorials Tags

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.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Microsoft Technical Newsgroups > PowerShell

Info: I know I know this... but I can't remember for nothing... Loop Index?

Closed Thread
 
Thread Tools Display Modes
Old 02-07-2007   #1 (permalink)
Brandon Shell
Guest


 

Info: I know I know this... but I can't remember for nothing... Loop Index?

Isn't there a variable that will give you current loop index?

--
Brandon Shell
---------------
Stop by my blog some time
http://www.bsonposh.com/
Try the "Search of Powershell Blogs"
--------------------------------------

Old 02-07-2007   #2 (permalink)
Keith Hill
Guest


 

Re: I know I know this... but I can't remember for nothing... Loop Index?

"Brandon Shell" <tshell.mask@gmail.com> wrote in message
news:uXJCqAtSHHA.4076@TK2MSFTNGP05.phx.gbl...
> Isn't there a variable that will give you current loop index?
>


Perhaps you are thinking of the variable $foreach that let's you access the
enumerator object in a foreach statement. However this doesn't give you
current loop index. It does give you the current value and the ability to
directly call MoveNext(). When switch is looping, I think it has a similar
variable $switch that does the same thing.

--
Keith

Old 02-07-2007   #3 (permalink)
RichS
Guest


 

RE: Info: I know I know this... but I can't remember for nothing... Lo

Are you thinking of

$foreach
Refers to the enumerator in a foreach loop.



--
Richard Siddaway
Please note that all scripts are supplied "as is" and with no warranty
Blog: http://richardsiddaway.spaces.live.com/
PowerShell User Group: http://www.get-psuguk.org.uk


"Brandon Shell" wrote:

> Isn't there a variable that will give you current loop index?
>
> --
> Brandon Shell
> ---------------
> Stop by my blog some time
> http://www.bsonposh.com/
> Try the "Search of Powershell Blogs"
> --------------------------------------
>
>

Old 02-07-2007   #4 (permalink)
Brandon Shell
Guest


 

Re: I know I know this... but I can't remember for nothing... Loop Index?

Thanks Keith/Rich... $foreach was what I was thinking, but I misunderstood
it's use. I was hoping to have a loop count so I could avoid having to
create my own... oh well

--
Brandon Shell
---------------
Stop by my blog some time
http://www.bsonposh.com/
Try the "Search of Powershell Blogs"
--------------------------------------

"Keith Hill" <r_keith_hill@mailhot.nospamIdotcom> wrote in message
news:16FBB6CD-BC2E-4542-BFCF-636F6490B41E@microsoft.com...
> "Brandon Shell" <tshell.mask@gmail.com> wrote in message
> news:uXJCqAtSHHA.4076@TK2MSFTNGP05.phx.gbl...
>> Isn't there a variable that will give you current loop index?
>>

>
> Perhaps you are thinking of the variable $foreach that let's you access
> the enumerator object in a foreach statement. However this doesn't give
> you current loop index. It does give you the current value and the
> ability to directly call MoveNext(). When switch is looping, I think it
> has a similar variable $switch that does the same thing.
>
> --
> Keith


Old 02-07-2007   #5 (permalink)
/\\/\\o\\/\\/ [MVP]
Guest


 

Re: I know I know this... but I can't remember for nothing... Loop Index?

$foreach ;-)
(in foreach statement not foreach-object iirc)

greetings /\/\o\/\/

"Brandon Shell" <tshell.mask@gmail.com> wrote in message
news:uXJCqAtSHHA.4076@TK2MSFTNGP05.phx.gbl...
> Isn't there a variable that will give you current loop index?
>
> --
> Brandon Shell
> ---------------
> Stop by my blog some time http://www.bsonposh.com/
> Try the "Search of Powershell
> Blogs" --------------------------------------
>


Closed Thread

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Vista doesn't remember install info Markj Vista General 2 06-27-2008 01:43 PM
Live Messenger doesn't remember my sign in info after restart. TheGregDude Live Messenger 9 04-22-2008 06:21 PM
How do I change the administrator info and the registration info?? Heather Vista account administration 3 05-31-2007 11:01 AM
MAP network drive does not remember logon info David Hettel Vista networking & sharing 0 12-23-2006 05:43 AM
i remember win95 olli Vista hardware & devices 2 06-11-2006 02:03 PM








Vistax64.com is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media 2005-2008

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50