![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
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 |
| | #2 (permalink) |
| Guest | Re: Using labels in Powershell "Bruno Guerpillon" <toto@toto.fr> wrote in message news:45c8b8c2$0$16176$426a74cc@news.free.fr... > Hi > > Didnt find this anywhere. > What's the equivalent to : > > goto :labelx > command > command > > :labelx I believe labels are only used in conjunction with the loop terminators: break and continue. For example: uter while (1) {while (1) { break outer } # break without label would break to this line } Note that the label in "break <label>" doesn't have to be a literal/constant string. It can be an expression (found this little tidbit in Bruce Payette's book Windows PowerShell in Action) e.g. $target = "outer" uter while (1) {while (1) { break $target } } Your code above looks kind of like batch script. I would probably modify it to use some form of control flow e.g.: if (<some expression>) { # skips this block of commands if <some expression> doesn't evaluate to $true command command } -- Keith |
| | #3 (permalink) |
| Guest | Re: Using labels in Powershell Along with what Keith Said... before Powershell I wrote a good bit of Batch scripts... in Powershell I have yet to find any reason for the Label. Controlling script execution in Powershell is WAY easier than batch (once you get use it to it.) I would recommend biting the bullet and forcing your self to rethink script design. -- Brandon Shell --------------- Stop by my blog some time ![]() http://www.bsonposh.com/ Try the "Search of Powershell Blogs" -------------------------------------- "Bruno Guerpillon" <toto@toto.fr> wrote in message news:45c8b8c2$0$16176$426a74cc@news.free.fr... > Hi > > Didnt find this anywhere. > What's the equivalent to : > > goto :labelx > command > command > > :labelx > > > Regards > > |
| | #4 (permalink) |
| Guest | Re: Using labels in Powershell for exeption handling the labels are handy (and breaking nested loops ) Greetings /\/\o\/\/ "Brandon Shell" <tshell.mask@gmail.com> wrote in message news:ugSIlqhSHHA.5060@TK2MSFTNGP06.phx.gbl... > Along with what Keith Said... before Powershell I wrote a good bit of > Batch scripts... in Powershell I have yet to find any reason for the > Label. Controlling script execution in Powershell is WAY easier than batch > (once you get use it to it.) I would recommend biting the bullet and > forcing your self to rethink script design. > > -- > Brandon Shell > --------------- > Stop by my blog some time ![]() > http://www.bsonposh.com/ > Try the "Search of Powershell Blogs" > -------------------------------------- > > "Bruno Guerpillon" <toto@toto.fr> wrote in message > news:45c8b8c2$0$16176$426a74cc@news.free.fr... >> Hi >> >> Didnt find this anywhere. >> What's the equivalent to : >> >> goto :labelx >> command >> command >> >> :labelx >> >> >> Regards >> >> > |
| | #5 (permalink) |
| Guest | Re: Using labels in Powershell as apposed to try? btw... where is that /\/\o\/\/ guide ![]() -- Brandon Shell --------------- Stop by my blog some time ![]() http://www.bsonposh.com/ Try the "Search of Powershell Blogs" -------------------------------------- "/\/\o\/\/ [MVP]" <mow001@hotmail.NoSpam> wrote in message news:B48812D8-F3E2-44A4-BA4C-69BCD691C3C7@microsoft.com... > for exeption handling the labels are handy (and breaking nested loops ) > > > Greetings /\/\o\/\/ > > "Brandon Shell" <tshell.mask@gmail.com> wrote in message > news:ugSIlqhSHHA.5060@TK2MSFTNGP06.phx.gbl... >> Along with what Keith Said... before Powershell I wrote a good bit of >> Batch scripts... in Powershell I have yet to find any reason for the >> Label. Controlling script execution in Powershell is WAY easier than >> batch (once you get use it to it.) I would recommend biting the bullet >> and forcing your self to rethink script design. >> >> -- >> Brandon Shell >> --------------- >> Stop by my blog some time ![]() >> http://www.bsonposh.com/ >> Try the "Search of Powershell Blogs" >> -------------------------------------- >> >> "Bruno Guerpillon" <toto@toto.fr> wrote in message >> news:45c8b8c2$0$16176$426a74cc@news.free.fr... >>> Hi >>> >>> Didnt find this anywhere. >>> What's the equivalent to : >>> >>> goto :labelx >>> command >>> command >>> >>> :labelx >>> >>> >>> Regards >>> >>> >> > |
| |
| |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| printing labels | Lane | Vista print fax & scan | 6 | 05-13-2008 08:40 AM |
| Labels, Classification | José | Vista General | 0 | 02-05-2008 12:22 PM |
| Labels, classificatie | José | Vista General | 0 | 02-05-2008 09:18 AM |
| printing labels | amanda | Vista print fax & scan | 1 | 01-09-2008 10:10 PM |
| Address Labels | Stuart Brown | Vista mail | 0 | 11-01-2007 05:21 AM |