zoukankan      html  css  js  c++  java
  • powershell Google Firefox

    $firefox = @{
    
      DisplayName = "Mozilla Firefox";
      filename = "Firefox Setup 68.0b7.msi"
      Url = "\10.63.32.243ShareBrowsersFirefox Setup 68.0b7.msi"
      }
      
      $Chrome = @{
      
      DisplayName = "Google Chrome";
      filename = "GoogleChromeStandaloneEnterprise64.msi"
      Url = "\10.63.32.243ShareBrowsersGoogleChromeStandaloneEnterprise64.msi"
      }
    
      function Test-Installation {
        Param([Parameter(Position = 0, Mandatory = $true)] [String] $DisplayName)
    
        $key1 = "HKLM:SOFTWAREMicrosoftWindowsCurrentVersionUninstall*"
        $key2 = "HKLM:SOFTWAREWow6432NodeMicrosoftWindowsCurrentVersionUninstall*"
        $installed1 = Get-ItemProperty -Path $key1 | Select-Object DisplayName | Where-Object { $_.DisplayName -and $_.DisplayName.Contains($DisplayName) }
        $installed2 = Get-ItemProperty -Path $key2 | Select-Object DisplayName | Where-Object { $_.DisplayName -and $_.DisplayName.Contains($DisplayName) }
        if (($null -eq $installed1) -and ($null -eq $installed2)) { return $false } else { return $true }
    }
    
    Write-Host "Step 1. Install firefox" -ForegroundColor Cyan
    if (Test-Installation -DisplayName $firefox.DisplayName) {
        Write-Host "firefox has been installed!" -ForegroundColor Green
    } else {
        Start-BitsTransfer $firefox.url "$env:temp$filename"
        $destination = "$env:temp"
        msiexec /i "$destinationFirefox Setup 68.0b7.msi" /norestart INSTALLSERVICE=1 /QUIET |out-null
        Write-Host "firefox installed success!"
        }
    
    Write-Host "Step 2. Install chrome" -ForegroundColor Cyan
    if (Test-Installation -DisplayName $chrome.DisplayName) {
        Write-Host "chrome has been installed!" -ForegroundColor Green
    } else {
        Start-BitsTransfer $chrome.url "$env:temp$filename"
        $destination = "$env:temp"
        
        msiexec /i "$destinationGoogleChromeStandaloneEnterprise64.msi" /norestart INSTALLSERVICE=1 /QUIET |out-null
        Write-Host "chrome installed success!"
        }
  • 相关阅读:
    点聚weboffice插件自定义菜单
    Delphi程序带参数运行
    64位系统下注册32位dll文件
    64位进程调用32位dll的解决方法
    memcached启动脚本以及telnet测试
    LSM树由来、设计思想以及应用到HBase的索引
    B树(B-Tree)的由来、数据结构、基本操作以及数据库索引的应用
    java读取utf8配置文件乱码
    设置某个ip对mysql服务器有权限,以及mysql定时备份
    《HBase实战》
  • 原文地址:https://www.cnblogs.com/wt7018/p/11016309.html
Copyright © 2011-2022 走看看