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 - implementing get-item

Reply
 
Old 02-06-2008   #1 (permalink)
mario


 
 

implementing get-item

hi...

is possible to implement a provider that support operations like this?

get-item mydrive:books['name']\author

I am trying to implement it overriding methods like GetItem,
GetItemDynamicParameters or GetPropertyDynamicParameters but the execution
always return this error

Get-Item : Cannot retrieve the dynamic parameters for the cmdlet. Provider
execution stopped because the provider does not support this operation.

any suggestion?


My System SpecsSystem Spec
Old 02-08-2008   #2 (permalink)
Marco Shaw [MVP]


 
 

Re: implementing get-item

mario wrote:
Quote:

> hi...
>
> is possible to implement a provider that support operations like this?
>
> get-item mydrive:books['name']\author
>
> I am trying to implement it overriding methods like GetItem,
> GetItemDynamicParameters or GetPropertyDynamicParameters but the
> execution always return this error
>
> Get-Item : Cannot retrieve the dynamic parameters for the cmdlet.
> Provider execution stopped because the provider does not support this
> operation.
>
> any suggestion?
Any luck? I haven't abandoned you, just haven't had the time to look
into it.

--
Microsoft MVP - Windows PowerShell
http://www.microsoft.com/mvp

PowerGadgets MVP
http://www.powergadgets.com/mvp

Blog:
http://marcoshaw.blogspot.com
My System SpecsSystem Spec
Old 03-11-2008   #3 (permalink)
mario


 
 

Re: implementing get-item

hi marco..

apparently powershell doens't like xpath expressions .... so, I had to
change the way referencing th items that I want to get...

currently I am building a psdrive for bts but is a lot of work ... there are
many ways and many things to implement :P

regards.!

"Marco Shaw [MVP]" <marco.shaw@_NO_SPAM_gmail.com> wrote in message
news:edTHIloaIHA.4180@xxxxxx
Quote:

> mario wrote:
Quote:

>> hi...
>>
>> is possible to implement a provider that support operations like this?
>>
>> get-item mydrive:books['name']\author
>>
>> I am trying to implement it overriding methods like GetItem,
>> GetItemDynamicParameters or GetPropertyDynamicParameters but the
>> execution always return this error
>>
>> Get-Item : Cannot retrieve the dynamic parameters for the cmdlet.
>> Provider execution stopped because the provider does not support this
>> operation.
>>
>> any suggestion?
>
> Any luck? I haven't abandoned you, just haven't had the time to look into
> it.
>
> --
> Microsoft MVP - Windows PowerShell
> http://www.microsoft.com/mvp
>
> PowerGadgets MVP
> http://www.powergadgets.com/mvp
>
> Blog:
> http://marcoshaw.blogspot.com
My System SpecsSystem Spec
Old 03-12-2008   #4 (permalink)
Oisin (x0n) Grehan [MVP]


 
 

Re: implementing get-item

On Feb 7, 12:37*am, "mario" <carlos1...@xxxxxx> wrote:
Quote:

> hi...
>
> is possible to implement a provider that support operations like this?
>
> get-item mydrive:books['name']\author
>
> I am trying to implement it overriding methods like GetItem,
> GetItemDynamicParameters or GetPropertyDynamicParameters but the execution
> always return this error
>
> Get-Item : Cannot retrieve the dynamic parameters for the cmdlet. Provider
> execution stopped because the provider does not support this operation.
>
> any suggestion?
On Mar 11, 2:53 pm, "mario" <carlos1...@xxxxxx> wrote:
Quote:

> hi marco..
>
> apparently powershell doens't like xpath expressions .... so, I had to
> change the way referencing th items that I want to get...
>
> currently I am building a psdrive for bts but is a lot of work ... there are
> many ways and many things to implement :P
>
> regards.!
>
> "Marco Shaw [MVP]" <marco.shaw@_NO_SPAM_gmail.com> wrote in messagenews:edTHIloaIHA.4180@xxxxxx
>
>
>
Quote:

> > mario wrote:
Quote:

> >> hi...
>
Quote:
Quote:

> >> is possible to implement a provider that support operations like this?
>
Quote:
Quote:

> >> get-item mydrive:books['name']\author
>
Quote:
Quote:

> >> I am trying to implement it overriding methods like GetItem,
> >> GetItemDynamicParameters or GetPropertyDynamicParameters but the
> >> execution always return this error
>
Quote:
Quote:

> >> Get-Item : Cannot retrieve the dynamic parameters for the cmdlet.
> >> Provider execution stopped because the provider does not support this
> >> operation.
>
Quote:
Quote:

> >> any suggestion?
>
Quote:

> > Any luck? I haven't abandoned you, just haven't had the time to look into
> > it.
>
Quote:

> > --
> > Microsoft MVP - Windows PowerShell
> >http://www.microsoft.com/mvp
>
Quote:

> > PowerGadgets MVP
> >http://www.powergadgets.com/mvp
>
Quote:

> > Blog:
> >http://marcoshaw.blogspot.com- Hide quoted text -
>
> - Show quoted text -
Hi Mario,

We have several XML related cmdlets in Pscx ( www.codeplex.com/pscx ),
one or two of which take XPath expressions. I think it's Select-Xml.
Since it's a cmdlet, we're not succeptible to the path munging you're
seeing in your provider.

On the other hand, have you investigated using provider-direct paths?
if you prefix a pspath with \\ it will not be pre-parsed by powershell
and you *may* be able to work with relatively clean looking xpath
paths. Give it a whirl, and if you get it working, feel free to donate
it to Pscx ;-)

The problem you're seeing is because you have left in the default
implementation for GetItemDynamicProperties(string) which is probably
a "throw new NotImplementedException()" statement. Just replace that
statement with "return null;"

Hope this helps,

- Oisin
- Oisin
My System SpecsSystem Spec
Old 03-14-2008   #5 (permalink)
mario


 
 

Re: implementing get-item

hi oisin...

thanks by your response, I'll test it

regards.!

"Oisin (x0n) Grehan [MVP]" <oising@xxxxxx> wrote in message
news:f73627c5-6a9e-4adb-90da-513398feb759@xxxxxx
On Feb 7, 12:37 am, "mario" <carlos1...@xxxxxx> wrote:
Quote:

> hi...
>
> is possible to implement a provider that support operations like this?
>
> get-item mydrive:books['name']\author
>
> I am trying to implement it overriding methods like GetItem,
> GetItemDynamicParameters or GetPropertyDynamicParameters but the execution
> always return this error
>
> Get-Item : Cannot retrieve the dynamic parameters for the cmdlet. Provider
> execution stopped because the provider does not support this operation.
>
> any suggestion?
On Mar 11, 2:53 pm, "mario" <carlos1...@xxxxxx> wrote:
Quote:

> hi marco..
>
> apparently powershell doens't like xpath expressions .... so, I had to
> change the way referencing th items that I want to get...
>
> currently I am building a psdrive for bts but is a lot of work ... there
> are
> many ways and many things to implement :P
>
> regards.!
>
> "Marco Shaw [MVP]" <marco.shaw@_NO_SPAM_gmail.com> wrote in
> messagenews:edTHIloaIHA.4180@xxxxxx
>
>
>
Quote:

> > mario wrote:
Quote:

> >> hi...
>
Quote:
Quote:

> >> is possible to implement a provider that support operations like this?
>
Quote:
Quote:

> >> get-item mydrive:books['name']\author
>
Quote:
Quote:

> >> I am trying to implement it overriding methods like GetItem,
> >> GetItemDynamicParameters or GetPropertyDynamicParameters but the
> >> execution always return this error
>
Quote:
Quote:

> >> Get-Item : Cannot retrieve the dynamic parameters for the cmdlet.
> >> Provider execution stopped because the provider does not support this
> >> operation.
>
Quote:
Quote:

> >> any suggestion?
>
Quote:

> > Any luck? I haven't abandoned you, just haven't had the time to look
> > into
> > it.
>
Quote:

> > --
> > Microsoft MVP - Windows PowerShell
> >http://www.microsoft.com/mvp
>
Quote:

> > PowerGadgets MVP
> >http://www.powergadgets.com/mvp
>
Quote:

> > Blog:
> >http://marcoshaw.blogspot.com- Hide quoted text -
>
> - Show quoted text -
Hi Mario,

We have several XML related cmdlets in Pscx ( www.codeplex.com/pscx ),
one or two of which take XPath expressions. I think it's Select-Xml.
Since it's a cmdlet, we're not succeptible to the path munging you're
seeing in your provider.

On the other hand, have you investigated using provider-direct paths?
if you prefix a pspath with \\ it will not be pre-parsed by powershell
and you *may* be able to work with relatively clean looking xpath
paths. Give it a whirl, and if you get it working, feel free to donate
it to Pscx ;-)

The problem you're seeing is because you have left in the default
implementation for GetItemDynamicProperties(string) which is probably
a "throw new NotImplementedException()" statement. Just replace that
statement with "return null;"

Hope this helps,

- Oisin
- Oisin

My System SpecsSystem Spec
Old 03-14-2008   #6 (permalink)
Oisin (x0n) Grehan [MVP]


 
 

Re: implementing get-item

On Mar 14, 12:53*pm, "mario" <carlos1...@xxxxxx> wrote:
Quote:

> hi oisin...
>
> thanks by your response, I'll test it
>
> regards.!
>
np, btw that should read http://www.codeplex.com/powershellcx ( not
pscx! sorry)

- Oisin
My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
rename-item, move-item and special chars. PowerShell
Copy-Item : Container cannot be copied onto existing leaf item. PowerShell
Implementing Sql Object Dependency? .NET General
Implementing SMO in Powershell PowerShell
implementing security templates Vista security


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