Sunday, December 31, 2006

PowerShell Colours

The default colour scheme for PowerShell RTM relies on the defaults for cmd.exe, namely white text on background, and a relatively small window. I prefer to change the defaults in my profile.ps1 file as follows:

# set standard colours etc
$host.ui.rawui.WindowTitle = "PowerShell Rocks!!!"
$host.ui.rawui.backgroundcolor="white"
$host.ui.rawui.foregroundcolor="darkblue"
$host.ui.rawui.buffersize.width=120
$host.ui.rawui.buffersize.height=9999
$host.ui.rawui.windowsize.width=120
$host.ui.rawui.windowsize.height=42
# error and warning colours
$host.privatedata.errorbackgroundcolor="darkblue"
$host.privatedata.errorforegroundcolor="white" $host.privatedata.warningbackgroundcolor="white"
$host.privatedata.warningforegroundcolor="red"

As you can see, you set the basic colours with $host.ui.rawui properties, but set the error/warning colours using $host.privatedata properties. If you want to see what the colours look like for errors or warnings, you can use write-warning and write-error cmdlets as shown in this screenshot:

 

Wednesday, December 27, 2006

Windows-based Format Utility for HP USB Stick

I've been seeing a lot of hits here for a utility from HP to format USB sticks to be bootable.  I wrote about this utility in May 2005. However HP has moved the file to a new location - the utility folks are looking for is on the HP Download site.

The 1.9mb download is an executable setup program for a a Windows-based USB Stick Format Utility. The utility is meant to be able to create a bootable USB stick. However It looks like this feature does not work on all memory sticks. The HP site says it is only available on specific HP devices (Drive Key or DiskOnKey) when running on a range of Compaq desktop systems. But I ran the utility on a Dell laptop and used two old sticks I had lying around. I could format both sticks, but only one as bootable.

Monday, December 25, 2006

Smilla .NET Communications Library

This is a pretty cool .NET Communications Library doing neat stuff with NNTP.

See here for a tutorial on Smilla

Merry Christmas

Enjoy the day and spend some time with your friends and families.

Thursday, December 21, 2006

Mark Russinovich at IT Forum

Mark is a well known Windows Guru and now a Microsoft employee.  His talks are usually outstanding - or often better. If you did not go to IT Forum see IT Forum's recorded webcast site. It has these gems: 

  • Windows Vista Kernel Changes: This talk discusses changes in the Windows Vista kernel, including SuperFetch, User Account Control, Prioritized-I/O, revamped logon architecture, and more.
  • Advanced Windows Troubleshooting with Sysinternals Process Monitor: A tutorial on Process Monitor introducing key features and how to use them to troubleshoot common application and system problems.
  • Advanced Malware Cleaning: Learn how to use the Sysinternals tools to identify malware infestations, including standard spyware and kernel-mode rootkits, and clean them off your system.
  • Windows Vista User Account Control Internals: This session looks inside User Account Control (UAC), explaining the technologies involved, their role and how they work. The talk concludes with a look at how UAC will affect the evolution of malware.

 

Tuesday, December 19, 2006

CodePlex PowerShell Projects

CodePlex is Microsoft's open source project hosting web site. When I looked tonight there are 7 PowerShell projects up there!

I think this is pretty cool - a set of additional PowerShell projects including:

  • PowerShell Community Extensions- Windows PowerShell is a new, object-oriented command shell developed by Microsoft. With the first version of PowerShell Microsoft is focusing on implementing a core set of features.
  • VS Command Shell - VSCmdShell provides users with a shell window inside Visual Studio IDE that can be used for Visual Studio commands as well.
  • PowerShell Scripts for Testing - PowerShell Scripts for Testing is a function library for PowerShell, Microsoft's .NET scripting language. The library brings xUnit-style assertions such as Assert and AssertEquals to PowerShell.
  • PowerShell SharePoint Provider - A full PowerShell provider for exposing SharePoint 2003 [version 2007 coming] as a file system. Administer your SharePoint installation with familiar copy/move/rename/delete and new-item metaphors. Move users between roles, copy users between webs; use the full power of the shell to script away the pain of GUI based mass-management.
  • PowerShell Utility Scripts - PowerShell Utility scripts for Windows Administrators and .NET Developers
  • ShinyPower - Want Help with PowerShell? ShinyPower is a small application that lets you browse the built-in help that comes with PowerShell.
  • NewsGator Powershell Provider - Newsgator (www.newsgator.com) provides a web services API exposing a complete interface to your RSS feeds.

WOW!

Vista is WinHlp-less.

I just discovered KB article KB 917607.  Windows help is a help program that's been around a long time. It enables access to  help files stored on older .hlp file format.

Unfortunately, says the KB article, WinHlp no longer "meets Microsoft Standards" (although the particular standards are not mentioned). For this reason, it has been removed from Vista. Worse, the KB states that venders are prohibited from distributing the help application.  So if you have an application that works fine under XP and uses the older .HLP file format for help - the help will not work under Vista. Worse, MS is prohibiting the application vendor from helping you.

But as I read on, users will be able to download a version of the WinHlp code. One small thing: according  to the KB  article, this application is not ready yet and will be provided some time in early 2007.  Or so the KB article claims.

 I think of all those older corporate apps using older help files that will now not seamlessly work  on Vista. Is MS trying to stop businesses from upgrading to Vista? This is more proof, if proof is actually needed, that Vista was released before it's ready.

Roll on SP1!

PowerShell Documentation On-Line

Microsoft has created a tremendous amount of technical documentation on PowerShell and has placed this on-line. Here's some of the documentation you can get:

 

Monday, December 18, 2006

ReadyBoost Compatibility Chart

ReadyBoost is a feature of Windows  Vista that enables you to improve system performance by using flash memory devices such as a USB stick. Not every memory card, however, works with ReadyBoost.

Here is a link to Grant Gibson's ReadyBoost Compatibility Chart.

Technorati tags: , ,

Friday, December 15, 2006

Simplifying Deployment Using PowerShell

One of the things that I have really enjoyed, as a PowerShell MVP, is the sheer creativity of the community. It never ceases to amaze me how creative folks can be when given such a fantastic tool!

I got some mail this morning that pointed to a page on The Code Project, a Visual Studio and .NET community site. The page is entitled Deployment made simple using PowerShell. You can download a huge PowerShell script which handles some of your deployment needs. The script uses the .NET System.IO and System.Net class libraries.

Cool Stuff - well done Omar Al Zabir.

Thursday, December 14, 2006

Running PowerShell in Vista as an Admin

I've documented previously how to get PowerShell to run on Vista. It's a simple hack, but as I've said before, it's unsupported. But it works and I'm using this approach on my laptop, which is now running Vista. I also have a shortcut to PowerShell in  my quick launch window to the right of the Start button.

One thing I discovered is that, like all programs, Vista runs PowerShell sans privileges. Thus when I opened PowerShell to look at the BCDEDIT program, I found BCDEDIT simply gave me the error:

The boot configuration data store could not be opened.
Access is denied
.

The reason is UAC. Under Vista, PowerShell is running, by default, without admin rights, thus I get the access denied error. Some will argue that this is a good thing, but as the admin,I want to run PowerShell as an admin! But I do appreciate MS looking after me, but I know what I'm doing . UAC is a great feature, but it does not learn. Why should some programmer in Redmond decide what I need to be protected from? I've only been using MS products for 25 years, and in all that time, have never come across the malware Redmond wants to protect me from. But enough of the anti-UAC rant.

The solution to this problem is simple - just adjust the shortcut that starts PowerShell. Right click the shortcut, and select properties. On the Compatibility tab, at the bottom, select "Run this program as an administrator". I'm unclear why MS decided to  put this option on the Compatibility tab but I suppose some Program Manager thought it a good idea.

The only downside is that each time you run PowerShell, you get the dreaded black screen and get asked for permission to run PowerShell as admin. Additionally, although it may be a byproduct of the hack I used to get PowerShell running - Vista can't identify the publisher. It suggests the program is "unidentified" - a feature I hope MS will get fixed when they eventually release PowerShell for Vista.

 

Wednesday, December 13, 2006

Scammers Quick To Offer Vista

If you read the technical press, they are forecasting Vista adoption to be slow, at least in the corporate space. While that may be true, it hasn't stopped the scammers from  getting onto the bandwagon. I'm getting 5-10 spam mails a day offering me the opportunity to download Vista Enterprise. I'm getting nearly as many of these as I am winning lottery mails.

One particular site has very attractive price of$79.75 for Vista Ultimate (RRP is closer to $320). Now of course that price can't be right, but I suspect that such prices will attract buyers! But I can't imagine this site is selling legal copies - for that matter,  I wonder if the buyer actually gets anything (but his CC number heavily debited). Have you known anyone to get things from this site that are legal??

Assuming this is a scam site, I can't understand why MS hasn't closed this down. Or some of the other vendors whose products are being offered so cheaply for that matter. Of course, maybe I am wrong and this site is totally legit. But as my grandpa used to say: anything that seems too good to be true usually isn't.

 

Technorati tags: , ,

Installer for PowerShell on Vista (updated)

 

Here's a link to Gaurhoth's PowerShell Thoughts: Homebrew Installer for PowerShell on Windows Vista (updated) which contains updated information on building your own PowerShell installation program for Vista. Note: this approach, while it works, is probably not supported by Microsoft.

MS has delayed a working version of PowerShell on Vista until the consumer launch at the end of January.  I found this very disappointing although I'll agree it is not the end of the world. The reason for the delay is not really a technical one  (as in Vista supports PowerShell just fine!), but a legal one.

The ingenuity of the community to figure a way around the legal issues is quite impressive. I'm glad to say I'm running Vista RTM on my laptop and have PowerShell RTM working just fine.

Monday, December 11, 2006

Half of American Business PCs Can't Run Vista

 

This is a sad story. According to PC Magazine,half of the business computers in the US can't run Vista,  and 94% can't run Vista Premium. OUCH!

Most of this problem is lack of RAM. Vista requires a lot - and while MS may say 512MB is OK, I'd not want to run a Vista box in less than  2GB. The remainder of the issue relates to the graphic card not being Aero-Glass capable.  Frankly, I can't see that Glass is all that important in a business context. 

PC Magazine concludes that the huge jump in system requirements (from what XP needed) will be a significant barrier to adoption.

Saturday, December 09, 2006

PowerShell & Windows Vista

In a blog post on the PowerShell Team blog, Jeffrey Snover commits to releasing a version of  PowerShell for Vista by the end of January 2007. The issue stopping this from happening sooner is that the installer is not working properly just yet.

It's a shame that PowerShell is not supported yet on Vista, but there are hacks around that enable you to get the support in the mean time. So while it's regrettable, it's understandable and not the end of the earth.

Friday, December 08, 2006

Microsoft 2007: Overkill?

That's the question Redmond magazine's Carolyn April is asking. It's something I noted in an earlier blog post. Carolyn notes that in additional to the EVO wave, there's a tonne of other stuff. Microsoft's published a long list of products that are new or to be refreshed in 2007 and that list is impressive!

The year ahead is going to see a huge range of new technology being  released. But I suspect that some of it will see slow takeup. I've been using Vista, for example, as my main OS for nearly a fortnight. Vista has recorded 51 'problems' back to MS with no 'solutions' and the Reliability Index of this system is 5.57. Vista, for me at least, is not really ready for business use - but that's mainly a feature of application compatibility and driver support.

But while uptake of Vista may be slow in the business market, there are other releases that businesses may love: such as Office  SharePoint server and the updated version of Live Communications Server. And the new System Center Essentials product looks incredibly exciting for smaller businesses.

What's that Chinese saying: may you live in interesting times. From where I sit, 2007 looks like being a  very interesting year!

 

Tuesday, December 05, 2006

Expressions Web Rocks!

Eweek.com has an interesting article on Microsoft's Expression Web product.  They suggest this product is not only as good on many levels as Dreamweaver but could be more significant than either Vista or Office 2007. See Eweek's take at: Microsoft Takes Web Development Leap.

 

SUS Not Dead. Yet...

I've just seen that Microsoft has given Software  Update Services (SUS) another lease of life, and has announced an extension to the end of support date - July 10th 2007. The idea is to give customers more  time to migrate off of SUS.

Additionally, a beta version of the next release, WSUS 3.0 is available for evaluation.  WSUS 3.0 is expected to be released "in the first half of calendar year 2007."  That's MS speak for sometime in late  June. I'd bet that the announcement will take place at TechEd on Orlando, but that's only my guess and it not a commitment from MS! You can get more information about the WSUS 3.0 beta 2 at http://www.microsoft.com/wsus

 

Technorati tags: , , ,

Monday, December 04, 2006

PowerShell User Group - More Information

