Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Rob Reynolds ferventcoder

🎯
Focusing
View GitHub Profile
@Chirishman
Chirishman / MaintanenceDSC.psm1
Last active Mar 12, 2019
Class Based DSC resource for patching and rebooting during specified maintenance windows
View MaintanenceDSC.psm1
class MaintenanceWindow {
[Bool]$Enabled = $true
[DateTime]$StartTime
[DateTime]$EndTime
[System.DayOfWeek[]]$DaysOfWeek = @([System.DayOfWeek]::Saturday, [System.DayOfWeek]::Sunday)
[ValidateSet('Weekly', 'Daily')][string]$Frequency
MaintenanceWindow ([DateTime]$StartTime, [DateTime]$EndTime, [String]$Frequency) {
$this.StartTime = $StartTime
$this.EndTime = $EndTime
View ConvertTo-ChocoPackage.ps1
function ConvertTo-ChocoPackage {
<#
.SYNOPSIS
Convert a PowerShell module into a chocolatey package.
.DESCRIPTION
Convert a PowerShell module into a chocolatey package.
.EXAMPLE
Find-Module pester | ConvertTo-ChocoPackage
Find the module pester on a PS repository and convert the module to a chocolatey package.
@ferventcoder
ferventcoder / .gitconfig
Last active Apr 4, 2018
Cloud boxes setup
View .gitconfig
[user]
name = Chocolatey
email = chocolatey@realdimensions.net
[core]
autocrlf = false
editor = \"C:/Program Files (x86)/GitExtensions/GitExtensions.exe\" fileeditor
filemode = false
excludesfiles = C:/Users/rob/.gitignore
symlinks = false
[diff]
@idavis
idavis / gist:c16f117c0f99eb20c49f
Created Jun 12, 2015
PowerShell Module Security
View gist:c16f117c0f99eb20c49f

I was playing around with dynamic module creation and figured out how to monkey patch modules.

I then thought about how PowerShell is a Last-In-Wins language, and tried replacing private methods.

This led to the "what if" moment of pulling [secure data out of a loaded module][]. In this case, the username and password of a credential set.

This seems like a security issue to me, or am I being over sensitive?

View gist:ecf88f45a7591686ba2f
class acl {
acl { 'c:/temp':
owner => 'SYSTEM',
group => 'Administrators',
inherit_parent_permissions => 'false',
permissions => [ { 'identity' => 'BUILTIN\Administrators', 'rights' => ['full'] } ]
}
}
class registry {
@hlindberg
hlindberg / ticketmatch.rb
Created Mar 13, 2014
Script to match puppet tickets from git log with list from jira
View ticketmatch.rb
# This script mangles the output from git log between two git references
# and matches this with a list of tickets from Jira.
#
# The List from Jira can be obtained by showing the list of issues for a release
# i.e. a query like this for the given release which gets all targeting the
# release in question:
#
# project = PUP AND fixVersion = "3.5.0" ORDER BY key ASC
#
# Then removing all columns from the output except key.
@Thermionix
Thermionix / mount.iso.psm1
Last active Jan 15, 2021
powershell mount/unmount iso for all versions of windows
View mount.iso.psm1
# Uses http://www.ltr-data.se/opencode.html/#ImDisk virtual disk driver for windows 7 or less
# Tries to use chocolatey to install imdisk
# Sample use case:
# Import-Module ".\mount.iso.psm1"
# Invoke-IsoExe "C:\test.iso" "setup.exe" "/passive"
function Mount-Iso([string] $isoPath)
{
if ( -not (Test-Path $isoPath)) { throw "$isoPath does not exist" }
View winbrew.md
@lholman
lholman / Set-BuildNumber.ps1
Last active May 9, 2016
A psake task for managing assembly versioning in .NET applications
View Set-BuildNumber.ps1
#*================================================================================================
#* Purpose: Sets the full build number ([major].[minor].[build].[revision]) in a consistent global way
#* for all builds. We purposefully only use TeamCity to generate the incrementing [build] number.
#* Set
#*================================================================================================
Task Set-BuildNumber {
$major = "1"
$minor = "0"
#Get buildCounter passed in from TeamCity, if not use zero
View .bash-constants.sh
# Reset
Color_Off="\[\033[0m\]" # Text Reset
# Regular Colors
Black="\[\033[0;30m\]" # Black
Red="\[\033[0;31m\]" # Red
Green="\[\033[0;32m\]" # Green
Yellow="\[\033[0;33m\]" # Yellow
Blue="\[\033[0;34m\]" # Blue
Purple="\[\033[0;35m\]" # Purple