Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
Logged into org account

Brett Miller brettmillerb

💭
Logged into org account
View GitHub Profile
@brettmillerb
brettmillerb / markdown.json
Created Sep 6, 2021
Jekyll Blog Post VSCode Snippet
View markdown.json
{
// Place your snippets for markdown here. Each snippet is defined under a snippet name and has a prefix, body and
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the
// same ids are connected.
// Example:
// "Print to console": {
// "prefix": "log",
// "body": [
// "console.log('$1');",
View Get-RandomString.ps1
function Get-RandomString {
[CmdletBinding()]
param (
[Parameter(Mandatory)]
[ValidateRange(12,[int]::MaxValue)]
[int]
$StringLength,
[int]
$SpecialCharacters = 4
)
@brettmillerb
brettmillerb / setup.sh
Last active Apr 9, 2021
New Mac Setup
View setup.sh
# Check for Homebrew,
# Install if we don't have it
if test ! $(which brew); then
echo "Installing homebrew..."
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
fi
# Update homebrew recipes
echo "Updating homebrew..."
brew update
View Open-NativeApplication.ps1
function Open-NativeApplication {
[CmdletBinding()]
[Alias('open')]
param (
[Parameter()]
[ArgumentCompleter(
{
param($Command, $Parameter, $WordToComplete, $CommandAst, $FakeBoundParams)
(Get-ChildItem /Applications).name -like "$WordToComplete*" | % {"'$_'"}
}
@brettmillerb
brettmillerb / packer.json
Created Sep 15, 2020
Packer Template Windows Updates
View packer.json
{
"builders": [
{
"capture_container_name": "vsts-buildimagetask",
"capture_name_prefix": "{{user `capture_name_prefix`}}",
"client_id": "{{user `client_id`}}",
"client_secret": "{{user `client_secret`}}",
"communicator": "winrm",
"image_offer": "{{user `image_offer`}}",
"image_publisher": "{{user `image_publisher`}}",
View Get-SendGridBouncedAddress.ps1
function Get-SendGridBouncedAddress {
[CmdletBinding()]
param (
[string[]]
$EmailAddress,
[string]
$Token
)
@brettmillerb
brettmillerb / New-ObjectAttribute.ps1
Created Aug 25, 2020
Mindville API object functions
View New-ObjectAttribute.ps1
function New-ObjectAttribute {
[CmdletBinding()]
param (
[string]
$AttributeId,
[string]
$ObjectAttributeValue
)
View AddLocationsToOD4BRetentionPolicyException.ps1
<#
.SYNOPSIS
Adds Users OneDrives to a O365 Retention Policy exception list
.DESCRIPTION
Takes a CSV list of Users OneDrive urls and adds them to the specified O365 Retention Policy
exception list.
.PARAMETER
None
.EXAMPLE
None
@brettmillerb
brettmillerb / Export-AzKeyVaultCertficate.ps1
Last active May 24, 2021
Export-AzKeyVaultCertficate.ps1
View Export-AzKeyVaultCertficate.ps1
function Export-AzKeyVaultCertificate {
[CmdletBinding()]
param (
[parameter(Mandatory)]
[string]
$VaultName,
[Parameter(Mandatory)]
[string]
$CertName,
@brettmillerb
brettmillerb / Get-ElasticPoolsForMigration.ps1
Last active Aug 20, 2020
ElasticPool Migration to vCore
View Get-ElasticPoolsForMigration.ps1
[CmdletBinding()]
param (
[int]
$MigrationLimit = 1
)
$connectionName = "connectionName"
try {
# Get the connection "AzureRunAsConnection" You can't use the Az module version for reasons.
$servicePrincipalConnection = Get-AutomationConnection -Name $connectionName