Scripting Blog

A place to learn about PowerShell and share stories of automation

How Can I List All the Empty Folders on a Specified Drive?

Hey, Scripting Guy! How can I list all the empty folders (that is, folders with a size of 0 bytes) on a specified drive?-- DD Hey, DD. You know, physicist Edwin Schrodinger once proposed a thought experiment in which a cat is placed in a sealed box, along with a canister of poison gas. The experiment is designed in such a way that there is ...

How Can I Determine Whether or Not My Local Users are Required to Have a Password?

Hey, Scripting Guy! How can I determine whether or not my local users are required to have a password?-- GT Hey, GT. You know, rather than beat around the bush we decided to come right out and admit it: yes, the rumors that have been circulating around the Internet are true. One of the Scripting Guys, his brothers, his son, and various ...

How Can I Create a Compressed Folder and Add Files to It?

Hey, Scripting Guy! How can I create a compressed folder and add files to it?-- SL Hey, SL. You know, one thing that the Scripting Guys have learned over the years is that when people ask a question they often expect to get an answer to a different question. The classic example, of course, is when the Scripting Spouse says, “Do these ...

How Can I Test a Dynamic Array to See if the Array is Empty?

Hey, Scripting Guy! How can I test a dynamic array to see if the array is empty?-- SH Hey, SH. Today’s column is dated Wednesday, July 5th. If there really is a column today that means that, unlike last year, the neighbors and their errant fireworks didn’t set fire to the Scripting House. If there isn’t a new column today, well, to ...

How Can I Get the Full Name and Description For My Local User Accounts?

Hey, Scripting Guy! How can I get the full name and description for each of my local user accounts?-- EB Hey, EB. You know, this might be hard to believe, but many people view the Scripting Guys with suspicion. OK, good point; the part that is hard to believe is why they view the Scripting Guys with suspicion. As it turns out, many people ...