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 - test-path -IsValid ?

Reply
 
Old 04-03-2008   #1 (permalink)
Ray


 
 

test-path -IsValid ?

Hi,

I have been playing with Powershell and I like it very much.
I have a question about the "IsValid" switch of the "test-path" cmdlet.

test-path $PROFILE -IsValid

According to the help-file it should help determine whether the syntax of a
path is correct, but I wonder if it functions correctly. As far as I can see
this switch ALWAYS results in a "true", regardless whether I provide the
cmdlet with an actual path.

PS> test-path "This is a test." -IsValid
True

Perhaps this is a bug?

friendly regards,

Raymond,
Dutch PS user



My System SpecsSystem Spec
Old 04-03-2008   #2 (permalink)
Shay Levi


 
 

Re: test-path -IsValid ?



Check this:

Test-Path isValid parameter
http://scriptolog.blogspot.com/2007/...haracters.html


-----
Shay Levi
$cript Fanatic
http://scriptolog.blogspot.com
Quote:

> Hi,
>
> I have been playing with Powershell and I like it very much. I have a
> question about the "IsValid" switch of the "test-path" cmdlet.
>
> test-path $PROFILE -IsValid
>
> According to the help-file it should help determine whether the syntax
> of a path is correct, but I wonder if it functions correctly. As far
> as I can see this switch ALWAYS results in a "true", regardless
> whether I provide the cmdlet with an actual path.
>
PS>> test-path "This is a test." -IsValid
PS>>
Quote:

> True
>
> Perhaps this is a bug?
>
> friendly regards,
>
> Raymond,
> Dutch PS user

My System SpecsSystem Spec
Old 04-03-2008   #3 (permalink)
Ray


 
 

Re: test-path -IsValid ?

My bad.
Thanks for listening!

My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
test for executable on path PowerShell
Test-Path '' -IsValid does not return False but fails. Is this OK? PowerShell
Test-Path isValid parameter PowerShell
how to test for a program in my path? PowerShell
BUG? (Test-Path $path -IsValid) and empty $path 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