Now with PowerShell 1.0 Compatibility
There are three huge changes in this release, actually. But the biggest one is that most
of the functionality works in the released version of PowerShell 1.0! There are still a few glitches and bugs when it's running in 1.0, but I've decided it's past time I just release it and let you start using it! If you use it on 1.0, please let me know if you run into anything weird, or problems you can't figure out workarounds for.
And Cached Script Functions!
The second biggest change is that all of the functions are now cached. The first time it's loaded, PowerBoots actually writes out a few hundred scripts files into a "Functions" subfolder, and from then on, they're only loaded when they're used -- saving you a lot
of time at startup, and a lot
of memory. Additionally, when you load in additional controls, such as the Visifire WPF chart controls
, those functions are cached permanently too, so you never even have to manually load the assembly again!
And Dependency Properties
A few people have asked over the last few months about how to set attached properties and dependency propertiesin PowerBoots
, so in this release I've included full support for these in a way that will, I hope, simply work so well it will boggle your mind :) All you have to do to tell a control, for instance, to be in the 3rd column of a grid is to just pass Button "Click Me" -"Grid:Column" 2
... it's THAT simple. In fact, for properties that have unique names, you don't even have to specify the type, just the name, like -Row 3
to specify the grid row.
The downside of these changes is that some of the syntax has changed a little bit. All scripts and event handlers (ie: click handlers for WPF Buttons) are run from the dll
module scope in PowerShell 2, which means that they can't access "script" scope variables from your scripts (you need to use global scope).
In order to help with the transition, I've included a Samples.ps1 script which has 28 sample scripts in it (mostly from the original Tutorial Walk-through
, which I will update soon). I've updated each of them to work with this release, in both PowerShell 1 and PowerShell 2 (which means they're almost all written in PowerShell 1 syntax), so you can use them as good examples of how to get things done! NOTE:
Currently Sample 20
depends on my HttpRest module to fetch some numbers from the internet for display -- it's essentially the same as Sample 19.
How To Install
- Download the release archive (.zip) of your choice from this page.
- For PowerShell 2.0:
- Unpack into your Documents folder in: WindowsPowerShell\Modules\ (or another folder in your $Env:PSModulePath).
- You should now be able to get-module -list PowerBoots and see at least one module (CTP3 shows two).
- To load the module, you need to run Import-Module PowerBoots in the console or your profile script.
- For PowerShell 1.0:
- Unpack anywhere you like
- To load the module, you need to dot source the script: . .\PowerBoots1.ps1 in the console or your profile script.
To be clear on the quality of this release: once we have ironed out the minor problems we're having with PowerShell 1.0 in a way that I'm comfortable with, I expect to push the version number up and release an 1.0 Release Candidate.
Please use the Discussions Forum and Issue Tracker above to post back any problems you have, and I'll try to write up a few more posts describing changes and differences in the next couple of weeks (this month has been hectic with the unveiling of my other project
NOTE: I uploaded a tiny fix (Wed 6/18 10pm EST) to the warning about "MTA" mode which had a typo.