Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Google Chrome Enterprse Example
- $Date = Get-Date
- #Check if the install location of Google Chrome Enterprise exists, for example, and if not then start the install
- If (!(Test-Path "Path:\File\Software")) {
- try {
- #not sure if this set-location is necessary but I do it just in case
- Set-Location '\\Network\Share\Location'
- #starts the install via msiexec.exe
- Start-Process msiexec.exe -Wait -ArgumentList '/passive /qb /I .\googlechromestandaloneenterprise64.msi'
- #writes output of the computer that successfully install GCE into a log for successful installs
- 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
- }
- catch {
- #catches any errors and writes this Output below into an error log so that I can review it later
- 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
- }
- Else {
- #writes to a separate log if the target machine already has GCE installed
- 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
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement