How do you extract the Install Chocolate arguments?

How do you extract the arguments to install Chocolatey? I know how to get parameters: $pp = Get-PackageParametersbut not install args. In particular, I want to see if --forceX86or flags are set --x86.

+4
source share
1 answer

Reply from Kim J. Nordmo @AdmiringWorm on the Chocolatey Gitter Channel.

@dhoer, as far as I know, there is no way to get all the arguments, just the arguments passed with --package-args.

However, if you only need to find out if the user is trying to force --x86, then you can check if the next environment variable is $env:chocolateyForceX86$ true

Example

if ((Get-ProcessorBits 32) -or $env:ChocolateyForceX86 -eq $true) {}
+3

Source: https://habr.com/ru/post/1684571/


All Articles