📌  相关文章
📜  使用 powershell 下载和安装 virtualbox - Shell-Bash 代码示例

📅  最后修改于: 2022-03-11 14:51:01.137000             🧑  作者: Mango

代码示例1
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12;$vBoxURL = "https://download.virtualbox.org/virtualbox";Invoke-WebRequest -Uri "$vBoxURL/LATEST-STABLE.TXT" -OutFile "$env:TEMP\virtualbox-version.txt";$version = ([IO.File]::ReadAllText("$env:TEMP\virtualbox-version.txt")).trim();$vBoxList = Invoke-WebRequest "$vBoxURL/$version";$vBoxVersion =$vBoxList.Links.innerHTML;$vBoxFile = $vBoxVersion | select-string -Pattern "-win.exe";$vBoxFileURL = "$vBoxURL/$version/$vBoxFile";Invoke-WebRequest -Uri $vBoxFileURL -OutFile "$env:TEMP\$vBoxFile";start-process ("$env:TEMP\$vBoxFile") --silent;