Chocolatey

if (Check-Command -cmdname 'choco') {
    Write-Host "Choco is already installed, skip installation."
}
else {
    Write-Host ""
    Write-Host "Installing Chocolate for Windows..." -ForegroundColor Green
    Write-Host "------------------------------------" -ForegroundColor Green
    $env:ChocolateyInstall='D:\PF\Program\ChocolateyInstall'
    [Environment]::SetEnvironmentVariable('ChocolateyInstall', $env:ChocolateyInstall, 'Machine')
    Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
    
}
$env:ChocolateyInstall='D:\PF\Program\ChocolateyInstall' 
自定义Chocolatey 安装路径
posted @ 2022-02-28 10:11  是绵羊在漫步  阅读(98)  评论(0编辑  收藏  举报