Yes, its very stable, I've been using it in a production
environment since April. I've used it for project builds and
for simple integration tasks that move data around between the DB and
web services.
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 - please merge it into the master like you
recommended, provided you don't see any issues with the changes I've made or
plan to make.
If anyone in the group has any questions or concerns
after reviewing the code - Please let me know.
Thanks!
P.S.
Forgive me if I've explained the obvious regarding
modules or advanced functions, I don't want to assume that everyone's had time
to play with all the new PS features.