Latest Entries »

Powershell is showing up in recent news articles surrounding Windows 7.
 
 
-Shane

It’s been 9 months since I put in a bug on Microsoft Connect for the IE visible property not working when running in a remote runspace.  While I completely understand the security reason to not allow a person to monkey with a desktop that may not be their own, I want to plead my case to allow it via some/any method.

I am currently trying to automate a whole series of test cases that require remote systems to act as launch points for browsing to websites.  These websites may or may not have Popup windows that appear during surfing.  Not a problem.  Couple of ways to launch IE and browse to a website on a remote system.  InternetExplorer.Application COM object or just creating and starting an IE process are the first two that come to mind.  The problem you will run into is everything that is invoked through a runspace seems to suppress any interaction with the desktop.  You set the visible flag on the COM object and nothing happens.  Launch an IE process on the remote machine and IExplore.exe starts running but is not visible.

“Why do you want to see these windows so bad?” you might ask?  Well, the short answer is, I want to see the popup windows as they would normally appear.  It is critical to my testing that this happens and I grab the html content of each popup.  I could not find a way to get a handle on a hidden (because all desktop interaction is being suppressed) popup window that is created from a JavaScript Window.Open() function.  Kinda frustrating.

If there was a way to get a handle on these Ninja (read: hidden) popup windows then I wouldn’t have much of an issue.  Please Microsoft, give me a way to either grab these hidden popups or allow me to set IE to visible. 🙂

-Shane

Windows 7 Debate

Over the past couple of weeks I have been reading articles, blogs, reviews, etc that go back and forth on if Windows 7 will be the OS that gets people to upgrade from Windows XP and\or Vista.

Time to throw my 2 Gil into the mix.

There is one feature alone that I think makes Windows 7 a VERY compelling choice.  Powershell Version 2 baked in.  The amount of resources Microsoft is throwing behind Powershell is impressive and there are some that don’t fully understand why they should learn Powershell.  Here’s the deal.  Powershell support will be in everything moving forward.  If you manage a Windows based environment, you will want to know Powershell and have Powershell installed on everything.  With Windows 7, Powershell is there and waiting for commands.

Pre-Windows 7 you have to install Powershell V1, figure out how you are going to do remote management (Powershell Server is a VERY good choice for this) and keep on top of new machines coming into the environment.  Yes, you can use RIS\WDS, Group Policy, System Center Configuration Manager 2007, 3rd Party tools to do this for you but wouldn’t it be nice if you didn’t have to worry about it?

Powershell everywhere, all the time is going to be a godsend for IT Administrators.  Windows 7 is the next step in that direction.  To me, that is the compelling reason.

-Shane

Convert From-Markdown

A colleague at work came to me with a new idea for creating html documentation using lightweight text files and a simple markup language.  The project was called Markdown by John Gruber.

This was fine and all but I have been trying to find a way to do everything I come across in Powershell just to get practice in solving different problems using the language.

I quickly found a project that ported the Perl based project to .NET by Milan Negovan called Markdown.NET.  Using the binary from this project I simply created a wrapper around the core method, gave it some advanced function documentation and gave credit to the two parties involved.

The next step would be to port it over to purely Powershell but I really don’t feel like reinventing the wheel today 😉

The module .zip can be found here.  It requires CTP3 of Powershell V2.  Try it out.  If you find any bugs, have any comments or suggestions, please let me know.

-Shane

So far so good with Powershell Server from nSoftware.  Found a couple issues but for the most part it is handling just about everything we throw at it.  We rely heavily on remote runspaces and the performance seems to be better than remoting in CTP1 of Powershell.
 
The really nice thing about Powershell Server that I have been enjoying is the event logs.  Every command that is run in a remote runspace is logged which makes troubleshooting and debugging much easier.  We had a script that was throwing a strange error and when I went to check what was being run on the remote side I noticed that a variable wasn’t making it to the other side.  Come to find out the string being sent over was double quoted without escaping the variable by mistake.
 
