Guest User

Untitled

a guest
Jan 19th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. ## Insert under installation phase in PSADT script
  2.  
  3. ## Show installation progress
  4. Show-InstallationProgress -StatusMessage 'BIOS is being updated. Do not turn off your PC.'
  5.  
  6. ## Get model of the PC, split the last string, which is the model.
  7. $Model = ((Get-WmiObject -Class Win32_ComputerSystemProduct).Version).Split()[-1]
  8.  
  9. ## Set variable for folder to which files will be copied to.
  10. $BIOStemp = "$envSystemDrive\Temp"
  11.  
  12. ## Copy files for the correct model.
  13. Copy-File -Path "$dirFiles\$Model" -Destination $BIOStemp -Recurse
  14.  
  15. ## Perform BIOS update, depending on if ThinkCentre or ThinkPad (default). For ThinkPads, ignore exit code 1 (success).
  16. Switch -Wildcard ($Model) {
  17.  
  18. "*M9*" {Execute-Process "$BIOStemp\$Model\flash64.cmd" -Parameters "/quiet /sccm"}
  19. default {Execute-Process "$BIOStemp\$Model\winuptp64.exe" -Parameters "-s" -IgnoreExitCodes '1'}
  20. }
Add Comment
Please, Sign In to add comment