RSS All Posts

RSS PowerShell Posts

Tags

2142 Active Directory Administrativia Announcements Battlefield Blogging Cricket Deployment Deployment4 Get-PSUGUK Group Policy HowTo Linux MDT MDT 2010 Microsoft Deployment Toolkit MSDN Music Permissions Personal PowerGui Power Lines PowerShell PowerShell Groups PowerShell Support PowerShell Tools PowerShell V2 Presentations PSUGAU Quick Tips Scripting SDDL Security Tech Talk Ubuntu User Groups Virtualisation VMware Infrastructure Client WAIK Weekly Poll Windows 7 Windows Automation Installation Kit Windows Server 2003 Windows Server 2008 XML

Archives

Meta

« Previous Entries

Error checking in PowerShell

Tuesday, October 2nd, 2007

I recently thought I ought to lift my scripting game and introduce some error checking into my PowerShell scripts.
After a quick google I found this excellent article from the Scripting Guys.
In essence, we set:

$error.clear()
$erroractionpreference = "SilentlyContinue"

And then use, the following statement to test whether the last command was successful:

if (!$?)
{
    "An error has occurred."
}

If you just [...]

Windows Script 5.7 Released!

Friday, August 10th, 2007

I didn’t see this one coming.
Microsoft have released 5.7 of Windows Script. This provides an update for:

Microsoft® Windows® Script containing Visual Basic® Script Edition (VBScript.) Version 5.7, JScript® Version 5.7, Windows Script Components, Windows Script Host 5.7, and Windows Script Runtime Version 5.7.

Get your downloads here:
Windows 2000
Windows XP
Windows Server 2003

Utilising CMD behaviour in PowerShell

Thursday, May 24th, 2007

A couple of days ago Jeffrey Snover posted this article on the Windows PowerShell Team blog. I had noted this behaviour previously and just put it down to a quirk of PowerShell.
So I’ve been musing over what I miss from the CMD that I’d like available in PoSh. To help jog my memory I fired [...]

« Previous Entries