Scripting Blog [archived]

Formerly known as the "Hey, Scripting Guy!" blog

Use PowerShell to Copy Only Folders that Contain Files

Summary: Microsoft Scripting Guy, Ed Wilson, talks about using Windows PowerShell to copy only folders that contain files. Microsoft Scripting Guy, Ed Wilson, is here. In some respects, it seems like I have been using Windows PowerShell for a long time. In other respects, it seems like the journey begun only a short while ago. I mean, after ...

PowerTip: Use PowerShell to Copy Files

Summary: Learn how to use Windows PowerShell to copy files from one location to another. (image)  How can I use Windows PowerShell to copy a file to a new location? (image)  Use the Copy-Item cmdlet and specify the path to the original file and a destination for the copy. In this example, file 20110314.log in the&...

Weekend Scripter: Messing Around with Disks

Summary: Microsoft Scripting Guy, Ed Wilson, talks about using the Windows 8 storage module to create partitions and to format disks. Microsoft Scripting Guy, Ed Wilson, is here. Today, I thought I would spend a bit more time playing around with the Windows 8 and Windows Server 2012 cmdlets in the storage module. To find these ...

Weekend Scripter: Sorting Folders by Size

Summary: Microsoft Scripting Guy, Ed Wilson, uses Windows PowerShell 3.0 to sort folders by size. Microsoft Scripting Guy, Ed Wilson, is here. It is amazing how things continue to go in circles … I know I have written a script to sort folders by size many times in many different languages. I recently ran across a function written ...