Saturday, December 05, 2009

Google DNS

Last week,  Google announced a new service, Google DNS. The idea is simple – instead of using your own, or your ISPs DNS, you use theirs. Most readers of this blog will know what DNS is, why it’s really important and how to configure and manage it, at least I sure hope so! But that leaves a great percentage of the Internet-using population who both don’t know and  probably don’t care as it all just works.

The idea of an independent DNS network is not new. Several years ago, I wrote about the ORSN, the European Open Root Server Network. I sometimes set systems up to use it, but like most folks, the DNS that most of I use is a part of the huge distributed network that comes as part of the Internet. Personally, I have my own internal DNS server which serves as a resolver for the  systems in my network, as well as hosting the records for my AD domain.

The Google DNS service is just a resolving DNS cache – they host no zones  (other than Google’s own zones) and they do not host any root domains. They just resolve the names you send it, and cache those results for others to use. Google say their goal is “to benefit users worldwide while also helping the tens of thousands of DNS resolvers improve their services, ultimately making the web faster for everyone.” A laudable goal, but is it actually a useful service. On Google’s code blog, they cite three main advantages: Speed, Security and Validity. I’ve spent some this morning looking at the speed claim.

Google DNS is hosted at several servers. In their configuration instructions, they :there are two servers (at 8.8.8.8 and at 8.8.8.4), although another document shows 5 servers (ns[1-4].google.com). I have been doing some testing, using PathPing.Exe this morning to look at performance. Access to these servers from the UK (where this article is being written) is quick and has no packet loss. The path to the servers goes first via my ISP to Google-Lon.Google.Com and then via a few un-named routers to the DNS server. The RTT to 8.8.8.8 was 38 ms.

I then ran a PathPing against my own ISP’s DNS server and another DNS Server run by Demon Internet. For both UK servers, I see a shorter route (10 hops vs 12) – not surprising as these servers are in the UK, and Google’s I suspect are not.I also see a faster path (31 ms to Demon, 28 to Clara.Net vs 38 to Google). Packet loss to both UK servers is also zero although the route to Demon’s name server goes via  tele-service-22-s267.router.demon.net which drops 100% of the ICMP packets (no such issue to Clara.Net. So on path grounds, using Google does not seem to provide much benefit as it’s slower and has more hops.

As for security, Google makes the valid point that DNS is vulnerable to attach – it can be spoofed routing users to malicious sites rather than the intended site. The DNSSEC protocol is meant to attack that problem through cryptography, but DNSSEC is not yet in widespread use (and is a lot more work to setup). I’m not sure I entirely buy the argument that they are any better at protecting DNS than my ISP. We’ll have to see.

The validity advantage that Google cites seems even less interesting. They say their DNS servers comply with DNS Standards. Well I’d sure hope so – a non-standards compliant DNS server would be a bit a a waste of time. They also avoid blocking, filtering or redirection. Doing some testing using NSLookup, it looks like they don’t do wildcard DNS – thus trying to resolve (hopefully!) non-existent domains gives teh expected error. I tried resolving x.microsoft.com and foo.foo.foo – both queries were “refused” since ns1.google.net could not find those domains.

All in all, this looks to be a reasonably fast and competent DNS solution. For many users, using this might benefit their web surfing. For me, it looks a tad slower – so ‘buyer’ beware. As for the security argument, I accept they intend to make their service secure, but experience will show whether this is a good argument, or not.

Technorati Tags: ,,,

Saturday, November 28, 2009

PowerShell Plus 3.1 Beta

With PowerShell V2 now released, those nice folks over at Idera have released a Beta of their upcoming 3.1 version of this popular PowerShell tool. You can see more information, and snag a copy of the beta, over at the PowerShell.Com site!

Personally, I like PowerShell Plus and use it a lot so I was keen to see the beta. You can take a look at some of the new features in a post by the Product Manager Richard GIlles also over on the PowerShell.Com site. Naturally, once you install the beta, there’s a readme file with more information.

One neat thing – there’s now a 64-bit version which installs neatly in a side-by-side fashion with the released version. There’s also some nice script sharing features which encourages further the PowerShell community.

I’ve got the beta downloaded and am using it – I look forward to the release!

Wednesday, November 18, 2009

PowerShell – WMI presentation tonight

The things I agree to do…

A good MVP buddy of mine, Joel 'Jaykul' Bennett has asked me to speak tonight to the Upstate New York PowerShell user group. The title of the talk is WMI and  PowerShell. I’m aiming at the basics but will go into a bit of detail. Plus there’s demos. If you want to join into the Live Meeting, here’s the url: ">https://www.livemeeting.com/cc/mvp/join?id=UPNYPUG&role=attend

However, I’m not planning on starting till 11:30 PM (23:30) UK time – which is thankfully earlier for the audience in New York.

Hope to see you there…

[later]

Yes – I will post my slides and demos tomorrow…

Technorati Tags: ,,

Thursday, November 12, 2009

PowerGui.Org’s PowerPack Challenge – Closing Sooon

PowerGUI.org is holding the PowerPack Challenge contest. Basically,  the idea is that you create a PowerGUI add-on (admin console for a particular platform you manage based on PowerShell cmdlets/scrips), and then submit it to the site. By entering the contest, you can win one of the prizes (the top prizes are $1000 in Amazon certificates). This is easy and the site has tutorials on how to do this.

The contest will run for 3 more days, i.e. until the end of Nov 15 2009. You can get full details at PowerGUI.Org. Get coding and best of luck!

Technorati Tags: ,

Friday, November 06, 2009

Leaving Global Knowledge for Pastures New

Many of you will already know this, but I am shortly leaving Global Knowledge. After 3+ years of working for GK’s EMEA group, I have been made redundant and will be out of the company by the end of November or thereabouts. The redundancy process is swift, and pretty brutal – but that’s the nature of the beast. Global Knowledge are treating me pretty well, under the circumstances for which I am genuinely grateful.

In the short term, I’m going back to contracting – doing training, consultancy, or whatever turns up. I would hope to get enough work to tide me over until I can figure out the longer term plan. I am favouring returning to full time employment but we’ll see what happens over the next few months. I’ve already had some brilliant leads, which are great, so things are not totally bleak. I also have a lot of really good friends in the industry who are lending a helping hand. I could not ask for more.

It’s a sad day, on one hand, but a great opportunity on the other. From the people I’ve spoken to, the broad consensus is that I’ll make out just fine. I just hope those voices are right.

Monday, November 02, 2009

Disk to VHD – Another Cool Tool from the Sysinternals Guys

Mark Russinovich and Bryce Cogswell have released yet another cool tool – Disk2VHD (version 1.21) which you can download from here. As it turns out, I’m looking to convert one of my physical boxes to a VM – I use the system rarely but don’t want to chuck it. This tool would be just the business – I could easily run a VM of this system on my laptop when I actually need it. 

The VHD that this tool creates can be used as a VM for either Microsoft Virtual PC or Hyper-V. One important limitation – with Virtual PC, the largest volume is 127GB. And the tool is command line – but you could of course, run it from PowerShell!

Technorati Tags: ,,

OCS 2007 R2 Documentation

If you are working with Microsoft’s Office Communications Server 2007 product, you may know about the great documentation produced by the product team. This documentation has been updated to cover the R2 release that hit the streets earlier this year.

There are three ways you can get the documentation:

  • A single CHM file with all the other documents as a single file
  • A zip file containing all the other documents as Word docs
  • Individual Word documents.

Navigate to http://tinyurl.com/ocsdoc and  you can get all three of these formats!

If you get the .CHM file, you will need to remove the protection from the file (use Systinternal’s streams.exe) in order to see the contents. From the .CHM file, you can also send the writers email. They are highly responsive and are happy to incorporate any and all good ideas. This is a great job guys!

Technorati Tags: ,,

250,000 Visitors To This Blog!

I started this blog in May 2003. Just over 5 years ago, I added a traffic counter, and started keeping more detailed traffic counts. Over the weekend, the hit count got to 250,000 – or a quarter of a million visitors! Not as much traffic as some blogs get, but it’s been nice to see the traffic grow here. I am certainly pleased at the slow and steady readership growth.

Looking at my stats today, they sown an average of 377 visitors a day and 504 unique page hits a day. Traffic in October hit an all time record with over 10,00 visits (and over 13,000 page hits). Wow!

For long time visitors – thanks for reading this blog. And for new visitors – welcome and let me know what else I can post here that would keep you visiting.

Sunday, November 01, 2009

Connecting OCS To Other PIC Suppliers

Office Communications Server 2007 implements a feature called Public Internet Connectivity (PIC). Basically, PIC enables you to federate with AOL, Yahoo and MSN/Live Messenger. Thus a user using an AOL IM client can connect and use IM with someone inside your organisation. PIC was cool, but was limited to just the three suppliers (i.e. no Google Talk) and it was licensed separately.

In the past month Microsoft has released some important news. First, PIC licensing has changed. Secondly, Microsoft has announced the release of an XMPP Gateway which facilitates present and IM interoperability between OCS and both Jabber (now owned by Cisco) and Google’s Google Talk.

There are some key PIC Licensing changes. The additional PIC license will not longer be required for federation with AOL. Federation with AOL is free for customers with OCS R2 Standard CAL, or Software Assurance on their current OCS license. But if you wish to federate with Yahoo, you continue to need a PIC license, but the cost of this drops by 50% (effective 1 October 2009). Additionally, as from June 2009, you no longer need a PIC license to federate wit Windows Live (same requirements as noted above for AOL federation).

The release of an OCS 2007 XMPP Gateway means you can federate with both Google’s Google Talk, and with Jabber. And the licensing calls the gateway “Additional Software” meaning there is no additional Microsoft licensing costs associated with you deploying the Gateway.

The OCS Team have published a couple of articles to explain how to get the XMPP gateway up and running. The first blog post discusses Configuring XMPP connectivity to Google Talk. The second blog post looks at how to configure the XMPP Gateway with Jabber XCP 5.4. Both articles are detailed and well illustrated.

For OCS 2007 R2 users, PIC connectivity got a whole lot better!

What Happened To The Post Counts on the MSDN and TechNet Wikis?

I’m a fairly heavy contributor to the MSDN and TechNet Wikis - also known as MSDN and TechNet Community Content. I started posting there pretty much ever since Microsoft setup this feature a couple of years ago. My contribution has included over 10,000 posts (just over 7500 to MSDN and over 2800 to TechNet). I wrote about the MSDN wiki in August.

I do not know if it’s a short term glitch or a more major change – but the post counts have been updated in a significantly downward fashion. TechNet shows just 1297 posts, while on MSDN just 3927) – thus I’ve lost around half my post count. At the time I wrote the august post, I had over 6500 posts credited, but now it’s a LOT lower.

MSDN/TechNet: what’s happened??

Wednesday, October 21, 2009

MSDN Has A New Look and Feel

I spend time on the MDSN Site, particularly the MSDN Library sub-site where I’ve added a few PowerShell scripts as well as editing the content that is added. Just recently, the site has had a bit of a make over. The “MSDN-RED” logo is replaced wiht a more stylish blue colour, along with the opportunity to change your view of the site.

From FireFox, I have a new pop up at the bottom right hand corner of my browser window:

image

The “old” view, Classic is what you are used to, although with new colours. It is the view I will use going forward. Lightweight beta provides what it says, a much more lightweight feel. ScriptFree is even nicer (IMHO) to look at.  And being smaller pages, download times are much snappier.

But what both these two new views omit is all the community contnet (i.e. Community Content) as contained in Classic View. From the Script page, community added page tags are R/O, and there appears to be no way to see or edit Community Content (from both LightWeight and Script Free skins). And the big orange Switch View button from Classic view is pretty ugly and distracting – worse, there appears to be no way to tell it: I’m happy with what I see and please go away.  Or at least a more subtle control perhaps in the title bars like in the other views.

For casual users, or those on lightweight (aka celluar) networks, it’s a nice touch. Shame about losing the community content.

Wednesday, October 07, 2009

Ensuring PowerShell Is Loaded Onto a System

