If there’s one task I’ve never stopped doing, it is finding files. I am constantly creating new ways to organize files and display them in a meaningful format. Naturally, PowerShell is a great tool for this task. Get-ChildItem is obviously the proper starting point. The cmdlet works fine in getting only files from a folder…
Tag: Files
PSDrives, Shortcuts and Links
I’ll be honest. I’ve never been much of a OneDrive user. Even though I’m a great candidate given that I use multiple systems and need access to a common set of files. But for a number of reasons I’m beginning to make more of a shift to OneDrive. Part of the challenge for me has…
Friday Fun: Creating Sample Files
Not too long ago I came across a PowerShell snippet, probably via Twitter, that showed how to use a few classes from the System.IO namespace to create dummy files. Sadly I forgot the record where I saw this first mentioned. What I liked about the code I saw was the ability to create a dummy…
Find and Replace Text with PowerShell
I’ve just finished up a series of tweets with a follower who had a question about finding and replacing a bit of data in a text file. In his case it was a web.config file but it really could be any text file that you can view in PowerShell. In PowerShell 3.0 and later this…
Renaming Files with PowerShell
I am not a big fan of file names with spaces. I realize they are easy to read and obviously much more “natural”, but they are simply a royal pain to deal with, especially when working from a command prompt or PowerShell. So naturally the solution is to rename these files and replace the space…
Get File Utilization by Extension
In the past I’ve posted a few PowerShell functions that provide all types of file and folder information. The other day I had a reason to revisit one of them and I spent a little time revising and expanding. This new function, Get-Extension will search a given folder and create a custom object for each…
Content Redirection
Here’s another item I see in some submisstions of the 2010 Scripting Games that I felt I should address: the use of legacy console redirection. While technically not illegal or wrong, an example like this demonstrates (at least in my opinion) that the scripter hasn’t fully adopted the PowerShell paradigm. $computers=get-content "computers.txt" $data=foreach ($computer in…
PModem and Folder Listings
PowerShell MVP Oisin Grehan posted a very promising PowerShell module the other day. He calls it the PModem File Transfer Protocol. It is based on the old bulletin board file transfer protocols of the late 20th century, which I have to admit I fondly remember using. Of course Oisin’s work intrigued me and after playing…