Scripting Blog

A place to learn about PowerShell and share stories of automation

The 2011 Scripting Games Beginner Event 6: Use PowerShell to Find Windows Update Errors

Summary: Beginner Event 6 of 2011 Scripting Games uses Windows PowerShell to find Windows Update errors. About this event Event scenario On your home computer, you notice that you have not been receiving Windows Update notifications. You are running Windows 7, and you configured Windows Update to download and install updates automatically, ...

How Can I Write a Script That Increments a Counter Each Time a Log File is Updated?

Hey, Scripting Guy! How can I write a script that increments a counter each time a particular log file gets updated?-- HJ Hey, HJ. You know, lately the Scripting Guy who writes this column has been victimized by a disturbing phenomenon: he keeps getting phone calls from machines. For the past several nights the phone has rung in the ...

How Can I Count the Number of Times a Word Appears in a Log File?

Hey, Scripting Guy! How can I count the number of times the word Failure appears in a log file? There’s one catch, though: the log file simply writes its events one after another, creating one big, giant line of text.-- FS Hey, FS. According to the rest of your email, your log file looks something like this:Failure 2/7/2006 8:25 AM ...

How Can I Determine the 20 Largest Files on a Computer?

Hey, Scripting Guy! How can I determine the 20 largest files on a computer?-- PW Hey, PW. Having recently returned from a vacation in Europe, the Scripting Guy who writes this column now understands that there are different ways to do things. Some of these would be difficult to adjust to on a regular basis: for example, ordering a soft ...

Feedback usabilla icon