GitLab Commit is coming up on August 3-4. Learn how to innovate together using GitLab, the DevOps platform. Register for free: gitlabcommitvirtual2021.com

Verified Commit 1053fceb authored by Ruben ten Hove's avatar Ruben ten Hove 🚵
Browse files

too much justice

parent f74c9d19
......@@ -64,9 +64,9 @@ choco list -e $PackageName --local-only
Set the detection rules format to _Use a custom detection script_, and upload the just created script. Make sure _Enforce script signature check and run script silently_ is set to _No_.
The above script does some fancy things:
1. It enables the `useEnhancedExitCodes` feature, which ensures the exit code is 2 when the package doesn't exist. Else it will return 0 because it had no issues checking that the package didn't exist. This setting just needs to be set once, but we just place it here to always be sure it is enabled.
1. It enables the `useEnhancedExitCodes` feature, which ensures the exit code is 2 when the package doesn't exist. Else it will return 0 because it had no issues checking that the package didn't exist. This setting just needs to be set once, but we place it here to always be sure it is enabled.
2. It retrieves the filename without the extension. This way you don't need to modify the script, but can see using the filename which package it will check for. Less prone to mistakes. You can replace the second and third line with `$PackageName = <package-name>` if you do want to place the name in the script.
3. `--local-only` ensures it uses the local index of apps, else it will always return true because the package just exists in the Chocolatey repository.
3. `--local-only` ensures it uses the local index of apps, else it will always return true because the package exists in the Chocolatey repository.
### Dependencies
Finally, make sure to set Chocolatey as a dependency.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment