M BUZZ CRAZE NEWS
// general

Windows 10 PowerShell 5.1 new-filecatalog unable to find files

By Mia Morrison

I'm trying to create a catalog to verify a backup created by RoboCopy, containing ~150GB / 100K files, using New-FileCatalog in Windows 10 via:

New-FileCatalog -Path I:\Users\ -CatalogFilePath .\i_users.cat -CatalogVersion 2.0
  • After a few hours of processing, I receive error:
    New-FileCatalog: Unable to find file I:\Users...
    PS $ New-FileCatalog -Path i:\Users\ -CatalogFilePath .\i_users.cat -CatalogVersion 2.0 New-FileCatalog : Unable to find file gapi.loaded_0=I:\Users\susan\Documents\Art Illusions Sunset Pier Canvas Print & Reviews _ Temple & Webster_files\cb=gapi.loaded_0 to hash. At line:1 char:1 + New-FileCatalog -Path i:\Users\ -CatalogFilePath .\i_users.cat -Catal ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [New-FileCatalog], InvalidOperationException + FullyQualifiedErrorId : UnableToFindFileToHash,Microsoft.PowerShell.Commands.NewFileCatalogCommand
    PS $ $PSVersionTable Name Value ---- ----- PSVersion 5.1.19041.1023 PSEdition Desktop PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...} BuildVersion 10.0.19041.1023 CLRVersion 4.0.30319.42000 WSManStackVersion 3.0 PSRemotingProtocolVersion 2.3 SerializationVersion 1.1.0.1
    PS $ Dir 'I:\Users\susan\Documents\Art Illusions Sunset Pier Canvas Print & Reviews _ Temple & Webster.html' Directory: I:\Users\susan\Documents Mode LastWriteTime Length Name ---- ------------- ------ ---- -a---- 21/03/2021 8:50 PM 861394 Art Illusions Sunset Pier Canvas Print & Reviews _ Temple & Webster.html
    PS $ New-FileCatalog -Path 'I:\Users\susan\Documents\Art Illusions Sunset Pier Canvas Print & Reviews _ Temple & Webster.html' -CatalogFilePath .\i_test.cat -CatalogVersion 2.0 Mode LastWriteTime Length Name ---- ------------- ------ ---- -a---- 20/06/2021 12:43 PM 701 i_test.cat

Hang on if it can't find the file how does it know its name?

  • The complete file path is always displayed correctly (excl. extension) and thought it might be file permissions/ownership issues, but I have no issues accessing/opening the same files from other utilities [Explorer] or from New-FileCatalog with just the problem file
  • I have tried launching PowerShell as Administrator with no difference
  • I'm unsure how to progress the New-FileCatalog to complete the catalog, as there doesn't seem to be an option to skip, continue, and report any files that are a problem

Any suggestions?

10

1 Answer

So in the end I used these powershell commands to do what I needed.

Get-ChildItem -i:\Users -Recurse | Get-FileHash -Algorithm MD5 | Select-Object Hash,Path | Format-Table -AutoSize -Wrap | Out-String -Width 500 | tee -FilePath I_users.txt

(I chose MD5 rather than SHA256 because it's faster)

This had no issue finding and hashing every file.

Rather than use test-catalog to perform the compare I then repeated the above command on the other volume and manually compared the txt files with a visual diff tool! Job done!

So my opinion is the New-FileCatalog command is unreliable.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy