Scripting Blog

A place to learn about PowerShell and share stories of automation

Hey, Scripting Guy! Quick-Hits Friday: The Scripting Guys Respond to a Bunch of Questions (01/30/09)

How Do I Compress Files?   Hey, Scripting Guy! After some time without needing help, I've run into a problem about which I have been unable to discover any information. Perhaps you can aid me. Assume you have (1) a single file, and (2) a folder that contains a number of files of various types. Further assume that you wish to store those ...

Hey, Scripting Guy! How Can I Enable or Disable My Network Adapter?

  Hey, Scripting Guy! At my office I access the corporate network by using a wired ethernet connection. However, when I come home, I have a wireless connection. Since our security guys do not allow us to have multiple network connections active at the same time, I am constantly enabling the wireless connection when I get home, and ...

Hey, Scripting Guy! How Do I Find Information About the Network Adapter Cards on My Computer?

Hey, Scripting Guy! When I use WMI to query for network cards on my laptop, it comes back with 32 network cards. 32! I am not lying. My laptop does not even have 32 slots, so how does it have 32 network cards in it? How can I find information about the "real" network cards on my laptop? I figure I should only have two: the wired NIC and ...

How Can I Change the First Two Octets of an IP Address?

Hey, Scripting Guy! How can I change the first 16 bits on an IP address? I want to keep the last 16 bits exactly the same.-- LD Hey, LD. Before we answer your question we should note that we are well aware that “suggestive” photos of an American Idol contestant have allegedly been uncovered on the Internet. Needless to say, we know many...

How Can I Modify the Output of the Ping Command?

Hey, Scripting Guy! How can I place the current date and time at the beginning of each line of Ping.exe output?-- AL Hey, AL. We have to admit, we were a little shocked by your question. Change the output of the Ping command? Really, AL. Would you ask us to rewrite Romeo and Juliet, giving it a more happy and upbeat ending? Would you ask us...