This function is based off of Jeffery Hicks function and allows you to specify one or more files to search for on multiple systems. The difference with this function is that it supports alternate credentials,wildcards (*,%,?,_) and multiple filenames. You can also specify just an extension search by using -Name .ps1 (must have the period (.)) for it to work properly. If you do not specify a drive using -Drive, it will search all available drives on the system which means if run on a file server, expect some slowness. Using wildcards will also bring the performance down as well.

Blog post on this function: http://learn-powershell.net/2013/02/01/use-powershell-and-wmi-to-locate-multiple-files-on-any-drive-in-your-domain/

Remember to dot source the script to load the function into memory!

 

PowerShell
Edit|Remove
. .\Get-CimFile.ps1
 
PowerShell
Edit|Remove
Get-CimFile -Name powershell.log
 
PowerShell
Edit|Remove
Get-CIMFile -Name power*.lo?
 
PowerShell
Edit|Remove
Get-CimFile -name .ps1,*update,ha?dle.exe -Drive C: