psake is better off as a module

20 views
Skip to first unread message

Jorge

unread,
Apr 29, 2010, 11:41:20 PM4/29/10
to psake-dev
I've reconsidered - psake should remain a module.

--
You received this message because you are subscribed to the Google Groups "psake-dev" group.
To post to this group, send email to psak...@googlegroups.com.
To unsubscribe from this group, send email to psake-dev+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/psake-dev?hl=en.

Eric Hexter

unread,
Apr 29, 2010, 11:48:43 PM4/29/10
to psak...@googlegroups.com
Jorge,
 
Would you mind sharing what the considerations were for this decision.  I think you are really the best person to speak to this and I would appreciate it if you could share what you have learned as you considered the pros and cons. It would certianly help me understand powershell better.
 

Eric Hexter

Director of OSS | Headspring | www.Headspring.com
email | ehe...@Headspring.com
blog | http://Hex.LosTechies.com
info | http://www.linkedin.com/in/erichexter


Jorge Matos

unread,
Apr 30, 2010, 1:08:24 AM4/30/10
to psak...@googlegroups.com
Eric,

I found that I had a bug with nested builds and while I was fixing it I kept thinking about what you said about churn and adoption - and I thought why am I wasting my time if no one is really complaining about using a module? 

There are some good reasons to use Modules:
1) You can enforce encapsulation by only exporting functions and variables that you want to make public 
2) You can easily remove a module and all the variables that it defines go with it
3) You can treat a module as an object and query it's meta-data
      Import-Module .\psake.psm1
      $m = Get-Module psake
      $m.ExportedVariables  #should print out "psake"
4) The PowerShell team recommends modules as opposed to snap-ins, so I suspect support for modules will only grow in the future

Thanks again for your feedback Eric!
--
Jorge Matos
Senior .NET Architect, MCSD.NET, MCSD Visual Studio 6.0
(440) 666-3107
matos...@hotmail.com      
Blog: http://jorgelmatos.blogspot.com
--------------------------------------------------------------------------------
"Any intelligent fool can make things bigger and more complex...
It takes a touch of genius - and a lot of courage to
move in the opposite direction."... - Albert Einstein

Eric Hexter

unread,
Apr 30, 2010, 8:33:53 AM4/30/10
to psak...@googlegroups.com

Thanks for explaining that, it helps us all learn from you experience.

sent from my mobile phone

On Apr 30, 2010 12:08 AM, "Jorge Matos" <matos...@gmail.com> wrote:

Eric,

I found that I had a bug with nested builds and while I was fixing it I kept thinking about what you said about churn and adoption - and I thought why am I wasting my time if no one is really complaining about using a module? 

There are some good reasons to use Modules:
1) You can enforce encapsulation by only exporting functions and variables that you want to make public 
2) You can easily remove a module and all the variables that it defines go with it
3) You can treat a module as an object and query it's meta-data
      Import-Module .\psake.psm1
      $m = Get-Module psake
      $m.ExportedVariables  #should print out "psake"
4) The PowerShell team recommends modules as opposed to snap-ins, so I suspect support for modules will only grow in the future

Thanks again for your feedback Eric!

On Thu, Apr 29, 2010 at 10:48 PM, Eric Hexter <eric....@gmail.com> wrote:

>
> Jorge,
>  
> Would you mind sharing what the considerations were for this decision.  I think you...

> On Thu, Apr 29, 2010 at 10:41 PM, Jorge <matos...@gmail.com> wrote:
>>

>> I've reconsidered - p...

--

> You received this message because you are subscribed to the Google Groups "psake-dev" group.

> To ...




--
Jorge Matos
Senior .NET Architect, MCSD.NET, MCSD Visual Studio 6.0
(440) 666-3107
matos...@hotmail.com      
Blog: http://jorgelmatos.blogspot.com
--------------------------------------------------------------------------------
"Any intelligent fool can make things bigger and more complex...
It takes a touch of genius - and a lot of courage to
move in the opposite direction."... - Albert Einstein

--

You received this message because you are subscribed to the Google Groups "psake-dev" group.

To post...

James Kovacs

unread,
May 3, 2010, 12:50:19 AM5/3/10
to psak...@googlegroups.com
Thanks for sharing your reasoning. I think it was worthwhile to try it as a script again as we now have a good answer when folks ask why it's a module.

James
--
James Kovacs, B.Sc., M.Sc., MCSD, MCT
Microsoft MVP, ASP/ASP.NET
http://www.jameskovacs.com
jko...@post.harvard.edu | @jameskovacs
403-397-3177 (mobile)
Reply all
Reply to author
Forward
0 new messages