Set-FileIntegrity

Set-FileIntegrity

Sets integrity for a file on an ReFS volume.

構文

Parameter Set: Set1
Set-FileIntegrity [-FileName] <String> [[-Enable] <Boolean> ] [-AsJob] [-CimSession <CimSession[]> ] [-Enforce <Boolean> ] [-ThrottleLimit <Int32> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

詳細説明

The Set-FileIntegrity cmdlet sets integrity for a file on a Resilient File System (ReFS) volume. You can enable or disable integrity.

パラメーター

-AsJob

エイリアス

なし

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-CimSession<CimSession[]>

リモート セッションまたはリモート コンピューターでコマンドレットを実行します。New-CimSession コマンドレットや Get-CimSession コマンドレットの出力など、コンピューター名またはセッション オブジェクトを入力します。既定値は、ローカル コンピューターで実行中の現在のセッションです。

エイリアス

Session

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-Enable<Boolean>

Indicates whether to enable integrity for the file.

エイリアス

なし

必須?

false

位置は?

2

既定値

なし

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-Enforce<Boolean>

Indicates whether to enable blocking access to a file if integrity streams do not match the data.

If you specify a value of $True for this parameter, the cmldet also enables integrity for the file.

エイリアス

なし

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-FileName<String>

Specifies a file name. The cmdlet modifies integrity for the file that you specify.

エイリアス

FullName

必須?

true

位置は?

1

既定値

なし

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

false

-ThrottleLimit<Int32>

このコマンドレットを実行するために確立できる最大同時操作数を指定します。このパラメーターを省略するか、値として 0 を入力した場合、Windows PowerShell® では、コンピューターで実行している CIM コマンドレットの数に基づいて、コマンドレットに対する最適なスロットル制限を計算します。スロットル制限は現在のコマンドレットのみに適用され、セッションまたはコンピューターには適用されません。

エイリアス

なし

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-Confirm

コマンドレットを実行する前に、ユーザーに確認を求めます。

必須?

false

位置は?

named

既定値

false

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-WhatIf

コマンドレットを実行するとどのような結果になるかを表示します。コマンドレットは実行されません。

必須?

false

位置は?

named

既定値

false

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

<CommonParameters>

このコマンドレットは次の共通パラメーターをサポートします。-Verbose、-Debug、-ErrorAction、-ErrorVariable、-OutBuffer、-OutVariable.詳細については、以下を参照してください。 about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216)。

入力

入力型は、コマンドレットにパイプできるオブジェクトの型です。

  • System.IO.FileInfo

    To obtain a FileInfo object, use the Get-Item cmdlet for a specified file name. The cmdlet uses the FullName property as the value of the FileName parameter.

  • System.IO.DirectoryInfo

    To obtain a DirectoryInfo object, use Get-Item for a specified directory name. The cmdlet uses the FullName property as the value of the FileName parameter.

出力

出力型は、コマンドレットによって生成されるオブジェクトの型です。

  • This cmdlet generates no output.

Example 1: Enable integrity

The first command enables integrity for a file by specifying the Enable parameter.

The second command uses the Get-FileIntegrity cmdlet to display the file integrity settings for the specified file.

PS C:\> Set-FileIntegrity -FileName 'H:\Temp\New Text Document.txt' -Enable $True
PS C:\> Get-FileIntegrity 'H:\Temp\New Text Document.txt'

Example 2: Enable integrity for multiple files by using the pipeline

The first command uses the Get-Item cmdlet to get all the files in the specified folder, and then passes them to the current cmdlet by using the pipeline operator. For more information, type Get-Help Get-Item. The command enables integrity for each file in the directory.

The second command uses Get-Item to get all the files in the specified folder, and then passes them to the Get-FileIntegrity by using the pipeline operator. The command displays the file integrity setting for all the files in the folder.

PS C:\> Get-Item -Path 'H:\Temp\*' | Set-FileIntegrity -Enable $True
PS C:\> Get-Item -Path 'H:\Temp\*' | Get-FileIntegrity

関連トピック

Get-FileIntegrity

Repair-FileIntegrity

Get-Item