Skip to content

Instantly share code, notes, and snippets.

View AdmiringWorm's full-sized avatar

Kim J. Nordmo AdmiringWorm

View GitHub Profile
@AdmiringWorm
AdmiringWorm / Funcs.md
Last active March 20, 2021 14:19
PowerShell function not to use in Chocolatey community packages

There are some rules regarding which functions can be used in in Chocolatey packages hosted on the community repository. Basically, any function not available in PowerShell v2.0 can not be used (without a fallback helper). In this gist I want to keep a list of functions that were not available in PowerShell 2.0, or I have found that did not work as expected.

  • Convert-FromJson - while it is a common function nowadays, this was only added in PowerShell 3.0 and can not be used in a community package.
  • Get-ItemPropertyValue - added in PowerShell 5.0, and do not exist on the Chocolatey verifier.
  • Import-Certificate - Only available on some Server platforms (and Windows 10). As an alternative the linked fallback helper can be used instead
@AdmiringWorm
AdmiringWorm / Roadmap.md
Created June 30, 2020 15:00
Chocolatey Package Request Repository Validator

This document contains the current features that are planned/wanted to be implemented for the package validator (and upcoming status checker) on the chocolatey package request repository. There is guarantee that any/all of these features will be implemented, nor when this may happen.

0.2.0 (In Progress)

Planned

  • Implement versioning of module (not important, but can be useful in certain scenarios)
@AdmiringWorm
AdmiringWorm / Update-AUPackages.md
Created April 24, 2020 08:57
Update-AUPackages Report #powershell #chocolatey
@AdmiringWorm
AdmiringWorm / Update-AUPackages.md
Created April 24, 2020 08:56
Update-AUPackages Report #powershell #chocolatey
@AdmiringWorm
AdmiringWorm / choco color
Created January 20, 2020 20:50
Chocolatey colors for vscode
{
"workbench.colorCustomizations": {
"activityBar.background": "#aacdec",
"activityBar.activeBorder": "#6F3215",
"activityBar.foreground": "#242c5c",
"activityBar.inactiveForeground": "#242c5c99",
"activityBarBadge.background": "#6F3215",
"activityBarBadge.foreground": "#e7e7e7",
"titleBar.activeBackground": "#80b5e3",
"titleBar.inactiveBackground": "#80b5e399",
@AdmiringWorm
AdmiringWorm / codecov.cake
Last active May 16, 2019 00:47
Collection of cake scripts used to override Cake.Recipe tasks
#load "./modules.cake"
#if !CUSTOM_CODECOV
Setup<CodecovSettings>((context) => {
var settings = new CodecovSettings {
Required = true
};
if (BuildParameters.Version != null && !string.IsNullOrEmpty(BuildParameters.Version.FullSemVersion) && BuildParameters.IsRunningOnAppVeyor) {
// Required to work correctly with appveyor because environment changes isn't detected until cake is done running.
@AdmiringWorm
AdmiringWorm / maintainers.md
Last active September 17, 2020 12:44
@pauby's cheat sheet for what a maintainer can do 👅

What can you do as a maintainer?

The goal of this gist is to provide some details on what you can do and can't do on chocolatey.org when you are a maintainer.

  • You can not remove yourself as a maintainer for packages available on chocolatey.org. You will need to contact the site admins to be removed from a package. You will not be removed as a maintainer if you are the only maintainer listed.
  • When a new package have been pushed to chocolatey.org, a new version of the same package can not be pushed until the existing version is either approved or rejected. If the package is failing, the recommended solution is to update the existing version which fixes the failure reason. When this isn't possible, you can rejected a failing version yourself, or ask a Moderator to rejected it.
@AdmiringWorm
AdmiringWorm / POSHv2 Read-Only aliases.md
Created November 17, 2017 16:21
List of aliases that are Read-Only in Powershell V2

List of aliases that are Read-Only in Powershell V2

PS C:\Users\Administrator> gal | ? { $_.options -match 'readonly' } | ft Name,Definition -a

Name    Definition
----    ----------
%       ForEach-Object
?       Where-Object
ac      Add-Content
@AdmiringWorm
AdmiringWorm / dotnet-add.txt
Created March 19, 2017 20:51
dotnet 1.1.0.1179 help pages
Usage: dotnet add [arguments] [options] [command]
Arguments:
<PROJECT> The project file to operate on. If a file is not specified, the command will search the current directory for one.
Options:
-h|--help Show help information
Commands:
package Command to add package reference
@AdmiringWorm
AdmiringWorm / chocolateyEnvironmentVars.md
Last active April 3, 2022 18:46
Environment variables set when powershell script is running through choco

Environment variables set when powershell script is running through choco

NOTE: All of the following variables need to be prefixed with $env:

  • CHOCOLATEY_VERSION: 0.10.3.0
  • CHOCOLATEY_VERSION_PRODUCT: 0.10.3 (EXPERIMENTAL)
  • ChocolateyForce - $true if the user passed --force when installing, otherwise not set
  • ChocolateyInstall - Set to the path where choco is installed.
  • chocolateyInstallArguments - The extra arguments the user have passed to the installer (EXPERIMENTAL)
  • chocolateyInstallOverride - $true if the user passed --notsilent (EXPERIMENTAL)
  • ChocolateyPackageFolder - The path to where the package content is cached