Files
2026-11-13 07:52:38 +03:00

16 lines
925 B
PowerShell

# Синхронизация g4d-меню: шаблон -> рабочий файл в корне раздела.
# Использование: powershell -File C:\PF\g4d-sync.ps1
$ErrorActionPreference = 'Stop'
$template = 'F:\efi\Paravis\Boot\g4d\grldr'
$working = 'F:\grldr'
if (-not (Test-Path $template)) { throw "нет шаблона: $template" }
if (Get-Process -Name vmware-vmx -ErrorAction SilentlyContinue) { throw 'VM запущена — сначала выключите' }
Copy-Item $template $working -Force
$h1 = (Get-FileHash $template -Algorithm SHA256).Hash
$h2 = (Get-FileHash $working -Algorithm SHA256).Hash
' шаблон: {0:N0} байт {1}' -f (Get-Item $template).Length, $h1.Substring(0,16)
' корень: {0:N0} байт {1}' -f (Get-Item $working).Length, $h2.Substring(0,16)
' {0}' -f $(if ($h1 -eq $h2) { 'OK: синхронизировано' } else { 'РАСХОЖДЕНИЕ' })