I saw a cool tip over at PowerShell.com for working out if PowerShell is available on a system. This tip points out that if PowerShell is installed on a machine, then the registry key HKEY_LOCAL_MACHINE\SOFTWARE\MICROSOFT\PowerShell\1 will exist and will contain key configuration information.

From my main workstation, I see:

PSH [C:\]: cd hklm:\\SOFTWARE\MICROSOFT\PowerShell\1\
HKEY_LOCAL_MACHINE\SOFTWARE\MICROSOFT\PowerShell\1
PSH [HKLM:\SOFTWARE\MICROSOFT\PowerShell\1]: ls

    Hive: HKEY_LOCAL_MACHINE\SOFTWARE\MICROSOFT\PowerShell\1

SKC  VC Name                           Property
---  -- ----                           --------
  0   1 1033                           {Install}
  0   6 PowerShellEngine               {ApplicationBase, ConsoleHostAssemblyName,PowerShellVersion,
                                        RuntimeVersion...}
  3   0 PowerShellSnapIns              {}
  1   1 PSConfigurationProviders       {(default)}
  1   0 ShellIds                       {}

PSH [HKLM:\SOFTWARE\MICROSOFT\PowerShell\1]: ls .\PowerShellSnapIns

    Hive: HKEY_LOCAL_MACHINE\SOFTWARE\MICROSOFT\PowerShell\1\PowerShellSnapIns

SKC  VC Name                           Property
---  -- ----                           --------
  0   7 PowerGUI                       {Version, PowerShellVersion, AssemblyName,ApplicationBase...}
  0   9 Pscx                           {PowerShellVersion, Vendor, Description, Version...}
  0  11 Quest.ActiveRoles.ADManagement {AssemblyName, Description, ModuleName, PowerShellVersion...}

This is pretty cool. And looking at the PowerShellSnapIns – this information is useful for managing snap-ins on clients and servers. You could test the existence of this Registry key as follows:

PSH [C:\foo]: Test-Path hklm:\SOFTWARE\MICROSOFT\PowerShell\1
True
PSH [C:\foo]: $PSVersionTable

Name                           Value
----                           -----
CLRVersion                     2.0.50727.3074
BuildVersion                   6.1.6949.0
PSVersion                      2.0
PSCompatibleVersions           {1.0, 2.0}

But testing the existance of this registry path from within PowerShell is somewhat meaningless. If PowerShell exists on a given system, then the key will exist so the test will of course succeed. But if PowerShell does NOT exist, you’d never be able to run the script in the first place so being able to test from within the PowerShell script is unhelpful. I suppose you could write a C# program or a VBScript script to do the detection.

But wouldn’t a better way be to just get PowerShell deployed? I’d base the wide deployment to down level systems on the RTM version of The Windows Management Framework. The WMF Release Candidate was posted to the web on Aug 13th, so is getting very close to release. I do not have any specific knowledge, but given past experience by the PowerShell team, I’e expect to see this by the end of the year, maybe at TechEd Berlin.

Technorati Tags:

Tuesday, September 08, 2009

Sharkfest 2009 – The videos

I’m setting up a few new machines, and needed to check out some networking issues – so I went off to Wireshark.Org to download a copy when I discovered a treasure trove of videos and slides from the recent SharkFest conference held in June in Palo Alto.  It sounds like it was an interesting conference – the videos I’ve watched look OK.

Technorati Tags:

Saturday, August 29, 2009

The MSDN Wiki – a look after nearly 6500 edits

Last summer, I posted a blog article about the MSDN wiki, better known as MSDN Community Content (there’s also an equivalent set of content around IT Pro type information, namely Technet  Community Content. This morning I got a comment on that entry which complained about a) not being able to find stuff and b) that the community content idea had been killed. I posted a response to that comment – the Community content is still alive and kicking. In the past year, I’ve added over 6000 updates, the latest of which was a few minutes ago! I’ve also added around 2500 edits to the TechNet equivalent, or nearly 9000 edits in total – and I’m not even an MVP!

