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

PowerShell RC2 - Doc Bug in Getting Started?

Update your Vista Drivers Update Your Drivers Now!!
Closed Thread
 
Thread Tools Display Modes
Old 10-11-2006   #1 (permalink)
Andrew Watt [MVP]
Guest


 

PowerShell RC2 - Doc Bug in Getting Started?

On page 32 of the Getting Started document that comes with RC2 the
fourth piece of code on the page seems not to relate to its preceding
text.

Doc bug?

Andrew Watt MVP

My System SpecsSystem Spec
Old 10-12-2006   #2 (permalink)
Krishna Vutukuri[MSFT]
Guest


 

Re: PowerShell RC2 - Doc Bug in Getting Started?

Thanks Andrew for the information. Can you open bugs for all of these on
Connect?

Thanks
Krishna[MSFT]
Windows PowerShell Development
Microsoft Corporation
This posting is provided "AS IS" with no warranties, and confers no rights.


"Andrew Watt [MVP]" <SVGDeveloper@aol.com> wrote in message
news:9gnqi2p9pafsm5endqpb3js9vufrv87558@4ax.com...
> On page 32 of the Getting Started document that comes with RC2 the
> fourth piece of code on the page seems not to relate to its preceding
> text.
>
> Doc bug?
>
> Andrew Watt MVP



My System SpecsSystem Spec
Old 10-12-2006   #3 (permalink)
Maximilian Hänel
Guest


 

Re: PowerShell RC2 - Doc Bug in Getting Started?

Hi Andrew,

Can you confirm this (qualdfold.rtf)?

----------------------------
Boolean Values and Operators
----------------------------
TRUE: Any number !=0

But:
PS C:\> -1 -eq $true
False

So it should read "Any number > 0" or there's a bug in PS

---
FALSE: Any number = 0

How many numbers equal 0? ;-)

-------------------
Foreach (Scripting)
-------------------
Expression | foreach {BEGIN{} PROCESS{} END{}}

But this doesn't work:
ls | foreach {BEGIN{} PROCESS{} END{}}

It terminates with an error, but why?

Sorry, but I don't have a Connect Account.

cu

Max
My System SpecsSystem Spec
Old 10-12-2006   #4 (permalink)
dreeschkind
Guest


 

Re: PowerShell RC2 - Doc Bug in Getting Started?

"Maximilian Hänel" wrote:

> -------------------
> Foreach (Scripting)
> -------------------
> Expression | foreach {BEGIN{} PROCESS{} END{}}
>
> But this doesn't work:
> ls | foreach {BEGIN{} PROCESS{} END{}}
>
> It terminates with an error, but why?


The correct syntax is:

ls | foreach -begin {} -process {} -end {} # using ForEach-Object cmdlet
ls | &{BEGIN {} PROCESS {} END {}} # processing in new scope
ls | .{BEGIN {} PROCESS {} END {}} # processing in current scope

The first one should be slowest, the last one should be fastest.

--
greetings
dreeschkind
My System SpecsSystem Spec
Old 10-12-2006   #5 (permalink)
Maximilian Hänel
Guest


 

Re: PowerShell RC2 - Doc Bug in Getting Started?

Hi dreeschkind,

> The correct syntax is:
>
> ls | foreach -begin {} -process {} -end {} # using ForEach-Object cmdlet
> ls | &{BEGIN {} PROCESS {} END {}} # processing in new scope
> ls | .{BEGIN {} PROCESS {} END {}} # processing in current scope
>
> The first one should be slowest, the last one should be fastest.


Thanks!

Max
My System SpecsSystem Spec
Closed Thread

Thread Tools
Display Modes



Similar Threads
Thread Thread Starter Forum Replies Last Post
Getting Started WindyGeorge Vista mail 3 05-22-2008 07:53 PM
Getting Started Susan Haggerty Vista mail 2 01-11-2008 02:40 PM
Powershell does not terminate when started VBSCRIPT ktmd PowerShell 1 05-14-2007 03:35 PM
Can not break ping -t when PowerShell started with runas RikardN PowerShell 4 07-05-2006 11:04 AM
How to get started? Martin W. Vista installation & setup 0 06-11-2006 08:28 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