PowerShell Logo Small

Set-FileIntegrity



This is the built-in help made by Microsoft for the command 'Set-FileIntegrity', in PowerShell version 4 - as retrieved from Windows version 'Microsoft Windows 8.1 Enterprise' PowerShell help files on 2016-06-23.

For PowerShell version 3 and up, where you have Update-Help, this command was run just before creating the web pages from the help files.

SYNOPSIS

Sets integrity for a file on an ReFS volume.

SYNTAX


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



Search powershellhelp.space

DESCRIPTION


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



<

RELATED LINKS

Online Version: http://go.microsoft.com/fwlink/?LinkID=307030
Get-Item
Get-FileIntegrity
Repair-FileIntegrity

REMARKS

<

Examples


Example 1: Enable integrity

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

-------- ------- --------

H:\Temp\New Text Document.txt True True



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.




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

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

-------- ------- --------

H:\Temp\New Text Document 07 21 True True

H:\Temp\New Text Document 08 19 True True

H:\Temp\New Text Document 08 22 True True

H:\Temp\New Text Document 09 07 True True



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. Fo
r 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 comma
nd displays the file integrity setting for all the files in the folder.