The Community Content represents some really great information – and not a few criticisms where the content (or the product!) is at fault. Sadly, as I noted last year, there is a degree of vandalism on this site, which has grown somewhat over the past year. I am fairly ruthless (although as not up to date as I’d want!) with reviewing new comments and removing what I call “non-content”, as well as duplicate posts which some times get made. I also try to ensure good tags. One trend that has accelerated is for posters to see the MSDN community content as a place to ask questions – a couple of posters including my self, point them to the community forums and the Microsoft newsgroups. I also try to ensure the tags on the each community content are relevant.

As ever in publishing, the MSDN content contains errors – usually minor typos, etc. While these are regatable, given the sheer scale of the MSDN (and TechNet) library, these are probably inevitable. Thanks to the sharp eyes in the community, these are found, and have been tagged “Contentbug”. Microsoft are slowly working through these and updating the content proving that the community review process is working, albeit much slower than I’d like.

All in all, the MSDN and TechNet Community Content  are fantastic resources, and are growing daily. Thanks to the MSDN/Technet content teams for providing the platform and working with the community to improve the content

Monday, August 24, 2009

Installing Windows 7 From USB Drive

Surfing around this morning, I found an interesting blog article: Installing Windows 7 From USB Drive 3 Steps Easy Process. Basically, this article shows how to prepare a USB stick from which you can install Windows 7. This is specifically useful for Netbooks or other systems that come without a DVD drive.  This method uses the UltraISO trial package. You do need a big USB stick, 4gb or more and make sure you have the latest version of UntrlISO.

Technorati Tags: ,

Sunday, August 09, 2009

Windows 7 and Virtual Server

With Windows 7 now at RTM and in my hands, the time has come to start to migrate over. I got the ISO images I needed last week, and immediately started to get things running. One specific thing I needed is to get Virtual Server running on Win 7. I am teaching a class on Aug 13/14 and need to prepare – the class is a Windows 7 upgrade class for Microsoft Partners.

I thought, given we’d achieved RTM, that it would be cool to have the Labs running under Windows 7 RTM. To do that, I just needed to get Virtual Server running and install the course files on my laptop. Now I know it’s not officially supported, but I wanted to see if I could make it work. If so, I can then run and demo the labs with Win7 as the host.

There were only two problems with that. The first is that the labs that come from Microsoft Learning require Virtual Server. But Virtual Server is not supported under Win 7, and is actively blocked. And even if I did get VS running, MSL assume that you will be using earlier OSs to run the labs – and installing these on Windows 7 is specifically blocked by the MSI installer.

After a bit of Googling using my favourite search engine and perusing the MCT private newsgroups, it appears that there are two solutions. However, both involve some hacking (and are probably NOT supported).  The solutions were either to get the labs working under Virtual PC 7, or install VS into Win7 and get it running. While both are possible, I chose to do the latter since this seemed to provide an easier to use solution (if it worked of course!!!).

Naturally, a third (and preferable!) option would be to wait for Microsoft Learning to come up with a supported solution. But that is not likely to happen any time soon and I have a course to teach now. So down the road I went with two main tasks: first, installing Virtual Server on Windows 7 and then installing the Microsoft Learning labs on Windows 7.

Installing Virtual Server under Windows 7

To install Virtual Server under Windows 7 is straightforward, although it involved registry editing (and is NOT supported). The steps are as follows:

  1. Disable the application compatibility fixes. You first need to disable all the application compatibility fixes that would stop you from installing Virtual Server. In Windows 7, bring up the local Group Policy editor and Computer Configuration\Administrative Templates\Windows Components\Application Compatibility\ and enable all of the “Turn off” entries. As here;image
  2. Then go to the Computer Configuration\Administrative Templates\System\Troubleshooting and Diagnostics\Application Compatibility Diagnostics\ folder and disable all of the entries there. Like here:
    image
  3. Reboot to ensure the settings take effect. You could, I suppose, just do a gpupdate /force, but I prefer to reboot.
  4. Install Virtual Server. Download the binaries from Microsoft .com and install it.
  5. Install VS SP1 – depending on what download you get, you may may need to install SP1. NB: Installing SP1 is more difficult once you have completed this process, so why not do it now?
  6. Change Application File Name. To enable the next step to work properly, you need to rename the Virtual Server application file name, by going to the Virtual Server directory (typically C:\Program Files\Microsoft Virtual Server\ ) and rename Vssrvc.Exe – I used Vssrvc_Win7.exe.
  7. Change the registry settings for this new file name.  Run regedit, then find and replace all occurrences of "vssrvc.exe" to vssrvc_Win7.exe. There are around 5 or 6 entries to fix.
  8. Undo the group policy changes you made at step 1 above. This turns all those application compatibility fixes back on (which is probably what you want!).
  9. Reboot.

