PowerShell File Checksum Integrity Verifier (PsFCIV)

PowerShell File Checksum Integrity Verifier is a enhanced PowerShell version of legacy Microsoft FCIV.exe tool. PsFCIV is used to track your files integrity status by calculating cryptographic hashes over a file (or files) and writing them into FCIV-compatible XML database.

PsFCIV_2.5.zip
 
 
 
 
 
4 Star
(17)
32,452 times
Add to favorites
Storage
12/12/2013
E-mail Twitter del.icio.us Digg Facebook
Sign in to ask a question


  • I made some modification to this script
    1 Posts | Last post July 17, 2018
    • Hi,
      this script is interesting for my needs but I made some modifications: I wanted to have it full-text (didn't want to have a GUI output) so I changed the __formatter function to show the list on the console and I have added some information to the file names: hash nr (if OK), old and new hash and date/file size changed (if not OK).
      I then found that the number of elements passed to the function was always the Total which is not a problem for the GUI table but it shows empty lines on the console; so I modified the $max value to match with the corresponding $property.
      If interested, I can share the new version.
      
      Regards
      ggd
  • Built-in alternative if you don't need the database functionality
    1 Posts | Last post September 08, 2017
    • Get-FileHash is built into PowerShell and is easier to use for calculating the hash of a single file (that's the search that led me to this page). Example usage:
      
          Get-FileHash -LiteralPath your_file.xyz
      
      For that matter you don't need PowerShell at all. certutil.exe is included with Win7 and newer:
      
          certutil -hashfile your_file.xyz
  • Size Limit on files being hashed
    1 Posts | Last post April 27, 2017
    • Are there any known file size limits for PsFCIV. I plan to use it to hash 60GB+ files and wanted to know if the tool supports larger file sizes.
  • How do you run PsFCIV in powershell
    2 Posts | Last post March 10, 2017
    • Ok, when I type in Start-PsFCIV into powershell and specify the file I want to run the hash on, i get an error stating that "Start-PsFCIV" isn't recognized.
      
      Obviously I'm missing something. Do I put the PsFCIV2.5.ps1 file in a specific directory? Do I need to give Powershell a command so that it knows what "Start-PsFCIV" means so it can run it? Obviously just having download the file isn't enough that I can just type the command into Powershell and expect it to run, so what do I need to do.
      
      I know this is a simple question, but I'm quite new to this stuff and can't find anywhere that will explain how to actually use this file.
      
      Thank you.
    • By trial and error, and after much Googling, I have discovered that the full sequence of PowerShell commands is as follows:
      
      C:\Users\YourUserID\Downloads\PsFCIV_2.5
      
      Set-ExecutionPolicy -Scope CurrentUser Unrestricted
      
      . .\PsFCIV_2.5.ps1
      
      (There is a space between the two dots in the above command.)
      
      Start-PsFCIV -Path C:\Users\YourUserID\Downloads -HashAlgorithm SHA1,SHA256,SHA512 -Online
  • I like the idea of this, but ran into several problems
    1 Posts | Last post February 25, 2017
    • As mentioned in an earlier post, but not yet fixed, your size variable should be Uint64 so it can handle > 4GB files.
      
      It won't run in the ISE environment (get ton of errors about assigning things like "$host.PrivateData.VerboseForegroundColor = $Host.UI.RawUI.ForegroundColor" because $Host.UI.RawUI.ForegroundColor is -1).  I discovered that $Host.UI.SupportsVirtualTerminal is false in this case so I added this near the beginning:
          if (!($Host.UI.SupportsVirtualTerminal))
              {throw "$host.UI is false, can't run in ISE."}
      So I can at least know what the problem is, and can go run in regular PS window. Hopefully there would be a better fix than this.
      
      Next I would request an option to skip the timestamp check.  I am trying to check files there transferred to another machine via OneDrive, and the timestamps do not match, but checking the files is still valid in this case.
      
      I tried patching the code to not compare the timestamps and then it finally ran, but still told me all my files are bad (I am using an xml from fciv).  When I run it a second time something appears to be wrong with the new xml that overwrote the old one, as I get a ton of:
      ou cannot call a method on a null-valued expression.
      t C:\Utils\PS\PsFCIV\PsFCIV_2.5.ps1:273 char:3
               $hasher.Clear()
               ~~~~~~~~~~~~~~~
         + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
         + FullyQualifiedErrorId : InvokeMethodOnNull
      
      At this point, I just gave up for now.
  • Noobie Powershell 5: Start-PSFCIV error. Appreciate the help.
    2 Posts | Last post January 10, 2017
    • start-PSFCIV : The term 'start-PSFCIV' is not recognized as the name of a cmdlet, function, script file, or opera
      program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again
      At line:1 char:1
      + start-PSFCIV -Path C:\temp\fciv -inlcude *.txt *.dll -XML Server_Hash ...
      + ~~~~~~~~~~~~
          + CategoryInfo          : ObjectNotFound: (start-PSFCIV:String) [], CommandNotFoundException
          + FullyQualifiedErrorId : CommandNotFoundException
    • Sorry for the post. Figured it out. 
  • Why Script throws lots of errors and produces no usable output on Win7
    3 Posts | Last post September 02, 2016
    • Had multiple failed attempts to use PsFCIV_2.5.ps1 on single installation file with intent of getting hash codes to compare to a website (to validate download as per instructions).  Argument selection is intended to get me the MD5 or SHA256 hash to check my download of Anaconda.
      
      Failed code I have tried:
      PS C:\Users\Tek\Downloads> Start-PsFCIV -HashAlgorithm MD5 -Include C:\Users\Tek\Downloads\Anaconda3-4.1.1-Windows-x
      86_64.exe -Online
      
      And same as above but with SHA256 instead of MD5
      And same as both above variations, but on this download-install file instead (as a test):  PDFCreator-2_3_2-Setup.exe
      And attempted subbing XML arg for Online:
      -XML <mypath>\MyFile_XML.DB
      
      I am a complete newbie to Windows Powershell - any help would be appreciated.
      
      Sample error messages:
      
      Add-Type : c:\Users\Tek\AppData\Local\Temp\lkkf1ekj.0.cs(31) : 'PsFCIV.FCIV.FILE_ENTRY.get' must declare a body becau
      se it is not marked abstract or extern
      c:\Users\Tek\AppData\Local\Temp\lkkf1ekj.0.cs(30) :         [XmlElement("FILE_ENTRY")]
      c:\Users\Tek\AppData\Local\Temp\lkkf1ekj.0.cs(31) : >>>         public List<FCIVFILE_ENTRY> FILE_ENTRY { get; set; }
      c:\Users\Tek\AppData\Local\Temp\lkkf1ekj.0.cs(32) :     }
      At C:\Users\Tek\Downloads\PsFCIV_2.5.ps1:160 char:9
      + Add-Type <<<<  @"
          + CategoryInfo          : InvalidData: (c:\Users\Mitch\...tract or extern:CompilerError) [Add-Type], Exception
          + FullyQualifiedErrorId : SOURCE_CODE_ERROR,Microsoft.PowerShell.Commands.AddTypeCommand
      
      ... with many errors that look pretty much like the above
      
    • It seems the help I needed was already on this Q&A page, I just did not realize it.  Oops.  To help others in case you encounter same thing, there is a reference in other answers posted on this page to this URL. Do not take the first answer!  Scroll down and  Build XML as shown for config in support of .NET 4:
      
      http://stackoverflow.com/questions/2094694/how-can-i-run-powershell-with-the-net-4-runtime
      
      This seems to solve the issue.  In doing my comparison of hash keys on my Anaconda installation file, a detail to note ... my comparison of both MD5 and SHA256 follow.  Note that upper / lower case on first character seems to change but all characters match other than that one detail.  I believe this means my check succeeded: (first one is from Anaconda websit / second one is from my checks using this script) --
      
      a3be394f8274c391148efdfbc63e8ca4
      A3BE394F8274C391148EFDFBC63E8CA4
      b4889513dc574f9d6f96db089315d69d293f8b17635da4d2e6eee118dc105f38
      B4889513DC574F9D6F96DB089315D69D293F8B17635DA4D2E6EEE118DC105F38
      
      Thanks to all on this site for your questions and posts that allowed me to find an answer!
    • BTW, here is the tip: you can specify multiple hash algorithm at once:
      
      Start-PsFCIV -HashAlgorithm MD5, SHA256 -Include C:\Users\Tek\Downloads\Anaconda3-4.1.1-Windows-x86_64.exe -Online
      
  • Unable to run script
    5 Posts | Last post June 28, 2016
    • After dot sourcing the script, indicating absolute path, and xml target db file; I get a long list of errors
      
      Most of the first errors that I see say "must declare body because it is not marked abstract or extern"
      
      The last error says "Unable to find type [PsFCIV.FCIV]: make sure that the assembly containing this type is loaded."
      
      After this, I get the total counters displayed, which are all blank
      
      Thanks
    • How did you use the script? I checked the code and there is everything working in respect to custom types.
    • 1. set the execution policy to remote signed
      2. dot sourced the script . .\PsFCIV_2.5.ps1
      3. Tried to execute script C:\Users\XXXX\Desktop\FileChecker> Start-PsFCIV -Path c:\tmp -XML DB.xml
      
      I tried to set -Path using an absolute and relative path as well as the -XML parameter
      
      
    • Sorry, I just downloaded the script and executed. I can't repro your issue.
    • I found the issue
      
      I have .net  4.0 along with previous versions; this seems create conflicts in Powershell
      
      I have to modify some registry settings and force PS to use .net 4.0
      
      Here's the link that shows how
      
      http://stackoverflow.com/questions/2094694/how-can-i-run-powershell-with-the-net-4-runtime
      
      
  • Export hex value in XML file
    2 Posts | Last post June 28, 2016
    • Is it possible to Export the hex file instead the base64 value in the XML file? 
      
      I have to check an hash value (hex) automatically by reading the XML file. 
    • You can do it manually. The script converts hashes to base64 representation (like original FCIV does).
  • Any plans to put this code/script somewhere like GitHub so the community can contribute?
    2 Posts | Last post April 25, 2016
    • Any plans to put this code/script somewhere like GitHub so the community can contribute? I found/fixed a few issues in the version I copied, and would be happy to see these changes benefit others.
    • Yes, there are plans and I would do it even today. The problem is that I have no idea how to publish and manage my local repository on GitHub.
1 - 10 of 29 Items