0

我无法通过 MDT 安装巧克力。我必须将其安装为非管理安装,我从巧克力网站复制了安装脚本,但它无法按我的意愿工作。

Set-ExecutionPolicy Bypass -Scope Process -Force;

# Set directory for installation - Chocolatey does not lock
# down the directory if not the default
$InstallDir='C:\ProgramData\chocoportable'
$env:ChocolateyInstall="$InstallDir"

# If your PowerShell Execution policy is restrictive, you may
# not be able to get around that. Try setting your session to
# Bypass.
Set-ExecutionPolicy Bypass -Scope Process -Force;

# All install options - offline, proxy, etc at
# https://chocolatey.org/install
iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))

在任务序列步骤中,它非常快速地完成了任务,甚至没有安装巧克力。

另外我创建了一个小脚本,它看起来像这样:

choco install microsoft-teams.install --confirm
choco install office365business --confirm

很不言自明。

4

0 回答 0