Releasing psake v1.00 & psake v2.00

22 views
Skip to first unread message

James Kovacs

unread,
Oct 3, 2009, 6:35:00 PM10/3/09
to psake...@googlegroups.com
Hi, Everyone,

A few announcements... First the big ones. Many people have been using psake - both the PowerShell 1.0- and 2.0-compatible versions - in production without any significant issues. For that reason, we have released psake v1.00 (compatible with PowerShell 1.0). The only difference between psake v1.00 and psake v0.23 is the version number.

http://psake.googlecode.com/files/psake-v1.00.zip

We have released psake v2.00 (compatible with PowerShell 2.0). (This was formerly called psake v0.24, "Jorge", and psake-ps2.) A big thanks to Jorge Matos for all his work on psake v2.00.

http://psake.googlecode.com/files/psake-v2.00.zip

A few minor changes... The source code for psake has been moved to GitHub and the SVN repository at Google Code has been retired. We will still be using Google Code for bug tracking, wiki pages, etc.

git://github.com/JamesKovacs/psake.git

If you want the latest source code, you can always download a zip file of master (aka trunk in SVN terms) - or any tags/branches - from:

http://github.com/JamesKovacs/psake

Note that there is no need to install Git to download the latest package as GitHub will create the appropriate zip file on the fly.

Going forward, we are retiring the psake v1.00 and focusing on psake v2.00. If there is demand for a PowerShell v1-compatible version of psake, we will create a branch based on the v1.00 tag, but we will mostly be focused on the PowerShell v2-compatible version (aka psake v2.00).

I would like to offer a big thanks to my collaborators/conspirators on the project. Jorge Matos has been instrumental in updating/improving psake to use the new PowerShell v2 features. Thanks to Shaun Becker for patches and answering newsgroup questions. And thanks to Eric Hexter for his assistance in moderating the psake-users Google Group. I am heartened and thankful for the willing collaboration on this project and am excited to watch it grow. If you have any questions, please do not hesitate to ask.

James
--
James Kovacs, B.Sc., M.Sc., MCSD, MCT
Microsoft MVP - Solutions Architect
http://www.jameskovacs.com
jko...@post.harvard.edu
403-397-3177 (mobile)

Ayende Rahien

unread,
Oct 3, 2009, 6:40:34 PM10/3/09
to psake...@googlegroups.com
What are the new things in 2.0?

James Kovacs

unread,
Oct 3, 2009, 6:49:09 PM10/3/09
to psake...@googlegroups.com
As Ayende pointed out, I should have included a "What's New in psake v2.00?" I hadn't realized that Jorge message detailing the new features had only gone out to the psake-dev list. So here is what Jorge announced a few weeks back:

The main difference is that it has been re-written as a module that contains advanced functions.  Someone using the module could either run the import-module command with the path to the module file (i.e. import-module .\psake.psm1) or (my preference) you can copy the psake.psm1 into a folder called psake into the "Modules" folder in your profile directory (you may have to create it if it's not there) or your machine-wide "Modules" directory:
 
i.e. Profile Directory:
C:\Users\Jorge\Documents\WindowsPowerShell\Modules\psake
 
i.e. Machine-wide Modules folder:
 
C:\Windows\System32\WindowsPowerShell\v1.0\Modules\psake
 
Once the psake folder is created and you've copied the psake.psm1 file into it - restart PS and type "import-module psake" - PS will find the
module and load it automatically.  What I've done is add the "Import-Module psake" to my profile script so that it is loaded everytime I startup PS.
 
Module Benefits:
1) Build scripts don't need to know where psake is installed, they just call Run-psake and it works.
2) Encapsulation - Global variables are no longer required since they can be private to a module unless explicitly exported (I haven't gotten around to actually changing the psake code to not use global variables yet)
3) Modules can be unloaded if needed which removes all the code and variables from memory
 
Advanced Functions:
The other big difference is that the "Run-psake" and "Task" functions have been converted into Advanced Functions which basically means you can take advantage of comment help which means you can type help run-psake and you will get back real help with examples.  
 
Minor changes:
1) Coding style is different
2) Try/Catch is used instead of the "Trap" statement
3) Got rid of the "exec" function
4) You can now define "Pre" and "Post" actions for a task
5) You can define how the task name will be formatted
6) You can define a "TaskSetup" function that will be executed before every task (took that from NUnit)
7) You can define a "TaskTearDown" function that will be executed after every task (took that from NUnit too)
8) Create a global variable called "psake_buildSucceeded" that will be set to true if the build succeeds - scripts can check this
9) Also added a "$noexit" switch to Run-Psake so that the function will not use the exit() function so that you can test a build script at the
command line without PS closing down (the default behavior when the build fails is to call exit(1) so that the calling code can determine if the build failed or not)
10) The psake-buildTester.ps1 had to be changed slightly in order for it to call the Run-psake function
11) Added more examples in the .\examples folder for POST conditions, PRE and POST Actions, etc..
 
Changes I'd like to make:
1) Change all global variables to local variables
2) Convert all the functions into Advanced Functions so that we can provide better help
3) Remove the "Notes" section from the help or update it so that credit is given to all the psake contributors (right now it just has my name because I used a script to generate a template for me)
4) Consider using exported module variables to influence the behavior of psake (I.e. $psake_use_exit_when_build_fails) so that the $noexit parameter is not required
5) Change Run-psake to something that fits with the list of approved PS verbs (try get-verb and you should get a list of approved verbs) 
maybe "Invoke-psake", "Start-psake", etc..?  If we continue to use "Run-psake" then we'll get this message every time the module is loaded into PS:
"WARNING: Some imported command names include unapproved verbs which might make them less discoverable.  Use the Verbose
 parameter for more detail or type Get-Verb to see the list of approved verbs."
 
I then ran the import-module command with the -verbose parameter and found out that PS doesn’t like the "Run-psake"  function name:
 
PS C:\users\jorge\Documents\Projects\psake-jorge> import-module .\psake.psm1 -verbose
VERBOSE: Importing function 'FormatTaskName'.
VERBOSE: Importing function 'Include'.
VERBOSE: Importing function 'Properties'.
WARNING: Some imported command names include unapproved verbs which might make them less discoverable.  Use the Verbose
 parameter for more detail or type Get-Verb to see the list of approved verbs.
VERBOSE: The command name 'Run-psake' includes an unapproved verb which might make it less discoverable. The suggested
alternative verbs are "Invoke, Start".
VERBOSE: Importing function 'Run-psake'.
VERBOSE: Importing function 'Task'.
VERBOSE: Importing function 'TaskSetup'.
VERBOSE: Importing function 'TaskTearDown'.
 
James
--
James Kovacs, B.Sc., M.Sc., MCSD, MCT
Microsoft MVP - Solutions Architect
http://www.jameskovacs.com
jko...@post.harvard.edu
403-397-3177 (mobile)


Reply all
Reply to author
Forward
0 new messages