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

Re: How do I branch in PowerShell? i.e. goto label?

Update your Vista Drivers Update Your Drivers Now!!
Closed Thread
 
Thread Tools Display Modes
Old 01-20-2008   #1 (permalink)
Hal Rottenberg
Guest


 

Re: How do I branch in PowerShell? i.e. goto label?

Bob wrote:
Quote:

> How do I branch in PowerShell? i.e. goto label?
You don't because PowerShell isn't designed to be used that way. I suggest you
read a little bit about different programming paradigms on Wikipedia, there's
some interesting stuff in there. The short version is that PowerShell is an
object-oriented language rather than procedural. Goto is an example of a
statement used in unstructured procedural programming. Some links:

http://en.wikipedia.org/wiki/Procedural_programming
http://en.wikipedia.org/wiki/Object_...ed_programming

If you are having trouble wrapping your head around the concept, let us know
what the problem you are trying to solve is and we can give you some concrete
examples.

For the record, I do NOT have a CS degree.

--

Hal Rottenberg
Blog: http://halr9000.com
Webmaster, Psi (http://psi-im.org)
Co-host, PowerScripting Podcast (http://powerscripting.net)

My System SpecsSystem Spec
Old 01-22-2008   #2 (permalink)
Karl Prosser[MVP]
Guest


 

Re: How do I branch in PowerShell? i.e. goto label?

Powershell does have the ability to break to a label, which if used
carefully is powerful, especially for breaking out of nested loops. and
this is the scenario why C# also still has a goto statement.

Hal Rottenberg wrote:
Quote:

> Bob wrote:
Quote:

>> How do I branch in PowerShell? i.e. goto label?
>
> You don't because PowerShell isn't designed to be used that way. I
> suggest you read a little bit about different programming paradigms on
> Wikipedia, there's some interesting stuff in there. The short version
> is that PowerShell is an object-oriented language rather than
> procedural. Goto is an example of a statement used in unstructured
> procedural programming. Some links:
>
> http://en.wikipedia.org/wiki/Procedural_programming
> http://en.wikipedia.org/wiki/Object_...ed_programming
>
> If you are having trouble wrapping your head around the concept, let us
> know what the problem you are trying to solve is and we can give you
> some concrete examples.
>
> For the record, I do NOT have a CS degree.
>
My System SpecsSystem Spec
Old 02-18-2008   #3 (permalink)
RMSe17
Guest


 

Re: How do I branch in PowerShell? i.e. goto label?

If it has no goto or equivalent instruction, then porting batch
scripts to powershell scripts becomes rather a pain. When I think of
a scripting language, I don't see why there would be no goto
command..
*sigh*

RMSe17

On Jan 22, 3:07 pm, "Karl Prosser[MVP]" <karl@xxxxxx_o_w_e_r_s_h_e_l_l.com>
wrote:
Quote:

> Powershell does have the ability to break to a label, which if used
> carefully is powerful, especially for breaking out of nested loops. and
> this is the scenario why C# also still has a goto statement.
>
> Hal Rottenberg wrote:
Quote:

> > Bob wrote:
Quote:

> >> How do I branch in PowerShell? i.e. goto label?
>
Quote:

> > You don't because PowerShell isn't designed to be used that way. I
> > suggest you read a little bit about different programming paradigms on
> > Wikipedia, there's some interesting stuff in there. The short version
> > is that PowerShell is an object-oriented language rather than
> > procedural. Goto is an example of a statement used in unstructured
> > procedural programming. Some links:
> >
Quote:

> > If you are having trouble wrapping your head around the concept, let us
> > know what the problem you are trying to solve is and we can give you
> > some concrete examples.
>
Quote:

> > For the record, I do NOT have a CS degree.
My System SpecsSystem Spec
Old 02-22-2008   #4 (permalink)
Karl Prosser[MVP]
Guest


 

Re: How do I branch in PowerShell? i.e. goto label?

its not hard to change to doing things structurely. You'll find that
powershells language structure are rich and flexible - compared to those
of batch

goes perl, ruby and python have a goto?
My System SpecsSystem Spec
Old 02-22-2008   #5 (permalink)
Karl Prosser[MVP]
Guest


 

Re: How do I branch in PowerShell? i.e. goto label?

its not hard to change to doing things structurely. You'll find that
powershells language structure are rich and flexible - compared to those
of batch

goes perl, ruby and python have a goto?
My System SpecsSystem Spec
Closed Thread

Thread Tools
Display Modes



Similar Threads
Thread Thread Starter Forum Replies Last Post
Vista IE7 cannot goto Yahoo Billy Ng Vista General 4 07-10-2008 03:01 AM
ClickOnce & branch of versions Joe .NET General 1 03-24-2008 12:44 AM
RE: How do I branch in PowerShell? i.e. goto label? RichS PowerShell 0 01-20-2008 09:42 AM
License label Tony Vista General 1 07-06-2007 12:00 AM
Microsoft and Citrix Expand Partnership to Improve Application Access and Address Branch Office Complexity z3r010 Vista News 0 08-23-2006 07:19 AM


Update your Vista Drivers Update Your Drivers Now!!

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