Last Thursday, I posted more information about Get-PSUGUK, the UK's PowerShell user group and our upcoming first meeting. This morning I got a blog comment asking two questions. First, there has been a typo in one part of the post - Get-PSUGUK's first meeting will indeed be held on January 24th 2007 (and not 2006 as I'd mistakenly typed!).

Second, the question asks what sort of experience you need to come along. Great question Tim - and my initial view is that the only experience you need is an enthusiasm to learn more. I hope to see folks at all levels of experience. We're quite deliberately not slanting the user group towards any specific area or level of expertise - so whether you are a developer or IT Pro, a newbie, or one of the folks in the audience at PDC 2003 (where Jeffrey Snover first presented PowerShell) it shouldn't matter.

With respect to the first meeting, the core talk Richard and  I are planning is around Installation and basic Configuration as well as a quick look at some of the add-on tools such as PowerGadgets. I would hope that everyone gets something out of this meeting  - and if you are more experienced, come along and teach the rest of us!

 

Sunday, December 03, 2006

Customising PowerShell

I came across an interesting article entitled Customizing Windows PowerShell. It's a little rambling, but it looks at some cool ways you can customise PowerShell's look and feel. It discusses customising the built-in display XML files to change the way PowerShell displays things. In order to make this work, the author looks at how you can re-sign these files.

As is pointed out by Lee Holmes in a comment, rather than edit (and re-sign) the default XML, create your own XML files, add your own formatting definitions, and then override the default ones. Lee points out a good resource: http://www.leeholmes.com/blog/DESCRIPTIONSupportInMonadPart3.aspx.

Saturday, December 02, 2006

Counting Live Writer Users

I use Windows Live Writer as my principal blogging tool. It has a neat feature which detects your blog's look and feel - it's style.  LW then emulates that style as you are using LW to create or edit a blog post. This is a neat feature that I personally like a lot.

LW achieves this by creating a simple testing post on your blog, then deleting it. The only problem with this is that some blog posting tools pick up that test post immediately, as described in a post by Josh. When Josh posted his entry in the summer, there  were a mere 860 its - but today Technorati lists 9592!  

At first sight, this may appear to be a low number of users. But in order to have been picked up, either your blog is be hosted on an "when it's updated, we'll ping someone..." type site or you have configured LW to ping some blogging service. So I suspect that it vastly undercounts the number of LW users, but it's certainly fun to watch. From the look of the stats as I was creating this post, the hits keep rolling in!

 

The Book Of Vista

With the release of Vista, Microsoft has produced a document entitled Windows Vista Product Guide. The Guide is 316 pages of details on what is in the released version of Vista. You can download this either in docx or xps format.  

But a word of warning: the document is HUGE - the word DOCX file is 61.3MB. IIRC, that's around 2/3 of the size of the I386 folder of Windows NT 3.1. :-)

Get it from: http://www.microsoft.com/downloads/details.aspx?FamilyID=bbc16ebf-4823-4a12-afe1-5b40b2ad3725&DisplayLang=en

 

Technorati tags: , , ,

Updating PowerShell Web Pages

I've had a small PowerShell related subsite at http://www.reskit.net/monad. As the name might indicate, the subsite has been up for a while and it's in need of updating.

I've now put up http://www.reskit.net/powershell, and a forwarding page at the old web address that points to this new subsite. I've also updated some of the content. I'll be updating this  page more in the next week - it's been a good test of the new SharePoint Web Designer product whcih is part of Office 2007.

Friday, December 01, 2006

PowerShell Scripting Contest

Microsoft is running a competition around scripting. Submit a PowerShell script that carries out some system administration task in Windows - and the winners get come cool prizes. The only stipulation is that the script must do something  more than just call some  PowerShell cmdlet.

The prizes are cool too - with the 1st prize being a trip to Redmond.

So get scripting and enter. Heck, enter early and enter often.

 

Windows PowerShell Documentation Pack

Hot on the heels of the RTM release of Windows PowerShell 1.0, the PowerShell team have released an updated documentation pack. You can download it from the Microsoft download site - no registration or "Genuine Advantage" required.

 

More about PowerShell on Vista

As I noted yesterday, PowerShell RTM is not yet available from Microsoft for use with Vista RTM. The PowerShell team made some changes late in the game, and the installer for Vista is not ready. This is dissapointing to me as I'm running Vista RTM and really want to get PowerShell going!

The lack of a working installer, however hasn't stopped enerprising geeks from finding a way to do it (and sharing it).

The first hack for getting PowerShell RTM to run on Vista RTM was a blog post I pointed to yesterday. Last night, superstar MCT Fermin Sanchez posted some updated instructions. I followed both sets of instructions and now have PowerShell 1.0 RTM running on Vista RTM.

The approach is to do the following:

  1. Install Powershell RTM on an XP SP2 system.
  2. Copy the c:\windows\system32\windowspowershell\ folder *(and it's contents) from your XP box to your Vista box.
  3. On the XP box, search for the 5 key DLLs noted in Fermin's postt. These will be in the GAC on the XP box. You need to copy each of these to the C:\Windows\System32\windowspowershell\v1.0 folder on your Vista computer.
  4. Add each of these DLLs to the GAC on your Vista computer, using GACUTIL. You will need to download the .NET SDK and install it to get the GACUTIL comamnd.
  5. Populate the registry with the proper keys. There's a .reg file you can get from jon davis's sitee.
  6. Last but not least, create a shortcut in your quick lauch tray and you're up and running.

Note: I am pretty certain this is not supported in any way, shape or form. But it takes about 10 minutes and seems to work well enough. Please do not do this on a production machine.