Once the reboot is completed, you should have (the renamed) Virtual Server running on your Windows 7 box. If you want to just run VMs, off you go. you can create and use VS just as you did on XP or Server 2003. Hoevere, if you want to install a MSL Lab onto the system, you have just a bit more work (hacking) to do.

Install course files for Lab Launcher into Win7

Once you have Virtual Server running, you need to fix the installation file for the lab you want to install, e.g. 6291.MSI. Normally, you just run this MSI file on your master system (and use Ghost et al to then blast it to the rest of the systems in the classroom). The only problem with this approach is that Microsoft Learning have put in an installation block on Win7. That means when you try to run the installation MSI, it fails with an error message (”the operating system version does not meet the minimum version required”). Turns out this is really easy to fix – but you do need an MSI editor.

There are two MSI editors you can use (and both are free):

  • ORCA – this is a free MSI editor from Microsoft and comes as part of the Windows Installer SDK. It’s a bit of a pain to get as you first have to download and install the SDK, and then install Orca.Msi. You can find copies of orca.msi out on the internet, but downloading it from Microsoft is probably safest even if it is a bit tedious.
  • InstEd - you can also use InstEd, a free tool you can get at http://www.instedit.com/. I like Instead and blogged about it a while ago. It’s still cool!

Once you your MSI editor loaded, you need to remove one line from the Launch Condition table. If you are using Orca, you’ll see something like this:

image

Just delete the first line of this table, then save the MSI (File/Save As) to a separate MSI (just in case). Then exit out of Orca and you can run your newly saved MSI. You should be good to go.

Minor issues

I found that, after playing around a bit, Virtual Server was complaining about access permissions of VHDs on the host. I just gave all users full access to the C: on the host and the problem went away.

An important issue to consider is that this is not supported. Yes, it works and works reasonably well. It also involved editing registry entries, and using a MSI editor. From personal esperience, both can be dangerous. So use this information at your own risk.

Kudos

Thanks to a couple of posters for helping me to do all this. First, the details of how to get VS running were obtained from a TechNet  forum post. Hacking the MSI to get around version limitiations is an old trick, but thanks to MCT Super-Star Michael Buchardt who pointed me to InstEd! And finally a thanks to Chris Randall for the motivation to write this up.

Thursday, August 06, 2009

The Flood Gates are Open – Windows 7 has hit TechNet and MSDN

Well, after a long wait, it’s finally there – Windows 7 RTM release is on TechNet Plus for download. As I type this, I’m getting speeds varying between 100kbps and bursting to 200kbps. Not stunning but OK. Hopefully the download will finish tonight and I can spend tomorrow with installing Win7 onto my Laptop. Horray!

Technorati Tags:

Static vs Dynamic WMI Methods with PowerShell

In yesterday’s  PowerShell and .NET Framework – Similarities and Differences! article, I wrote about how there was stuff you have to know in order to use PowerShell efficiently. In a recent Hey, Scripting Guy! Blog article, The Scripting guys talk about the differences between a static method on a class and an instance-based method. They use the WMI Win32_Process class as an example. In this WMI class, there is an instance based method, Terminate, that lets you terminate a specific process. As the Scripting Guys point out, there’s no Create method. That’s because the  Create method is a static method which you invoke a slightly different way.

To create a process, you’d do the following:

PSH [C:\foo]: ([wmiclass]"Win32_Process").Create("NotePad")

