PowerShell Logo Small

Repair-FileIntegrity



This is the built-in help made by Microsoft for the command 'Repair-FileIntegrity', in PowerShell version 5 - as retrieved from Windows version 'Microsoft Windows Server 2012 R2 Standard' 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

Repairs a corrupted file on an NTFS or ReFS volume.

SYNTAX


Repair-FileIntegrity [-FileName] <String> [-AsJob] [-CimSession <CimSession[]>] [-ThrottleLimit <Int32>] [-Confirm] [-WhatIf] [<CommonParameters>]



Search powershellhelp.space

DESCRIPTION


The Repair-FileIntegrity cmdlet repairs a corrupted file on an NTFS file system volume or a Resilient File System (ReFS) volume. For the cmdlet to repair a file, the file
must be on a storage volume that provides redundancy, and the file must have integrity turned on. This cmdlet does not repair corrupted file metadata.



<

RELATED LINKS

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

REMARKS

<

Examples


Example 1: Repair a file

PS C:\>Repair-FileIntegrity -FileName 'H:\Temp\Text Document.txt'



This command repairs a file. Because the repair proceeds without error, the cmdlet does not display any message.




Example 2: Attempt to repair a file that cannot be repaired

PS C:\>Repair-FileIntegrity -FileName 'J:\Temp\Text Document.txt'
Repair-FileIntegrity : The storage device does not provide redundancy.



This command attempts to repair a file. In this example, the cmdlet cannot repair the file and therefore displays an explanation.