简体   繁体   English

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

[英]How do I use Chocolatey if Group Policy is blocking 7zip?

I tried to use chocolatey and it seems that my work restricted this for some reason. 我试图使用巧克力,似乎我的工作因某种原因限制了这一点。 Is there any way to make it install correctly in a corporate workplace? 有没有办法让它在企业工作场所正确安装?

This is my current output when trying to install chocolatey (complains about being blocked by group policy) 这是我尝试安装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

For system administrators, Chocolatey is extremely corporate friendly. 对于系统管理员,Chocolatey非常友好。 You set up your own custom server and create packages that are internal, accessing internal resources. 您可以设置自己的自定义服务器并创建内部包,访问内部资源。 You disable the default source (chocolatey.org). 您禁用默认源(chocolatey.org)。 There are numerous companies doing this now. 现在有很多公司这样做。

Chocolatey.org (aka the community feed) is what may not be corporate friendly. Chocolatey.org(又名社区饲料)可能不是公司友好的。

For folks not in ops, you should see what your sysadmins are interested in allowing. 对于不在操作系统中的人,您应该看到您的系统管理员有兴趣允许的内容。 From your post, it looks like they don't like the usage of 7zip. 从你的帖子看,他们似乎不喜欢7zip的用法。 However it is not required. 但是,这不是必需的。 Take a look at the Puppet provider - https://forge.puppetlabs.com/chocolatey/chocolatey#use-an-internal-chocolateynupkg-for-chocolatey-installation or alternative installation methods at https://github.com/chocolatey/choco/wiki/Installation . 看看木偶提供商- https://forge.puppetlabs.com/chocolatey/chocolatey#use-an-internal-chocolateynupkg-for-chocolatey-installation或替代安装方法https://github.com/chocolatey/ choco / wiki /安装

There are other package management systems for Windows, one of the better known ones is Ninite. Windows还有其他软件包管理系统,其中一个比较着名的是Ninite。 You can find a compare/contrast between Chocolatey and Ninite here: 你可以在这里找到Chocolatey和Ninite之间的比较/对比:

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

And some more information about "Why" you might want to use Chocolatey here: 还有一些关于“为什么”你可能想在这里使用Chocolatey的信息:

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

NOTE: Full disclosure, I am part of the Chocolatey Development Team :-) 注意:完全披露,我是Chocolatey开发团队的一员:-)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM