header
header Register : : Login header
header
divider
menuleft
menuright
submenu
left
Jun 17

Written by: Karl Prosser
6/17/2008 9:15 PM

So I've loved portable apps from time memorial and have valued making my own apps as portable as possible - XCOPY friendly. I've valued this over some fancy installer. But what about PowerShell? 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). Admins don't want to have to worry about installing prerequisites such as dotnet 2.0 everywhere and neither do I. I want something that can be self contained , where I can run PowerShell v1 and v2 side by side if I choose, and as a builder of PowerShell hosts, I want to be able to embed, or distribute the PowerShell runtime along with my app, just like I can with a multitude of dotnet libraries and components.

Well is this possible. Yes, I've done it. In this blog post I'll show some screenshots and a video about it, and talk about the WHAT and the WHY, and try to whelm up some passion in the community to encourage Microsoft to allow the PowerShell engine to be redistributed freely, easily , and portably. I know that many people will ask me - Can I download this, and I have to say NO - because we don't have rights from MS to redistribute PowerShell, especially outside of its official packages, but the good news is that you can make this yourself, but I'm not going to tell you HOW to until tomorrow, hoping that instead of running of to recreate your own personal PowerShell nirvana you might read the rest of my rant and join the movement for a Microsoft endorsed Portable PowerShell.

But before we proceed here is a screenshot:

servercore2

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.

Here is a 3 minute video showing Portable Powershell v1 and v2 and PowerShell Analyzer running side by side on a virgin XP SP2 box that doesn't have dotnet 2.0 preinstalled.

So now you are saying, GIVE THIS TO ME NOW. Sorry but I can't but in my next blog entry within a couple of days I will tell you how you can roll your own Portable PowerShell.

Please leave a comment on this blog if you are in favor of Microsoft relaxing its redistributable rules when it comes to PowerShell. Technically PowerShell doesn't have much to stop it being Portable. Its fully dotnet, and although its installed in windows\system32 directory that is more a "political" feature , earlier betas would install elsewhere, and technically it wouldn't be hard to make it a control in VS.NET that a custom host could merge into their project and be fully portable. There are many many possible use-cases for such portable uses  (both from the perspective of admins as well as developers creating PowerShell enabled and powered applications in the growing PowerShell ecosystem). If MS can't make any changes technically to make it as easy as i suggest in V2, can they at least GIVE FULL REDISTRIBUTABLE RIGHTS FOR POWERSHELL as they do things such as the SQL server client side report viewer control in VS.NET.

All in favor say so in a comment!

And come back for more in a day or two.

Over and Out,

Karl Prosser / ShellTools.

Tags:

2 comments so far...

Re: Portable PowerShell - v1 and v2 side by side - even on Server Core.

This gonna be really cool. And it is what I really looking for. Can't wait to see your next post. Thank you!

By jadebird on   6/30/2008 9:44 AM

Re: Portable PowerShell - v1 and v2 side by side - even on Server Core.

I'm in favor of Microsoft relaxing its redistributable rules for Powershell.

By Zsoldier on   11/26/2008 9:37 AM

Your name:
Title:
Comment:
Add Comment    Cancel  
 

[August 25th, 2008] Check the home page regarding PowerShell related news from a brand new sponsor: Idera

Blogs
  
Search Blogs
  
Archives
  
right
   
footer Sponsored by Quest Software • SAPIEN Technologies • ShellTools, LLC • Microsoft Windows Server 2008 footer
footer