다음을 통해 공유


New-FileCatalog

Creates a Windows catalog file containing cryptographic hashes for files and folders in the specified paths.

구문

Default (기본값)

New-FileCatalog
    [-CatalogVersion <Int32>]
    [-CatalogFilePath] <String>
    [[-Path] <String[]>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

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.

예제

Example 1: Create a file catalog for `Microsoft.PowerShell.Utility`

$newFileCatalogSplat = @{
    Path = "$PSHOME\Modules\Microsoft.PowerShell.Utility"
    CatalogFilePath = '\temp\Microsoft.PowerShell.Utility.cat'
    CatalogVersion = 2.0
}
New-FileCatalog @newFileCatalogSplat
Mode                LastWriteTime         Length Name
----                -------------         ------ ----
-a----         11/2/2018 11:58 AM            950 Microsoft.PowerShell.Utility.cat

매개 변수

-CatalogFilePath

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.

매개 변수 속성

형식:String
Default value:None
와일드카드 지원:False
DontShow:False

매개 변수 집합

(All)
Position:0
필수:True
파이프라인의 값:True
속성 이름별 파이프라인의 값:True
나머지 인수의 값:False

-CatalogVersion

Accepts 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.

매개 변수 속성

형식:Int32
Default value:None
와일드카드 지원:False
DontShow:False

매개 변수 집합

(All)
Position:Named
필수:False
파이프라인의 값:False
속성 이름별 파이프라인의 값:False
나머지 인수의 값:False

-Confirm

Prompts you for confirmation before running the cmdlet.

매개 변수 속성

형식:SwitchParameter
Default value:False
와일드카드 지원:False
DontShow:False
별칭:cf

매개 변수 집합

(All)
Position:Named
필수:False
파이프라인의 값:False
속성 이름별 파이프라인의 값:False
나머지 인수의 값:False

-Path

Accepts a path or array of paths to files or folders that should be included in the catalog file. If a folder is specified, the command includes all files in the folder.

매개 변수 속성

형식:

String[]

Default value:None
와일드카드 지원:False
DontShow:False

매개 변수 집합

(All)
Position:1
필수:False
파이프라인의 값:True
속성 이름별 파이프라인의 값:True
나머지 인수의 값:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

매개 변수 속성

형식:SwitchParameter
Default value:False
와일드카드 지원:False
DontShow:False
별칭:wi

매개 변수 집합

(All)
Position:Named
필수:False
파이프라인의 값:False
속성 이름별 파이프라인의 값:False
나머지 인수의 값:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

입력

String

You can pipe a string that's used as the catalog filename to this cmdlet.

출력

FileInfo

This cmdlet returns a FileInfo object representing the created catalog.