| external help file | Microsoft.PowerShell.Security.dll-Help.xml |
|---|---|
| Locale | en-US |
| Module Name | Microsoft.PowerShell.Security |
| ms.date | 03/05/2026 |
| online version | https://learn.microsoft.com/powershell/module/microsoft.powershell.security/new-filecatalog?view=powershell-7.6&WT.mc_id=ps-gethelp |
| schema | 2.0.0 |
| title | New-FileCatalog |
Creates a Windows catalog file containing cryptographic hashes for files and folders in the specified paths.
New-FileCatalog [-CatalogVersion <Int32>] [-CatalogFilePath] <String> [[-Path] <String[]>]
[-WhatIf] [-Confirm] [<CommonParameters>]
This cmdlet is only available on the Windows platform.
New-FileCatalog creates a Windows catalog file
for a set of folders and files. This catalog file contains hashes for all files in the provided
paths. Users can then distribute the catalog with their files so that users can validate whether any
changes have been made to the folders since catalog creation time.
Catalog versions 1 and 2 are supported. Version 1 uses the (deprecated) SHA1 hashing algorithm to create file hashes, and version 2 uses SHA256.
$newFileCatalogSplat = @{
Path = "$PSHOME\Modules\Microsoft.PowerShell.Utility"
CatalogFilePath = '\temp\Microsoft.PowerShell.Utility.cat'
CatalogVersion = 2.0
}
New-FileCatalog @newFileCatalogSplatMode LastWriteTime Length Name
---- ------------- ------ ----
-a---- 11/2/2018 11:58 AM 950 Microsoft.PowerShell.Utility.cat
The location and name of the catalog file (.cat) you are creating. If you specify only a folder
path, the command creates a file named catalog.cat in that location.
Type: System.String
Parameter Sets: (All)
Aliases:
Required: True
Position: 0
Default value: None
Accept pipeline input: True (ByPropertyName, ByValue)
Accept wildcard characters: FalseAccepts 1.0 or 2.0 as possible values for specifying the catalog version. 1.0 should be
avoided whenever possible because it uses the insecure SHA-1 hash algorithm. Version 2.0 uses the
secure SHA-256 algorithm.
Type: System.Int32
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseAccepts a path or array of paths to files or folders that should be included in the catalog file. When you specify a folder, the command enumerates the contents of the folder recursively to include all subfolders and their contents. The catalog file contains relative paths to the files included in the catalog.
Important
When you provide a list of files or folders, the cmdlet can't compute a relative path since the files and folders can be anywhere on the filesystem. Under this condition, the cmdlet only uses the filename for the hash, which means that you can't have duplicate filenames in different paths. For the best results, pass in a single folder and let the cmdlet enumerate the contents. The cmdlet uses that initial path to calculate relative paths so that duplicate filenames are still unique within the folder tree.
Type: System.String[]
Parameter Sets: (All)
Aliases:
Required: False
Position: 1
Default value: None
Accept pipeline input: True (ByPropertyName, ByValue)
Accept wildcard characters: FalsePrompts you for confirmation before running the cmdlet.
Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases: cf
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseShows what would happen if the cmdlet runs. The cmdlet is not run.
Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases: wi
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseThis cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
You can pipe a string that's used as the catalog filename to this cmdlet.
This cmdlet returns a FileInfo object representing the created catalog.
This cmdlet is only available on Windows platforms.