Useful PowerShell Commands

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.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.