PowerShell Workflow for Mere Mortals: Part 5

Summary: Microsoft Scripting Guy, Ed Wilson, concludes his five-part series about Windows PowerShell Workflow.    Hey, Scripting Guy! I have a number of commands that I want to run against several remote servers. The commands include stuff that must happen prior to something else happening. But then, there are also some things that I would…

How Can I Compact an Access Database?

Hey, Scripting Guy! How can I compact an Access database using a script?– DA Hey, DA. We have to tell you the truth: we are thrilled and excited about getting the chance to answer your scripting question. To be honest, that isn’t always the case, most days we’d look at a question like this and…


PowerTip: Finding Letters in Strings with PowerShell

Summary: Learn four ways to use Windows PowerShell to find letters in strings.  I want to find out if a string contains the letter “m.” The string is stored in the variable $a as shown here: $a=”northern hairy-nosed wombat”  Here are a variety of ways to accomplish this: a.  [string]$a.contains(“m”) b.  $a.contains(“m”) c.  [regex]::match($a,”m”) d.  ([regex]::match($a,”m”)).success

Hey, Scripting Guy! How Can I Hide My Desktop Wallpaper?

I give a lot of presentations, and the background picture of my baby alpaca, while fascinating to me, probably does not have the same level of attraction to my clients. I know I can mouse around and change the desktop picture to some bland color, but I prefer to run a script and make the…


Writing Output with PowerShell

Summary: Microsoft PowerShell MVP, Marco Shaw, discusses writing output from Windows PowerShell. Microsoft Scripting Guy, Ed Wilson, is here. Today we will be joined by Marco Shaw. Marco is a consultant with CGI in Moncton. He has been working in the IT industry for over 12 years, also working for Bell Aliant and Atlantic Lottery….


Use a PowerShell Hash Table to Simplify File Backups

Summary: Learn how to use a Windows PowerShell hash table to simplify backing up unique files.   Hey, Scripting Guy! Your series on hash tables has been pretty interesting. I am wondering if you have some practical uses for hash tables. Can you provide a few examples of how using a hash table would be…

Keep Your PowerShell Versions Straight and Avoid Errors

Summary: Learn how to keep your Windows PowerShell versions straight, and avoid errors while using a one-line command to add computers to domain. Microsoft Scripting Guy, Ed Wilson, is here. Earlier this week I wrote Use PowerShell to Replace netdom Commands to Join the Domain. It turned out to be a very popular post. To…

PowerTip: Use PowerShell to Create a Date String

Summary: Use Windows PowerShell to create a date string that has a month, day, and year.  How can I use Windows PowerShell to create a string that represents the date with the month, day, and year?  Feed a pattern of ‘M/d/y’ to the ToString method from Get-Date: PS C:\> (get-date).ToString(‘M/d/y’) 10/28/13

How Can I Determine the OU the Local Computer Belongs To?

Hey, Scripting Guy! In a logon script, which attribute do I use to determine the OU that the local computer belongs to?– JP Hey, JP. Most people are familiar with Cupid, the Roman god of love. In fact, you’d be hard-pressed to find anyone who doesn’t know that Cupid carries with him a quiver of…


How Can I Add Multiple Tables to a Word Document?

Hey, Scripting Guy! How can I add multiple tables to a Word document?– KH Hey, KH. You know, if the Scripting Guys have one failing (hey, we said if) it’s this: we’re simple guys with simple tastes. Create a Microsoft Word document with multiple tables? No, sir; that’s not for us, not at all. One…