Skip to content

Instantly share code, notes, and snippets.

View ferventcoder's full-sized avatar
🎯
Focusing

Rob Reynolds ferventcoder

🎯
Focusing
View GitHub Profile
@Chirishman
Chirishman / MaintanenceDSC.psm1
Last active March 12, 2019 16:51
Class Based DSC resource for patching and rebooting during specified maintenance windows
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
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 April 4, 2018 00:44
Cloud boxes setup
[user]
name = Chocolatey
email = [email protected]
[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 June 12, 2015 16:46
PowerShell Module Security

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?

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 March 13, 2014 01:05
Script to match puppet tickets from git log with list from jira
# 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 November 15, 2022 10:39
powershell mount/unmount iso for all versions of windows
# 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" }
@nddrylliog
nddrylliog / winbrew.md
Last active December 20, 2015 16:19
Winbrew
@lholman
lholman / Set-BuildNumber.ps1
Last active May 9, 2016 11:41
A psake task for managing assembly versioning in .NET applications
#*================================================================================================
#* 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
@ferventcoder
ferventcoder / .bash-constants.sh
Last active July 29, 2020 18:51
Git bash setup
# 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