Windows Vista Forums
Vista Forums Home Join Vista Forums Webcasts Windows 7 Forum 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

pspath not neccisarly unique

Update your Vista Drivers Update Your Drivers Now!!
Closed Thread
 
Thread Tools Display Modes
Old 10-08-2006   #1 (permalink)
klumsy@xtra.co.nz
Guest


 

pspath not neccisarly unique

i would presume for a different location that pspath would be different
(i.e unique).. basically i am making a tree of providers and their
children and was using the pspath as the unique key, it works with all
providers other than the cert one..

both of these return the same pspaths..

dir cert:\CurrentUser |Select-Object pspath
dir cert:\LocalMachine | select-Object pspath

is this by design (then its also by design that we can't assume the
uniqueness of the pspath), or an oversight?

i understand probably the flexibility you'd want with get-childitem,
i.e virtual directories, unique sort of behaviours etc,different views
of the same underlying data so its probably by design.


Karl


My System SpecsSystem Spec
Old 10-09-2006   #2 (permalink)
James Truher
Guest


 

Re: pspath not neccisarly unique

I believe that this is the underlying resource identifier, so there's no
uniqueness guarantee it's all about how the resource sees the data - here's
an example in the filesystem.

PS> new-psdrive -psp filesystem -root "C:\documents and settings\jimtru"
home

Name Provider Root
CurrentLocation
---- -------- ---- ---------------
home FileSystem C:\documents and settings\jimtru


PS> ls home:|select pspath

PSPath
------
Microsoft.PowerShell.Core\FileSystem::C:\documents and
settings\jimtru\Cookies
....

PS> ls "c:\documents and settings\jimtru" |select pspath

PSPath
------
Microsoft.PowerShell.Core\FileSystem::C:\documents and
settings\jimtru\Cookies
....


in the cert: case, I assume that it's just different views of the same data
--
--
James Truher [MSFT]
Windows PowerShell Development
Microsoft Corporation
This posting is provided "AS IS" with no warranties, and confers no rights.

<klumsy@xtra.co.nz> wrote in message
news:1160349475.750344.285160@m73g2000cwd.googlegroups.com...
>i would presume for a different location that pspath would be different
> (i.e unique).. basically i am making a tree of providers and their
> children and was using the pspath as the unique key, it works with all
> providers other than the cert one..
>
> both of these return the same pspaths..
>
> dir cert:\CurrentUser |Select-Object pspath
> dir cert:\LocalMachine | select-Object pspath
>
> is this by design (then its also by design that we can't assume the
> uniqueness of the pspath), or an oversight?
>
> i understand probably the flexibility you'd want with get-childitem,
> i.e virtual directories, unique sort of behaviours etc,different views
> of the same underlying data so its probably by design.
>
>
> Karl
>



My System SpecsSystem Spec
Old 10-09-2006   #3 (permalink)
klumsy@xtra.co.nz
Guest


 

Re: pspath not neccisarly unique

thanks jim, that is a good usage case other than the certs. i saw you
this morning down ath the ISV conf, but i don't know if you recognised
me without my long hair.

Karl

My System SpecsSystem Spec
Old 10-11-2006   #4 (permalink)
Lee Holmes [MSFT]
Guest


 

Re: pspath not neccisarly unique

The PsPath should be unique:

A Windows PowerShell path is designated with the string "PSPath". It is the
common mechanism for uniquely identifying an item obtainable through a
virtual drive supported by a Windows PowerShell provider.
http://windowssdk.msdn.microsoft.com.../ms714658.aspx

The fact that the Certificate Provider outputs non-unique PSPaths is a
problem in its output -- please file a bug.

[C:\temp]
PS:19 > dir Microsoft.PowerShell.Security\Certificate::AuthRoot
Get-ChildItem : Cannot find path 'AuthRoot' because it does not exist.
At line:1 char:4
+ dir <<<< Microsoft.PowerShell.Security\Certificate::AuthRoot

[C:\temp]
PS:20 > dir Microsoft.PowerShell.Security\Certificate::LocalMachine\AuthRoot


Directory:
Microsoft.PowerShell.Security\Certificate::LocalMachine\AuthRoot


Thumbprint Subject
---------- -------
F88015D3F98479E1DA553D24FD42BA3F43886AEF O=C&W HKT SecureNet CA SGC Root,
C=hk
F44095C238AC73FC4F77BF8F98DF70F8F091BC52 CN=Class 3TS Primary CA,
O=Certplus, C=
EF2DACCBEABB682D32CE4ABD6CB90025236C07BC O="Colegio Nacional de Correduria
Publi
EC0C3716EA9EDFADD35DFBD55608E60A05D3CBF3 E=ca@digsigtrust.com, CN=DST (UPS)
Root
E5DF743CB601C49B9843DCAB8CE86A81109FE48E E=info@valicert.com,
CN=http://www.vali

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



<klumsy@xtra.co.nz> wrote in message
news:1160349475.750344.285160@m73g2000cwd.googlegroups.com...
>i would presume for a different location that pspath would be different
> (i.e unique).. basically i am making a tree of providers and their
> children and was using the pspath as the unique key, it works with all
> providers other than the cert one..
>
> both of these return the same pspaths..
>
> dir cert:\CurrentUser |Select-Object pspath
> dir cert:\LocalMachine | select-Object pspath
>
> is this by design (then its also by design that we can't assume the
> uniqueness of the pspath), or an oversight?
>
> i understand probably the flexibility you'd want with get-childitem,
> i.e virtual directories, unique sort of behaviours etc,different views
> of the same underlying data so its probably by design.
>
>
> Karl
>



My System SpecsSystem Spec
Closed Thread

Thread Tools
Display Modes



Similar Threads
Thread Thread Starter Forum Replies Last Post
Is there an opposite to Get-Unique? Kryten PowerShell 4 12-07-2007 06:31 PM
BUG? Get-Item 'PSPath' => missing PSDriveInfo =?Utf-8?B?ZHJlZXNjaGtpbmQ=?= PowerShell 3 09-11-2006 11:32 AM
Problem with Get-Unique and strings =?Utf-8?B?ZHJlZXNjaGtpbmQ=?= PowerShell 8 08-17-2006 09:42 AM
Suggestion: New Parameter Type - PSProviderPath/PSProviderRoot (PsPath/PsRoot) Alex K. Angelopoulos [MVP] PowerShell 4 07-02-2006 04:34 PM
Get-unique Dave PowerShell 6 05-20-2006 04:15 AM


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

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 47 48 49 50 51