HP Sure Recover User Guide
Geração de um inventário
Como vários arquivos podem estar envolvidos com sua imagem dividida, use um script do PowerShell para
gerar um inventário.
Em todas as etapas restantes, você deve estar na pasta C:\staging.
CD /D C:\staging
1. Crie um script do powershell usando um editor que possa produzir um arquivo de texto no formato
UTF-8 sem BOM, usando o seguinte comando: notepad C:\staging\generate-
manifest.ps1
Crie o seguinte script:
$mftFilename = "custom.mft"
$imageVersion = 1907 (Nota: Pode ser qualquer número inteiro de 16 bits)
$header = "mft_version=1, image_version=$imageVersion"
Out-File -Encoding UTF8 -FilePath $mftFilename -InputObject $header
$swmFiles = Get-ChildItem "." -Filter "*.swm"
$ToNatural = { [regex]::Replace($_, '\d*\....$',
{ $args[0].Value.PadLeft(50) }) }
$pathToManifest = (Resolve-Path ".").Path
$total = $swmFiles.count
$current = 1
$swmFiles | Sort-Object $ToNatural | ForEach-Object {
Write-Progress
-Activity "Generating manifest" `
-Status "$current of $total ($_)" `
-PercentComplete ($current / $total * 100)
$hashObject = Get-FileHash -Algorithm SHA256 -Path $_.FullName
$fileHash = $hashObject.Hash.ToLower()
$filePath = $hashObject.Path.Replace($pathToManifest + '\', '')
$fileSize = (Get-Item $_.FullName).length
$manifestContent = "$fileHash $filePath $fileSize"
Criação de um inventário 7