Overall, I am pleased with Powershell Server.  Good features.  Good price.  Support has been responsive.  It is looking like this will get us by until V2 of Powershell goes gold.
 
Part 3 I will attempt to use CTP3 of Powershell over Powershell Server to overcome the lack of support for remoting on Windows XP and Windows Server 2003.
 
-Shane

Looking Ahead to 2009

I’m having my first sleepless night of 2009 thinking about what I want to accomplish this year.  Some personal. some work related.

  1. Complete "Version 2" of our automation solution at work.  "Version 1" has been focused purely around building a solid Powershell framework and has us moving in the right direction.  Looking at VMWare Lab Manager to really take it to the next level.
  2. Get some paperwork behind my knowledge.  Targets are CCNA, MCSA/E and MCAD.  I tend to learn stuff without taking tests to show I know the subject.  I think employers would rather have experience over certs but the wife wants me to get them anyways.  Better keep her happy 😉
  3. Start digging into a couple technologies that I use but am not intimate with.  These include C#, SQL Query, ASP.NET, Web Services.  Just those (and of course Powershell) should keep me busy this year.
  4. Get some landscaping done around the house.  Dirt and rocks are getting really boring to look at.  Need to spice things up a bit.
  5. Teach my son how to play all the sports I know.  Time to start finding out which ones he likes or is good at.
  6. Do what I can to help my wife get through another year of school on her way to a degree.

-Shane

On TweetGrid I noticed Jeffrey Snover ask someone to blog about what they would have liked to see in the latest drop of the Powershell ISE.  He didn’t ask me, but I’ll blog about it anyway. 😉

Wishlist:

  • Expand/Collapse of:
    • Comments
    • Functions
    • Regions
    • All
  • Import/Export/Customization of Environment Settings (much like Visual Studio)
    • I really really really like to code in this environment
    • Use Visual Studio format so they are interchangeable.
  • Indication of Opening/Closing Brackets,Parenthesis,Scriptblocks,etc
    • When the cursor is next to the opening, the closing is also highlighted.
  • Full XML editor support (Pulled from MSDN)
    • Design time well-formedness and validation errors.
    • Context-sensitive Intellisense.
    • Validation support for Schema, DTD, and XDR.
  • Intellisense, Intellisense, Intellisense
    • I think we all know what’s needed here.  Intellisense on everything.  The more the merrier.
  • Dockable panels
    • Current Runspace Variables
    • Properties

-Shane

The Power of ParameterSets

This is one of the many features that sold me on Powershell when I started looking into the language.  This enables admins or devs to produce some really polished stuff and give the end user a nice experience.
 
 
-Shane
 
Powershell CTP3 is now available.  Get it here and submit feedback here 
 
-Shane

In the previous blog, we had some issues with CTP1 and remote runspace stability.  While looking for alternatives, I remembered nSoftware’s Powershell Server.  After reading the info on their website, I decided to download it and try it out.

First off.  NetCmdlets CANNOT create runspaces on remote machines without Powershell Server.  The website is a bit misleading since they list the Cmdlets to connect to a SSH Runspace but if the SSH Runspace service is not running on the remote machine, you get no joy.  I will give them the fact that they do say in their New-SSHRunspace description that you need Powershell Server.

Now the install.  Installation was a snap for both NetCmdlets and Powershell Server.  Powershell Server has a nice option to run as a service so it’s waiting for connections at startup.  I tried to set the service to interact with the desktop but the service won’t start once that option is checked.  Was worth a try.

I noticed some differences between the two products in that they return two different object types when using the runspaces depending on which Cmdlets are used.  New-SSHRunspace is one Cmdlet.

image

New-PowershellServerRunspace is the other Cmdlet.

image

The first type of runspace (SSHRunspace) seems to return objects as their own homegrown ShellObject.

image

The next runspace type(PowershellServer) is more familiar to us as it returns the process objects as it normally would in the Powershell Host.

image

As you can see, there are subtle differences between the two runspace Cmdlets but overall, this product is able to do everything I’ve thrown at it thus far.  More testing to come.

-Shane