Guest User

Untitled

a guest
Jan 19th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. ## Insert under post-installation in PSADT script
  2.  
  3. ## Set temporary registry key for successful install. Will later be removed after successful detection via SCCM.
  4. Set-RegistryKey -Key 'HKEY_LOCAL_MACHINE\SOFTWARE\BIOSupdated'
  5.  
  6. ## Remove temp files.
  7. Remove-Folder "$BIOStemp\$Model"
  8.  
  9. ## Show restart prompt if user logged on. For ThinkCentre, system needs to be shut down, and then system will restart on its own.
  10. If ($Model -like "*M9*") {
  11.  
  12. ## Shut down system in 120 seconds with information.
  13. Execute-Process 'shutdown.exe' -Parameters '-s -f -t 120 -c "Your PC will restart in two minutes to finalize the update."'
  14.  
  15. ## For ThinkPads, if user is logged on, show restart countdown. Else, restart immediately.
  16. } ElseIf ($usersLoggedOn) {
  17.  
  18. Show-InstallationRestartPrompt -CountdownNoHideSeconds 120
  19.  
  20. } Else { Restart-Computer }
Add Comment
Please, Sign In to add comment