Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Brett Miller brettmillerb

🏠
Working from home
View GitHub Profile
@brettmillerb
brettmillerb / azure-pipelines.yml
Created Jul 7, 2022
Stackoverflow Pipelines Example
View azure-pipelines.yml
- task: AzureCLI@2
displayName: Check Azure Functions Deployed
env:
RESOURCE_GROUP: $(ResourceGroup)
FUNCTION_NAME: $(FunctionName)
inputs:
azureSubscription: Microsoft Azure Subscription
scriptType: bash
scriptLocation: inlineScript
inlineScript: |
@brettmillerb
brettmillerb / Get-QuotaPercentage.ps1
Created Jan 18, 2022
PowerShell Azure Subscription Quota Percentage Helper Function
View Get-QuotaPercentage.ps1
function Get-QuotaPercentage {
[CmdletBinding()]
param (
[Parameter(Mandatory,
ValueFromPipeline)]
$InputObject
)
process {
foreach ($item in $InputObject) {
@brettmillerb
brettmillerb / AdHealthCheck.ps1
Created Dec 8, 2021
AD Health Check Report - Really Old Example
View AdHealthCheck.ps1
[CmdletBinding()]
Param(
[String]$domainname = 'domain.com',
[String]$reportpath = "E:\ADHealthReport\",
[String]$percentlow = 10,
[String]$sendemailtime = "07.00A"
)
@brettmillerb
brettmillerb / Set-VSCodesettings.ps1
Created Nov 5, 2021
PowerShell function to set VSCode settings.json properties
View Set-VSCodesettings.ps1
function Set-VSCodeSetting {
<#
.SYNOPSIS
Function for setting VS Code settings from command line
.DESCRIPTION
This function allows programmatic update of VS Code settings.json file
.PARAMETER FontSize
The font size to set
@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
)