Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

converting 1.0 snap-ins to 2.0 modules

3 views
Skip to first unread message

Darren Mar-Elia (Group Policy MVP)

unread,
Nov 17, 2009, 10:06:20 PM11/17/09
to

Per the subject line, is this documented anywhere? I did a search on MSDN
and Google and didn't find anything particularly clear. I have some C#
snap-ins that I'd like to convert to 2.0 modules and am looking for
developer best practices, tips, hints, etc..

Thanks!

Darren

Marco Shaw [MVP]

unread,
Nov 18, 2009, 4:12:16 PM11/18/09
to
I'll assume you've seen this new documentation?


"Darren Mar-Elia (Group Policy MVP)" <dmar...@hotmail.com> wrote in message
news:3E257E8B-967F-4667...@microsoft.com...

Marco Shaw [MVP]

unread,
Nov 18, 2009, 4:13:44 PM11/18/09
to
(Hit enter too fast on the last one.)

It might not address all your questions, but it is all very new:
http://msdn.microsoft.com/en-us/library/dd901839%28VS.85%29.aspx

Marco

"Darren Mar-Elia (Group Policy MVP)" <dmar...@hotmail.com> wrote in message
news:3E257E8B-967F-4667...@microsoft.com...

Darren Mar-Elia (Group Policy MVP)

unread,
Nov 18, 2009, 5:53:16 PM11/18/09
to
Thanks Marco-
I did see that and it helps a little. It doesn't exactly spell out a
migration path, but from the code samples, it appears that nothing really
changes in terms of writing binary cmdlets except that it is no longer
necessary to use the Snap-in classes. My assumption, perhaps incorrect, is
that I should be able to take a v1 cmdlet assembly unchanged and use
import-module in v2 to bring it into a Powershell session. In addition, I
have the option to write an module manifest to optionally tweak how that
import works. Does that sound correct? I guess one last question is, do I
have to handle help files any differently?

Thanks again,

Darren

"Marco Shaw [MVP]" <marco.shaw@NO_SPAMgmail.com> wrote in message
news:#Lm37PJa...@TK2MSFTNGP04.phx.gbl...

Oisin (x0n) Grehan [MVP]

unread,
Nov 18, 2009, 8:06:06 PM11/18/09
to
100% correct Darren.

The DLL remains unchanged; you can just type import-module .
\mysnapin.dll and it just works. psd1 manifests control format/type
data files and can restrict export of cmdlets among other things.

-Oisin

On Nov 18, 5:53 pm, "Darren Mar-Elia \(Group Policy MVP\)"


<dmare...@hotmail.com> wrote:
> Thanks Marco-
> I did see that and it helps a little. It doesn't exactly spell out a
> migration path, but from the code samples, it appears that nothing really
> changes in terms of writing binary cmdlets except that it is no longer
> necessary to use the Snap-in classes. My assumption, perhaps incorrect, is
> that I should be able to take a v1 cmdlet assembly unchanged and use
> import-module in v2 to bring it into a Powershell session. In addition, I
> have the option to write an module manifest to optionally tweak how that
> import works. Does that sound correct? I guess one last question is, do I
> have to handle help files any differently?
>
> Thanks again,
>
> Darren
>

> "Marco Shaw [MVP]" <marco.shaw@NO_SPAMgmail.com> wrote in messagenews:#Lm37PJa...@TK2MSFTNGP04.phx.gbl...


>
>
>
> > (Hit enter too fast on the last one.)
>
> > It might not address all your questions, but it is all very new:
> >http://msdn.microsoft.com/en-us/library/dd901839%28VS.85%29.aspx
>
> > Marco
>

> > "Darren Mar-Elia (Group Policy MVP)" <dmare...@hotmail.com> wrote in
> > messagenews:3E257E8B-967F-4667...@microsoft.com...


> >> Per the subject line, is this documented anywhere? I did a search on MSDN
> >> and Google and didn't find anything particularly clear. I have some C#
> >> snap-ins that I'd like to convert to 2.0 modules and am looking for
> >> developer best practices, tips, hints, etc..
>
> >> Thanks!
>

> >> Darren- Hide quoted text -
>
> - Show quoted text -

0 new messages