使用powershell下载msi文件

下载Mysql的msi文件并安装


function install_msi($url) 
{
  $telemetry = @{
    DisplayName = "Mysql Service";
    filename = "mysql-installer-community-8.0.19.0.msi"
    Url = $url
  }
  Write-Host $telemetry.Url
  Write-Host 'Install TelemetryService'
  Start-BitsTransfer $telemetry.Url "$env:temp\$filename"
  $destination = "$env:temp"
  msiexec /i "$destination\mysql-installer-community-8.0.19.0.msi" /norestart INSTALLSERVICE=1 /QUIET |out-null
  Write-Host "TelemetryService installed success!"
  
}
$url = "https://cdn.mysql.com//Downloads/MySQLInstaller/mysql-installer-community-8.0.19.0.msi"
install_msi $url
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Microsoft Windows PowerShell 是一种新的命令行外壳和脚本语言,用于进行系统治理和自动化。Windows PowerShell 建立在 .NET Framework 的基础上,IT 专业人员可通过命令或脚本来治理计算机,从而通过系统自动化来提高工作效率。 Windows PowerShell 包括: * 129 个命令行工具(称为“cmdlet”),用于执行常见系统治理任务,如治理服务、进程、事件日志、证书、注册表以及使用 Windows Management Instrumentation (WMI)。 * 采用标准命名约定和通用参数的命令行工具,易于把握和使用;以及用于对数据和对象进行排序、筛选以及格式设置的简便工具。 * 对现有脚本语言、现有命令行工具以及多种 Windows 版本的支持,其中包括 Windows XP、Windows Server 2003、Windows Vista 以及 Windows Server(代码名称为“Longhorn”)。 * 方便的功能,使用户能够浏览数据存储(如注册表和证书存储),就像面对文件系统一样。 * 用于治理位于不同存储中以及采用不同格式的 Windows 数据的标准实用程序,这些数据包括 Active Directory (ADSI)、Windows Management Instrumentation (WMI)、组件对象模型 (COM) 对象、ActiveX 数据对象 (ADO)、HTML 和 XML。 * 在命令行进行的高级表达式分析和 .NET 对象处理,其中包括对对象进行流水线处理以帮助提高 IT 专业人员的工作效率。 * 可扩展的接口,使独立软件供给商和企业开发人员能够构建自定义 cmdlet 以满足特有的应用程序和系统治理要求。 安装本更新程序后,可能需要重新启动计算机。我们根据 Windows Vista 许可条款向您提供本更新程序并授予您使用许可。
v7.0.0-preview.4 - 09/19/2019 Engine Updates and Fixes Add support to ActionPreference.Break to break into debugger when Debug, Error, Information, Progress, Verbose or Warning messages are generated (#8205) (Thanks @KirkMunro!) Enable starting control panel add-ins within PowerShell Core without specifying .CPL extension. (#9828) Performance Make ForEach-Object faster for its commonly used scenarios (#10454) and fix ForEach-Object -Parallel performance problem with many runspaces (#10455) Experimental Features Update PSDesiredStateConfiguration module version to 2.0.3 and bring new tests; enable compilation to MOF on non-Windows and use of Invoke-DSCResource without LCM (#10516) Add APIs for breakpoint management in runspaces and enable attach to process without BreakAll for PowerShell Editor Services (#10338) (Thanks @KirkMunro!) Support ternary operator in PowerShell language (#10367) General Cmdlet Updates and Fixes Add PowerShell Core group policy definitions (#10468) Update console host to support XTPUSHSGR/XTPOPSGR VT control sequences that are used in composability scenarios. (#10208) Add WorkingDirectory parameter to Start-Job (#10324) (Thanks @davinci26!) Remove the event handler that was causing breakpoint changes to be erroneously replicated to the host runspace debugger (#10503) (Thanks @KirkMunro!) Replace api-ms-win-core-job-12-1-0.dll with Kernell32.dll in Microsoft.PowerShell.Commands.NativeMethods P/Invoke API(#10417) (Thanks @iSazonov!) Fix wrong output for New-Service in variable assignment and -OutVariable (#10444) (Thanks @kvprasoon!) Fix global tool issues around exit code, command line parameters and path with spaces (#10461) Fix recursion into OneDrive - change FindFirstFileEx() to use SafeFindHandle type (#10405) Skip auto-loading PSReadLine on Windows if the NVDA screen reader is active (#10385) Increase built-with-PowerShell module versions to 7.0.0.0 (#10356) Add throwing an error in Add-Type if a type with the same name already exists (#9609) (Thanks @iSazonov!)

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值