I believe it to be a bug also. This does repro on what should be the RTM for
Win7
A little more insight look at the helpfile for both Get-Location/Set-Location
Look at the type and members returned from each i.e.
(Get-Location).gettype()
Get-Location | Get-Member
You've learned a-lot but to go beyond where you are these need to be part of
your toolset.
As with most Get/Set properties in any language Set returns nada.
If it weren't for the fact that this caused an out right error I'd think
this to be a low Severity/Priority bug
get-location; get-childitem | fl
I still think this to be a low priority bug; but a bug is a bug.
Like Tojo2000 I never use semi-colons unless I need to which is close to
never.
"Larry__Weiss" wrote:
> Also contrast
>
> PS C:> get-location; get-childitem
> PS C:> get-location; get-childitem | more
>
> I'm starting to be convinced this indicates a bug.
>
> Can anyone reproduce it using PS V2 RTM ?
>
> - Larry
>
>
> Larry__Weiss wrote:
> > I've narrowed it down to the difference in these two sequences
> > PS C:> set-location; get-childitem
> > PS C:> get-location; get-childitem
> > Why would get-childitem return different results depending of whether
> > the last command on the line was set-location or get-location ?
> > The
> > PS C:> get-location; get-childitem
> > case is the one I don't understand.
> > I'm using V2 CTP3 and XP.
> >
> > Larry__Weiss wrote:
> >> The use of the semicolon in PowerShell is described as a statement
> >> separator, and it certainly can be demonstrated that it is exactly
> >> that when more than one command exists on a line. For example,
> >> echo "aaa"; echo "bbb"; echo "ccc"
> >> Is there more to tell?
> >> I'm still puzzled over the difference in these two constructions, the
> >> first as two lines, and then the same commands separated by a
> >> semicolon in one line.
> >> pwd;
> >> dir | Select-Object @{e={"$_"}} | fw -c 8
> >> pwd; dir | Select-Object @{e={"$_"}} | fw -c 8
> >> It seems that the semicolon is allowing some a pipeline to affect the
> >> Select-Object cmdlet when it is on the same line, but does not have
> >> that effect on a separate line.
> >> I'm used to thinking of command separators as lexical only ideas, but
> >> there's something else going on here.
> >> >