PowerShell Logo Small

Repair-WindowsImage



This is the built-in help made by Microsoft for the command 'Repair-WindowsImage', 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 Windows image in a WIM or VHD file.

SYNTAX


Repair-WindowsImage [-CheckHealth] [-LimitAccess] [-LogLevel <LogLevel>] [-LogPath <String>] [-NoRestart] [-RestoreHealth] [-ScanHealth] [-ScratchDirectory <String>]
[-Source <String[]>] [-SystemDrive <String>] [-WindowsDirectory <String>] -Online [<CommonParameters>]
Repair-WindowsImage [-CheckHealth] [-LimitAccess] [-LogLevel <LogLevel>] [-LogPath <String>] [-NoRestart] [-RestoreHealth] [-ScanHealth] [-ScratchDirectory <String>]
[-Source <String[]>] [-SystemDrive <String>] [-WindowsDirectory <String>] -Path <String> [<CommonParameters>]



Search powershellhelp.space

DESCRIPTION


The Repair-WindowsImage cmdlet repairs a Windows image in a WIM or VHD file.


Use the Online parameter to specify the running operating system on your local computer, or use the Path parameter to specify the location of a mounted Windows image.


The LimitAccess parameter prevents access to Windows Update (WU) as a Source for repairing online images.


The CheckHealth parameter checks whether the image has been flagged as corrupted by a failed process and whether the corruption can be repaired.


The ScanHealth parameter scans the image for component store corruption. This operation will take several minutes.


The RestoreHealth parameter scans the image for component store corruption, and then performs repair operations automatically. This operation will take several minutes.


The Source parameter specifies the location of known good versions of files that can be used for the repair, such as a path to the root directory of a mounted image.


CheckHealth, ScanHealth, RestoreHealth, Source, and LimitAccess can only be used when servicing images that are running at least Windows® 8 or Windows Server® 2012.



<

RELATED LINKS

Online Version: http://go.microsoft.com/fwlink/p/?linkid=289364
Mount-WindowsImage
Dismount-WindowsImage
Get-WindowsImage
Save-WindowsImage

REMARKS

<

Examples


Example 1

PS C:\>Repair-WindowsImage -Path C:\offline\Mount -ScanHealth



This command scans the specified image for component store corruption.






Example 2

PS C:\>Repair-WindowsImage -Path C:\offline\Mount -CheckHealth



This command checks whether the specified image has been flagged as corrupted by a failed process and whether the corruption can be repaired






Example 3

PS C:\>Repair-WindowsImage –Online -RestoreHealth -Source C:\Mounted\VHD\Windows\WinSxS, C:\Windows\TEMP -LimitAccess



This command scans the specified image for component store corruption, and then performs repair operations automatically