Why can’t PowerShell be portable. Its the sort of tool that begs to be portable. Admins want a power tool, like powershell to be portable, to be able to be run on any computer without installing anything (changing ,even contaminating the state of the computer).
This beauty shows Server Core Enterprise - you can verify this isn’t a trick but is indeed server core by the operatingsystemSKU of 14 shown in the top window. (MSDN reference. ) Server Core does not have dotnet 2.0 (a prerequisite of PowerShell) installed and we haven’t applied any cool hacks or Russian reverse engineering to get it working therefore we haven’t compromised the secure state of our servercore by installing any untested potential lasting security hole on it. We purely XCOPY across our files, or we can even run it off a USB drive. Another great benefit you see here is on the same machine we are running PowerShell V1 and V2 side by side. How many of us have had to set up a whole new machine or VM just to play with V2 CTP!!!!! and how many cough*cough have installed v2 on a production machine when we should have for lack of patience in setting up a dedicated v2 test machine?
So what are the features of this technique.
- Fully Portable
- versions that presume dotnet 2.0s preexistence (about 3MB to 10MB)
- Versions that don’t need dotnet 2.0 at all (about 100MB)
- Can run V1 and V2 side by side.
- Can run on a machine with PowerShell already installed, and your portable version has its own execution-policy and other settings.
- Can be packaged with SnapIns (so the SnapIns are portable also, no need to install or register them).
- Can be used with a custom Host , so you can have a Portable PowerShell Plus or PowerShell Analyzer.