View Single Post
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