HP Sure Recover User Manual
Generazione di un manifesto
Poiché diversi le potrebbero essere coinvolti con l'immagine suddivisa, utilizzare uno script PowerShell per
generare un manifesto.
In tutti i passaggi restanti, è necessario essere nella cartella C:\staging.
CD /D C:\staging
1. Creare uno script PowerShell utilizzando un editor in grado di produrre un le di testo in formato UTF-8
senza BOM, utilizzando il comando riportato di seguito: notepad C:\staging\generate-
manifest.ps1
Creare lo script seguente:
$mftFilename = "custom.mft"
$imageVersion = 1907 (Nota: può essere qualsiasi intero a 16 bit)
$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"
Creazione di un manifesto 7