__GENUS          : 2
__CLASS          : __PARAMETERS
__SUPERCLASS     :
__DYNASTY        : __PARAMETERS
__RELPATH        :
__PROPERTY_COUNT : 2
__DERIVATION     : {}
__SERVER         :
__NAMESPACE      :
__PATH           :
ProcessId        : 8828
ReturnValue      : 0

This is yet another one of those things you need to know about using WMI with PowerShell: how to access static vs. instance based methods.

Technorati Tags: ,,

Wednesday, August 05, 2009

PowerShell and .NET Framework – Similarities and Differences!

When I teach PowerShell, I point out the consistency within and across the product. When you learn something, it can be broadly used in other circumstances. This is the power of knowledge transfer – learning things once and using that knowleldge to solve other problems.

Of course, despite the consistency that’s there, there is a level of in-consistency to manage. There are things that are just not particularly intuitive – and you just have to learn those differences. There is definitely a learning curve when it comes to learning PowerShell! I’ve published what I learn as I go along – I posted an article about .NET and Powershell last December where I looked at how you access .NET from PowerShell.

With a bit of learning, via posts like mine or from Newsgroup.Forum posts, most PowerShell users can look at a bit of documentation on .NET or  WMI, and work out how to access the relevant class,  method, etc. But every so often, stuff that looks obvious isn’t! This fact (feature???) bit me over the weekend when I was working on the Get-System.Environment script that I published over on my PowerShell Scripts blog.

I was playing around with the System.Environment class, and in particular the Environment.SpecialFolder enum. Just looking at it, I felt if I can use one enum like this,

PSH [C:\foo]: [system.Enum]::GetValues([system.dayofweek])
Sunday
Monday
Tuesday
Wednesday
Thursday
Friday
Saturday

Then I should be able to to do something like this (which as you see I can’t):

PSH [C:\foo]: [system.Enum]::GetValues([System.Environment.SpecialFolder])
Unable to find type [system.Environment.SpecialFolder]: make sure that the assembly containing this type is loaded.
At line:1 char:60
+ [system.Enum]::GetValues([system.Environment.SpecialFolder] <<<< )
    + CategoryInfo          : InvalidOperation: (system.Environment.SpecialFolder:String) [], RuntimeException
    + FullyQualifiedErrorId : TypeNotFound

Then, after some searching, I discovered may mistake!  Instead of [System.Environment.SpecialFolder], I needed to specify [System.Environment+SpecialFolder]. As shown here:

PSH [C:\foo]: [system.Enum]::GetValues([system.Environment+SpecialFolder])
Desktop
Programs
Personal
Personal
Favorites
Startup
Recent
SendTo
StartMenu
MyMusic
DesktopDirectory
MyComputer
Templates
ApplicationData
LocalApplicationData
InternetCache
Cookies
History
CommonApplicationData
System
ProgramFiles
MyPictures
CommonProgramFiles

Sure – that was obvious, NOT! But another hurdle on my learning curve!

PowerGui Version 1.9 is Released

As Dmitry discusses over on his blog: The most popular PowerShell freeware tool has just got an update. He and his team have reached into the “I want” list and they’ve produced a stunning new version, just in time for the release of PowerShell V2 (effectively tomorrow or thereabouts). You can download the new version from the PowerGUI Website at: http://powergui.org/downloads.jspa.

If you are already running an older version of PowerGui, you should be able to check for updates (Help/Check for Updates).  But on my main workstation, that gives an error. So I am downloading the new version manually. The download (PowerGUI.1.9.0.900.msi) is 8.1 mb – so not a massive download! In my case, I also needed to install the Active Roles cmdlets (another 8.45MB) before I could finish off installing PowerGui.

While I prefer PowerShell Plus for my day to day editing and development tasks, I have to say PowerGui is a nice product – especially as it’s free. The new version has a number of neat new features, including: Version 2 Module Support, and more intellisense. Perhaps the biggest feature is full Windows 7 and Server 2008 R2 support. It might be tempting fate to release 1.9 the day before Microsoft opens the floodgates that will be the waves of Windows 7 and Server 2008 R2. I suspect like many people, I have a browser window open at the TechNet Plus download site just waiting for the downloads to begin!!

Technorati Tags: ,,