$firefox = @{

  DisplayName = "Mozilla Firefox";
filename = "Firefox Setup 68.0b7.msi"
Url = "\\10.63.32.243\Share\Browsers\Firefox Setup 68.0b7.msi"
} $Chrome = @{ DisplayName = "Google Chrome";
filename = "GoogleChromeStandaloneEnterprise64.msi"
Url = "\\10.63.32.243\Share\Browsers\GoogleChromeStandaloneEnterprise64.msi"
} function Test-Installation {
Param([Parameter(Position = 0, Mandatory = $true)] [String] $DisplayName) $key1 = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*"
$key2 = "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*"
$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 "$destination\Firefox 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 "$destination\GoogleChromeStandaloneEnterprise64.msi" /norestart INSTALLSERVICE=1 /QUIET |out-null
Write-Host "chrome installed success!"
}

powershell Google Firefox的更多相关文章

  1. 关闭 Visual Studio 2013 的 Browser Link 功能

    最近公司弄新项目需要用 MVC,就把 IDE 升级到了 Visual Studio 2013,在开发的时候发现有好多请求一个本地49925的端口 . 很奇怪,一开始以为是 Visual Studio ...

  2. PHP(1)——学习之前做点啥准备

    工欲善其事必先利其器,当然是先准备工具咯.首先硬件条件就是双核CPU以及8G内存的电脑一台,操作系统环境:windows(64bit)7+.Mac OSX 10.10+.Linux 64bit.软件环 ...

  3. Visual Studio 2013 Web开发、新增功能:“Browser Link”

    微软正式发布Visual Studio 2013 RTM版,微软还发布了Visual Studio 2013的最终版本..NET 4.5.1以及Team Foundation Server 2013. ...

  4. jquery层居中,点击小图查看大图,弹出层居中代码,顶部层固定不动,滚动条滚动情况

    jquery层居中,点击小图查看大图,弹出层居中代码 http://www.cnblogs.com/simpledev/p/3566280.html 见第一版,发现一个情况,如果页面内容多出一屏的情况 ...

  5. [bug]Syntax error, unrecognized expression: input#ctl00$ContentPlaceHolder1$Pager_input

    1.在ie10上浏览页面的时候,突然发现在使用Aspnetpager的页面会有一个bug. 2. 3.查了很多解决方案,最后将vs2013中, 将该勾取消,再次浏览,你会发现就正常了,虽然该功能很强大 ...

  6. parseInt引发的血案

    今天做了个专题活动,页面头上有个倒计时 专题做完后上线了,没发现有什么问题,结果,运营MM突然和我说:技术哥哥出问题了,360浏览器在秒数从10到09的时候直接变成 00 了! 一看我去真的,该死的3 ...

  7. Visual Studio 2013 Web开发、新增功能:“Browser Link”

    微软正式发布Visual Studio 2013 RTM版,微软还发布了Visual Studio 2013的最终版本..NET 4.5.1以及Team Foundation Server 2013. ...

  8. Visual Studio 2013 的 Browser Link 功能

    Visual Studio 2013 的 Browser Link 功能 最近公司弄新项目需要用 MVC,就把 IDE 升级到了 Visual Studio 2013,在开发的时候发现有好多请求一个本 ...

  9. Visual Studio 2013中的“Browser Link”

    前几天,参加了,VS13的新特性的讲座,回来便试了一下, 默认Html会引用如下脚本: <!-- Visual Studio Browser Link --> <script typ ...

随机推荐

  1. P1076 单词覆盖还原

    题目描述 一个长度为 \(l(3\le l\le 255)\) 的字符串中被反复贴有 boy 和 girl 两单词,后贴上的可能覆盖已贴上的单词(没有被覆盖的用句点表示),最终每个单词至少有一个字符没 ...

  2. H3C 常用的IPv6地址类型及格式

  3. eclipse中maven报错--Dmaven.multiModuleProjectDirectory system propery is not set. Check $M2_HOME environment variable and mvn script match.

    -Dmaven.multiModuleProjectDirectory system propery is not set. Check $M2_HOME environment variable a ...

  4. Winform C#关于utf8编码问题

    public string SendDataByPost(string param, string Url) { try { HttpWebRequest request = (HttpWebRequ ...

  5. C++虚继承初识

    struct Employee { ... }; struct Manager : Employee { ... }; struct Worker : Employee { ... }; struct ...

  6. Android多媒体框架

    Android系统的多媒体架构图 OpenMax做编解码作用(codec),从上到下依次是AL(应用层,在多媒体中间件和应用程序之间提供一个标准化接口).IL(集成层,解码编码器).DL(开发层,供应 ...

  7. 【Spring Cloud 源码解读】之 【这也太神奇了,RestTemplate加上一个@LoadBalanced注解就能实现负载均衡!】

    前提概要: 前天,有个前端大佬问了我两个问题:为啥不引入Ribbon依赖就能使用Ribbon?为啥RestTemplate加上@LoadBalanced注解就能负载均衡了?我也表示很疑惑,而我自己其实 ...

  8. 通过9个Linux-0.11实验学习操作系统

    简介 2019年秋,我自学了一下哈工大的操作系统课程,感觉其设计的教程和实验作为操作系统入门是个不错的选择(虽然是基于较老的Linux-0.11写的).实验大致覆盖了操作系统中的核心概念,例如启动.中 ...

  9. JavaScript中浅拷贝和深拷贝的区别

    JavaScript数据类型 基础数据类型:保存在栈内存中的简单数据段 ,有undefined,boolean,number,string,null 引用数据类型:Array,object,Funct ...

  10. 浅谈Linux下/etc/passwd文件

    浅谈Linux 下/etc/passwd文件 看过了很多渗透测试的文章,发现在很多文章中都会有/etc/passwd这个文件,那么,这个文件中到底有些什么内容呢?下面我们来详细的介绍一下. 在Linu ...