Compare commits

...

3 Commits

Author SHA1 Message Date
1473d34fb8 Enable booting to PE 2024-08-06 18:56:59 +01:00
59ec83c10a Add some output to PS script 2024-08-06 18:46:29 +01:00
277aaa8a6c Make directories in batch script 2024-08-06 18:46:22 +01:00
2 changed files with 10 additions and 2 deletions

View File

@ -33,6 +33,7 @@ set StagingDir=%TEMP%\SRBW
set RemoteURL="https://git.mrmeeb.stream/MrMeeb/sure-recover-boot-wiper/raw/branch/main/payload"
mkdir %StagingDir%
mkdir C:\Sources
powershell -Command Invoke-WebRequest %RemoteURL%/run.ps1 -OutFile %StagingDir%\run.ps1

View File

@ -7,15 +7,17 @@ $StagingDir = $PSScriptRoot
$ProgressPreference = 'SilentlyContinue'
# Download compressed boot dir to Staging Dir
Write-Host "Downloading boot.zip"
Invoke-WebRequest -Uri $RemoteURL/boot.zip -OutFile $StagingDir\boot.zip
# Expand boot.zip to C:\Boot
Expand-Archive -Path $StagingDir\boot.zip -DestinationPath C:\ -Force
# Download WinPE wim to C:\Sources\boot.wim
New-Item -ItemType "Directory" -Path C:\Sources -Force
Write-Host "Downloading boot.wim"
Invoke-WebRequest -Uri $RemoteURL/boot.wim -OutFile C:\Sources\boot.wim
# Setup booting to PE next boot
function BootToPE {
@ -77,4 +79,9 @@ function BootToPE {
}
Remove-Item -Path $StagingDir -Recurse
$answer = read-host "Demo armed. Ready to reboot? (y/n)"
if ($answer -eq 'y') {
BootToPE
} else {
Remove-Item -Path $StagingDir -Recurse
}