Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources: Active Threads
Viewing all articles
Browse latest Browse all 8411

Is Test-path " " feature or a bug?

$
0
0

Hi,

I cannot figure out why does the Test-path " " evaluate to true. What special case does the space represent? 

That path is valid and exists. In fact it is a Container (Test-Path " " -PathType Container -> true, but Test-Path ' ' -pathtype Leaf -> false)

Looking at source of the command it looks like it does:

(New-Object system.Management.Automation.SessionState).InvokeProvider.Item.Exists(" ")

also returns True.

But I cannot derive it further.

Can someone guide me further?


Viewing all articles
Browse latest Browse all 8411

Trending Articles