如果组策略阻止7zip,我该如何使用Chocolatey?

时间:2015-10-07 10:57:15

标签: windows powershell package-managers chocolatey

我试图使用巧克力,似乎我的工作因某种原因限制了这一点。有没有办法让它在企业工作场所正确安装?

这是我尝试安装chocolatey时的当前输出(抱怨被组策略阻止)

@powershell -NoProfile -ExecutionPolicy Bypass -Command "iex((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin
Downloading https://chocolatey.org/api/v2/package/chocolatey/ to C:\Users\USER\AppData\Local\Temp\chocolatey\chocInstall\chocolatey.zip
Download 7Zip commandline tool
Downloading https://chocolatey.org/7za.exe to C:\Users\USER\AppData\Local\Temp\chocolatey\chocInstall\7za.exe
Extracting C:\Users\USER\AppData\Local\Temp\chocolatey\chocInstall\chocolatey.zip to C:\Users\USER\AppData\Local\Temp\chocolatey\chocInstall...
Start-Process : This command cannot be run due to the error: This program is blocked by group policy. For more information, contact your system administrator.
At line:66 char:1 + Start-Process "$7zaExe" -ArgumentList "x -o`"$tempDir`" -y `"$file`"" -Wait -NoN ...
    + CategoryInfo          : InvalidOperation: (:) [Start-Process], InvalidOperationException
    + FullyQualifiedErrorId : InvalidOperationException,Microsoft.PowerShell.Commands.StartProcessCommand

Installing chocolatey on this machine & : The term 'C:\Users\USER\AppData\Local\Temp\chocolatey\chocInstall\tools\chocolateyInstall.ps1' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:77 char:3 + & $chocInstallPS1
    + CategoryInfo : ObjectNotFound: (C:\Users\USER...ateyInstall.ps1:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

2 个答案:

答案 0 :(得分:3)

对于系统管理员,Chocolatey非常友好。您可以设置自己的自定义服务器并创建内部包,访问内部资源。您禁用默认源(chocolatey.org)。现在有很多公司这样做。

Chocolatey.org(又名社区饲料)可能不是公司友好的。

对于不在操作系统中的人,您应该看到您的系统管理员有兴趣允许的内容。从你的帖子看,他们似乎不喜欢7zip的使用。但是,这不是必需的。在https://forge.puppetlabs.com/chocolatey/chocolatey#use-an-internal-chocolateynupkg-for-chocolatey-installation查看Puppet提供程序 - https://github.com/chocolatey/choco/wiki/Installation或其他安装方法。

答案 1 :(得分:0)

Windows还有其他软件包管理系统,其中一个比较着名的是Ninite。你可以在这里找到Chocolatey和Ninite之间的比较/对比:

https://github.com/chocolatey/choco/wiki/ChocolateyVsNinite

更多关于"为什么"你可能想在这里使用Chocolatey:

https://github.com/chocolatey/choco/wiki/Why

注意:完全披露,我是Chocolatey开发团队的一员: - )