代码拉取完成,页面将自动刷新
$ErrorActionPreference = 'Stop'
$repo = "hamflx/fetchbrowser"
$file = "fb.exe"
$releases = "https://gitee.com/api/v5/repos/${repo}/releases"
Write-Host Determining latest release
$tag = (Invoke-WebRequest $releases | ConvertFrom-Json)[0].tag_name
$download = "https://gitee.com/${repo}/releases/download/${tag}/${file}"
$fb_dir = "${HOME}\.fb"
$fb_bin_dir = "${fb_dir}\bin"
$fb_bin_path = "${fb_bin_dir}\$file"
New-Item "${fb_bin_dir}" -ItemType Directory -Force | Out-Null
Write-Host Dowloading latest release
Invoke-WebRequest $download -Out $fb_bin_path
$old_path = [System.Environment]::GetEnvironmentVariable("PATH", "User")
if (!(";${old_path};".ToLower() -like "*;${fb_bin_dir};*".ToLower())) {
$new_path = $old_path + [IO.Path]::PathSeparator + $fb_bin_dir
[Environment]::SetEnvironmentVariable("PATH", $new_path, "User")
$Env:Path += ";${fb_bin_dir}"
}
Write-Host "Installation successfully. ``fb`` is now available in your PATH."
Write-Host "Example: ``fb 98`` to download Chromium 98."
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。