Here’s a couple of quick, handy PowerShell commands that I’ve found come in handy again and again.
Get a DLL Version
(Get-Command C:PathYourFile.dll).FileVersionInfo
Often, I get asked what version of an application is installed on product. This command provides a quick, easy, and copy/paste-able way to access the info.
Copy all files in a txt file to a folder
get-content .filelist.txt | %{ copy-item $_.trim(‘”‘) .}
Another one that comes up a lot — “Can you send me a copy of all these files,” followed by a huge list of DFS share paths. With this command, just throw them in a file called “filelist.txt” and run it, it’ll copy all the files in the text file (without the subdirectories) for quick and easy copies.
Got any go-to PowerShell commands you use often? Share them in the comments.