Advertisement
Guest User

PowerShell PDQ Install Script

a guest
Jan 19th, 2018
519
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.44 KB | None | 0 0
  1. #Google Chrome Enterprse Example
  2.  
  3. $Date = Get-Date
  4. #Check if the install location of Google Chrome Enterprise exists, for example, and if not then start the install
  5. If (!(Test-Path "Path:\File\Software")) {
  6. try {
  7. #not sure if this set-location is necessary but I do it just in case
  8. Set-Location '\\Network\Share\Location'
  9. #starts the install via msiexec.exe
  10. Start-Process msiexec.exe -Wait -ArgumentList '/passive /qb /I .\googlechromestandaloneenterprise64.msi'
  11. #writes output of the computer that successfully install GCE into a log for successful installs
  12. Write-Output "$env:COMPUTERNAME has successfully installed Google Chrome Enterprise (64-bit). | $Date" | Out-File "\\Computer\Share\Name\Path\Google Chrome Enterprise Installs.txt" -Append
  13. }
  14. catch {
  15. #catches any errors and writes this Output below into an error log so that I can review it later
  16. Write-Output "$env:COMPUTERNAME was unable to install Google Chrome Enterprise (64-bit). Refer to the Event Log Viewer for more information. | $Date" | Out-File "\\Computer\Share\Name\Path\Google Chrome Enterprise Errors.txt" -Append
  17. }
  18. Else {
  19. #writes to a separate log if the target machine already has GCE installed
  20. Write-Output "$env:COMPUTERNAME already has Google Chrome Enterprise (64-bit) installed. | $Date" | Out-File "\\Computer\Share\Name\Path\Google Chrome Enterprise Installs.txt" -Append
  21. }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement