Skip to content

Instantly share code, notes, and snippets.

@robderickson
robderickson / AlignmentExamples.ps1
Created July 31, 2018 15:09
Key/value alignment
@{
Something = 'this'
SomethingElse = 'that'
}
@robderickson
robderickson / gist:582efb78a71aa2a5a12bfbb050e22ec4
Created February 19, 2018 12:54
Add permission for single user to many mailboxes
function Set-CustomUserMailboxPermission {
[cmdletbinding()]
param (
[parameter(ValueFromPipeline,Mandatory)]
[string]$User,
[parameter(ValueFromPipeline,Mandatory)]
[string[]]$Mailbox,
[parameter(Mandatory)]
@robderickson
robderickson / ConfiguringVim.md
Last active March 26, 2019 09:13
Confgure VIM for Puppet on CentOS 7

Confgure VIM for Puppet on CentOS 7

Install VIM and Git

sudo yum install vim-enhanced -y
sudo yum install git -y

Download and install Puppet plugin for VIM

@robderickson
robderickson / DotSourceExample.psm1
Created June 8, 2017 13:16
Example of a PowerShell script module that uses dot sourcing
$Public = @(Get-ChildItem -Path $PSScriptRoot\Public\*.ps1 -ErrorAction SilentlyContinue)
$Private = @(Get-ChildItem -Path $PSScriptRoot\Private\*.ps1 -ErrorAction SilentlyContinue)
foreach ($import in @($Public + $Private)) {
try {
. $import.fullname
} catch {
Write-Error -Message "Failed to import function $($import.fullname): $_"
}
}
@robderickson
robderickson / HolidayHackHowTo2016.md
Last active January 4, 2017 17:36
SANS 2016 Holiday Hack Challenge

SANS 2016 Holiday Hack Challenge

Challenger: GilGrenade

Part 1: A Most Curious Business Card

Santa's business card reveals usernames for his Twitter and Instagram social media sites.

Twitter

@robderickson
robderickson / Add-ACEtoACL.ps1
Created December 9, 2016 14:03
Script to add an entry to an access control list. Wrote this four years ago, so definitely not my best work.
<#
.SYNOPSIS
Creates an access control entry (ACE) and adds it to an access control list (ACL).
.DESCRIPTION
Creates an access control entry (ACE) and adds it to an access control list (ACL).
.PARAMETER Rights
A right or list of rights to be allowed or denied by the ACE.