http://www.garykessler.net/software/FileSigs_20110719.zipTo run it, with basic options, call the function like this, which returns a basic result:
If you want to pass pipelined objects to it as well, you can like this:Get-FileSignature -Fullname C:WindowsSystem32cmd.exeTrue
When you run it this way you get one of the three results listed above:Get-ChildItem "C:WindowsSystem32c*" |Where {!$_.PSIsContainer} |% { Get-FileSignature -Fullname $_.fullname}
A more useful example would be:TrueTrueTrueTrueTrueTrueTrueTrueTrueTrueTrueTrueNo match in database
Get-ChildItem "C:WindowsSystem32c*" |Where {!$_.PSIsContainer} |which returns:% { Get-FileSignature -Fullname $_.fullname}
Some of the more "advanced" features arecabinet.dll - Truecabview.dll - Truecacls.exe - Truecalc.exe - Truecapiprovider.dll - Truecapisp.dll - Truecatsrv.dll - Truecatsrvps.dll - Truecatsrvut.dll - Truecca.dll - Truecdd.dll - Truecdosys.dll - Truecero.rs - No match in database
- -UpdateSignatures: update the database
- -Suggestion: predictive analysis which returns possible matches based on file signatures
In my case, I define the Signature database against a directory I have location on my machine. If the location does not exist the first time you run the script, it will be created for you. This option is best run not as a part of a pipelined command as it will continuously prompt you to test, download, and, update the .zip. Below is an example of how to run it:
To run the suggestions (useful if you are not sure about a given extensions validity) you can use this:Get-FileSignature -UpdateSignatures
This is a VERY chatty option unless you are dealing with obscure directories. In this case, here is a "small" sample output:Get-ChildItem "C:WindowsSystem32c*" |Where {!$_.PSIsContainer} |% { Get-FileSignature -Fullname $_.fullname -Suggestion} |select filename, fileextensions
FileName FileExtensions-------- --------------cabinet.dll COM|DLL|DRV|EXE|PIF|QTS|QTX|SYScabinet.dll ACMcabinet.dll AXcabinet.dll CPLcabinet.dll FONcabinet.dll
OCX
cabinet.dll OLB
cabinet.dll SCR
cabinet.dll VBX
cabinet.dll VXD|386
cabinet.dll API
cabinet.dll AX
cabinet.dll FLT
cabinet.dll ZAP
cabview.dll COM|DLL|DRV|EXE|PIF|QTS|QTX|SYS
cabview.dll ACM
cabview.dll AX
cabview.dll CPL
cabview.dll FON
cabview.dll OCX
cabview.dll OLB
cabview.dll SCR
cabview.dll VBX
cabview.dll VXD|386
cabview.dll API
cabview.dll AX
cabview.dll FLT
cabview.dll &