Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > PowerShell

Vista - $error weird behaviour in RC2 ?

Reply
 
Old 10-21-2006   #1 (permalink)
ClaudioG64


 
 

$error weird behaviour in RC2 ?

Hello,
while "poking around" with RC2, I found a strange behaviour (bug ?)
with $error, but it might be somewhere else.

Steps to reproduce (at least on my machine ;-)):

- Launch PS
- $error
(obviously it's empty)
- run a get-help command such as
"help gps" or "get-help get-process -full"
- $error

It prints many rows of:
"Cannot convert value "named" to type "System.Int32". Error: "Input
string was not in a correct format."
At line:1 char:64"

What's wrong ? Can anyone confirm the same behaviour ?

Thanks

Ciao!
Claudio


My System SpecsSystem Spec
Old 10-21-2006   #2 (permalink)
dreeschkind


 
 

RE: $error weird behaviour in RC2 ?

I can confirm what you are seeing on my system.
It seems that all these errors come from the section MamlParameterControl in
C:\WINDOWS\system32\WindowsPowerShell\v1.0\help.format.ps1xml.

The error seems to be that $_.position in the script contains the string
"named" instead of a valid integer.

+ (($_.position -ne $()) -and ($_.position -ne "") -and ([int]$_.p <<<<
osition -ne $()))

This would give the same error message:

PS> [int]"named"
Cannot convert value "named" to type "System.Int32".

I think it's a bug and not a feature.

--
greetings
dreeschkind

"ClaudioG64" wrote:

> Hello,
> while "poking around" with RC2, I found a strange behaviour (bug ?)
> with $error, but it might be somewhere else.
>
> Steps to reproduce (at least on my machine ;-)):
>
> - Launch PS
> - $error
> (obviously it's empty)
> - run a get-help command such as
> "help gps" or "get-help get-process -full"
> - $error
>
> It prints many rows of:
> "Cannot convert value "named" to type "System.Int32". Error: "Input
> string was not in a correct format."
> At line:1 char:64"
>
> What's wrong ? Can anyone confirm the same behaviour ?
>
> Thanks
>
> Ciao!
> Claudio
>
>

My System SpecsSystem Spec
Old 10-21-2006   #3 (permalink)
ClaudioG64


 
 

Re: $error weird behaviour in RC2 ?

dreeschkind ha scritto:


>
> I think it's a bug and not a feature.
>


:-D
Just in case ... I filed a "bug" for this feature ;-)

Claudio

My System SpecsSystem Spec
Old 10-21-2006   #4 (permalink)
klumsy@xtra.co.nz


 
 

Re: $error weird behaviour in RC2 ?

thats so interest dreeschkind
for i want replicating that same line from the XML in my code to render
maml help to html and say that the [int] cast gave me that named error,
so i had to adapt mine, i was wondering why theirs didn't bomb, but
they must have a trap, but are logging the error, but not surfacing
errors that happenin the formatting xml.

My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Windows mail - weird behaviour with error message Vista file management
Security Center weird behaviour Vista security
Vista - weird DNS behaviour Vista networking & sharing
Weird Visa behaviour Vista General
Hashtable with array as a key .... weird behaviour PowerShell


Vista Forums 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 Ltd

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