简体   繁体   中英

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)

@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. You set up your own custom server and create packages that are internal, accessing internal resources. You disable the default source (chocolatey.org). There are numerous companies doing this now.

Chocolatey.org (aka the community feed) is what may not be corporate friendly.

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. 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 .

There are other package management systems for Windows, one of the better known ones is Ninite. You can find a compare/contrast between Chocolatey and Ninite here:

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

And some more information about "Why" you might want to use Chocolatey here:

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

NOTE: Full disclosure, I am part of the Chocolatey Development Team :-)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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