Lock Keyboard and Mouse for Installation as example for BIOS Update

`If ($Battery -like "False") { function Lock-Screen([ScriptBlock] $Payload={Start-Sleep -Seconds 5}, $Title='Busy, go away.') { try { $window = New-Object Windows.Window $label = New-Object Windows.Controls.Label
  $label.Content = $Title
  $label.FontSize = 50
  $label.FontFamily = 'Consolas'
  $label.Background = 'Transparent'
  $label.Foreground = 'Red'
  $label.HorizontalAlignment = 'Center'
  $label.VerticalAlignment = 'Center'

  $Window.AllowsTransparency = $True
  $Window.Opacity = .7
  $window.WindowStyle = 'None'
  $window.Content = $label
  $window.Left = $window.Top = 0
  $window.WindowState = 'Maximized'
  $window.Topmost = $true

  $null = $window.Show()
  Invoke-Command -ScriptBlock $Payload
}
finally { $window.Close() }

}

$job =
{
Execute-Process -FilePath “manage-bde” -Arguments “-protectors -disable C:” -WindowStyle Hidden
sleep 10
Execute-Process -FilePath “WINUPTP.EXE” -Arguments “/S”
}

Lock-Screen -Payload $job -Title ‘ACHTUNG!!! BIOS Update läuft daher NICHT ABSCHALTEN!’
}
ELSE
{
Show-DialogBox -Title “—> BIOS UPDATE - WICHTIG INFO - BITTE LESEN <—” -Text “ACHTUNG: Das BIOS Update konnte nicht ausgeführt werden da der PC nicht am STROMNETZ angeschlossen ist! Bitte am STROMNETZ anschließen und das BIOS Update erneut starten!!!” -Icon “Exclamation” -TimeOut 600
Exit-Script -ExitCode “1618”
}`