powershell Google Firefox
$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的更多相关文章
- 关闭 Visual Studio 2013 的 Browser Link 功能
最近公司弄新项目需要用 MVC,就把 IDE 升级到了 Visual Studio 2013,在开发的时候发现有好多请求一个本地49925的端口 . 很奇怪,一开始以为是 Visual Studio ...
- PHP(1)——学习之前做点啥准备
工欲善其事必先利其器,当然是先准备工具咯.首先硬件条件就是双核CPU以及8G内存的电脑一台,操作系统环境:windows(64bit)7+.Mac OSX 10.10+.Linux 64bit.软件环 ...
- Visual Studio 2013 Web开发、新增功能:“Browser Link”
微软正式发布Visual Studio 2013 RTM版,微软还发布了Visual Studio 2013的最终版本..NET 4.5.1以及Team Foundation Server 2013. ...
- jquery层居中,点击小图查看大图,弹出层居中代码,顶部层固定不动,滚动条滚动情况
jquery层居中,点击小图查看大图,弹出层居中代码 http://www.cnblogs.com/simpledev/p/3566280.html 见第一版,发现一个情况,如果页面内容多出一屏的情况 ...
- [bug]Syntax error, unrecognized expression: input#ctl00$ContentPlaceHolder1$Pager_input
1.在ie10上浏览页面的时候,突然发现在使用Aspnetpager的页面会有一个bug. 2. 3.查了很多解决方案,最后将vs2013中, 将该勾取消,再次浏览,你会发现就正常了,虽然该功能很强大 ...
- parseInt引发的血案
今天做了个专题活动,页面头上有个倒计时 专题做完后上线了,没发现有什么问题,结果,运营MM突然和我说:技术哥哥出问题了,360浏览器在秒数从10到09的时候直接变成 00 了! 一看我去真的,该死的3 ...
- Visual Studio 2013 Web开发、新增功能:“Browser Link”
微软正式发布Visual Studio 2013 RTM版,微软还发布了Visual Studio 2013的最终版本..NET 4.5.1以及Team Foundation Server 2013. ...
- Visual Studio 2013 的 Browser Link 功能
Visual Studio 2013 的 Browser Link 功能 最近公司弄新项目需要用 MVC,就把 IDE 升级到了 Visual Studio 2013,在开发的时候发现有好多请求一个本 ...
- Visual Studio 2013中的“Browser Link”
前几天,参加了,VS13的新特性的讲座,回来便试了一下, 默认Html会引用如下脚本: <!-- Visual Studio Browser Link --> <script typ ...
随机推荐
- Roslyn 使用 WriteLinesToFile 解决参数过长无法传入
在写 Roslyn 的时候,经常需要辅助编译的工具,而这些工具需要传入一些参数,在项目很大的时候,会发现自己传入的参数比微软限制控制台可以传入的参数大很多,这时就无法传入了参数 本文告诉大家如何使用 ...
- H3C 路由的来源
- P1045 和为给定数
题目描述 给出若干个整数,询问其中是否有一对数的和等于给定的数. 输入格式 共三行: 第一行是整数 \(n(0 \lt n \le 100000)\) ,表示有 \(n\) 个整数. 第二行是n个整数 ...
- POJ 2387 Til the Cows Come Home(最短路模板)
题目链接:http://poj.org/problem?id=2387 题意:有n个城市点,m条边,求n到1的最短路径.n<=1000; m<=2000 就是一个标准的最短路模板. #in ...
- H3CFTP操作示例
- Linux 内核PCI去除一个设备
一个 PCI 可用多个不同的方法被从系统中去除. 所有的 card-bus 设备在一个不同的物 理因素上是真正的 PCI 设备, 并且内核 PCI 核心不区分它们. 允许在机器运行时加减 PCI 设备 ...
- 路由器OpenWrt如何脱机(离线)下载BT文件
路由器OpenWrt如何脱机(离线)下载BT文件 1.首先到如下网址下载OpenWrt固件(确保为路由器正确型号). http://downloads.openwrt.org/snapshots/tr ...
- C#获取美团评价信息
闲来无事,朋友需要一家美团店铺的评价消息,索性做个小工具. 一:第一步找到目标网站 地址:https://www.meituan.com/meishi/4460141/ 二:分析网页请求 在目标网页, ...
- Vue.js provide / inject 踩坑
最近学习JavaScript,并且使用vuejs,第一次使用依赖注入,结果踩坑,差点把屏幕摔了..始终获取不到如组件的属性,provide中的this对象始终是子组件的this对象 慢慢也摸索到了些v ...
- Python 多组输入
#基于Python2.7 #若是想Python做到和C++中while(scanf()!=EOF)一样的多组输入效果,可以如实例所示书写 #实例实现了多组输入,计算A+B+C并输出的任务 while ...