Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Rob Reynolds ferventcoder

🎯
Focusing
View GitHub Profile
@ferventcoder
ferventcoder / ChocoInternalHost.sh
Last active Mar 26, 2016
Automatic Variables In PowerShell - Attempting to detect differences between PowerShell and System.Management.Automation Custom PowerShell Host
View ChocoInternalHost.sh
$$ = ''
$? = 'True'
$^ = ''
$_ = ''
$args = ''
$ConfirmPreference = 'High'
$ConsoleFileName = ''
$CurrentlyExecutingCommand = ''
$DebugPreference = 'Continue'
$Error = ''
@ferventcoder
ferventcoder / error.txt
Created Mar 21, 2016 — forked from scowalt/error.txt
Chocolatey error
View error.txt
Chocolatey is running on Windows v 10.0.14286.0
Attempting to delete file "C:/ProgramData/chocolatey/choco.exe.old".
Attempting to delete file "C:\ProgramData\chocolatey\choco.exe.old".
Command line: "C:\ProgramData\chocolatey\choco.exe" install -y eraser --debug --verbose
Received arguments: install -y eraser --debug --verbose
NOTE: Hiding sensitive configuration data! Please double and triple
check to be sure no sensitive data is shown, especially if copying
output to a gist for review.
Configuration: CommandName='install'|
View ChocoTabExpansion.ps1
$ChocolateyProfile = "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1"
if (Test-Path($ChocolateyProfile)) {
Import-Module "$ChocolateyProfile"
}
@ferventcoder
ferventcoder / RubyStack.ps1
Last active Apr 5, 2018
Full Ruby Stack Install using Chocolatey and PowerShell
View RubyStack.ps1
# https://github.com/chocolatey/choco/wiki/CommandsReference#how-to-pass-options--switches
# Powershell specific argument passing
# You must be on the latest beta of chocolatey for this to work properly (redownload files)
choco upgrade chocolatey -pre
$originalPath = $env:PATH
choco install ruby --version 1.9.3.55100 -my --install-arguments '/verysilent /dir=""c:\tools\ruby193"" /tasks=""assocfiles""' --override-arguments
# DevKit for Ruby 1.x
View ChocolateyAndPuppetTogetherForTheWin.md

Once you get a taste, it's like an obsession. Chocolatey is the package manager for Windows. Puppet is the Configuration Manager. Put them together and you have a super power to deliver better solutions faster. Puppet and Chocolatey have been used successfully in organizations, from large to small, to transform development and operations on Windows. You may have used and/or presently use one or both of these. Come to learn how things have changed, where the future lies, and how you can be a part of it. The future is now.

View Vagrantfile.rb
# somewhere around line 81 in https://github.com/chocolatey/chocolatey-test-environment/blob/master/Vagrantfile
config.vm.provision :shell, :path => "shell/PrepareWindows.ps1" #, :powershell_elevated_interactive => true
config.vm.provision :shell, :path => "shell/InstallNet4.ps1" #, :powershell_elevated_interactive => true
config.vm.provision :shell, :path => "shell/InstallChocolatey.ps1" #, :keep_color => true, :powershell_elevated_interactive => true
config.vm.provision :shell, :path => "shell/NotifyGuiAppsOfEnvironmentChanges.ps1" #, :powershell_elevated_interactive => true
# [..snip..]
config.vm.provision :shell, :inline => $packageTestScript #, :powershell_elevated_interactive => true
@ferventcoder
ferventcoder / PackageFailingRequirements.md
Created Dec 1, 2015
Here's an example of the package validator in action. It's validating a package that has been submitted.
View PackageFailingRequirements.md
Requirements

When a package version has failed requirements, the package version requires fixing or response by the maintainer. If items are flagged correctly, they must be fixed before the package version can be approved. The exact same version should be uploaded during moderation review.

  • If you are going to fill in copyright, please use more than 4 characters.
  • Tags (tags) are space separated values for referencing categories for software. Please don't use comma to separate tags.
Guidelines

Guidelines are strong suggestions that improve the quality of a package version. These are considered something to fix for next time to increase the quality of the package. Over time guidelines can become requirements. A package version can be approved without addressing guideline comments but will reduce the quality of the package.

  • The nuspec has been enhanced to allow you to put in packageSourceUrl, pointing to the url where this package source resides. Consider adding it to the nuspec.
@ferventcoder
ferventcoder / Latest_Chocolatey_Version.ps1
Created Nov 30, 2015
Get Latest Version of Chocolatey from a NuGet OData Endpoint
View Latest_Chocolatey_Version.ps1
$versionUrl = 'http://[NuGetEndpoint]/Packages()?$filter=((Id%20eq%20%27chocolatey%27)%20and%20(not%20IsPrerelease))%20and%20IsLatestVersion'
$downloader = new-object System.Net.WebClient
$downloader.Proxy.Credentials=[System.Net.CredentialCache]::DefaultNetworkCredentials;
Write-Output "Querying latest package from $url"
[xml]$pkg = $downloader.DownloadString($versionUrl)
$latestPackageVersionUrl = $pkg.feed.entry.content.src
View S3_PublicReadPolicy.json
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "PublicReadGetObject",
"Effect": "Allow",
"Principal": {
"AWS": "*"
},
"Action": "s3:GetObject",
View chocolatey_demo.pp
case $operatingsystem {
'windows': {
Package {
provider => chocolatey,
}
}
}
include chocolatey
include chocolatey_server