Skip to content

Instantly share code, notes, and snippets.

View brettmillerb's full-sized avatar
🏠
Working from home

Brett Miller brettmillerb

🏠
Working from home
View GitHub Profile
@brettmillerb
brettmillerb / Get-AzCachedAccessToken.ps1
Created March 15, 2019 13:22
Get-AzCachedAccessToken
function Get-AzCachedAccessToken {
<#
.SYNOPSIS
Get the Bearer token from the currently set AzContext
.DESCRIPTION
Get the Bearer token from the currently set AzContext. Retrieves from Get-AzContext
.EXAMPLE
Get-AzCachedAccesstoken
@brettmillerb
brettmillerb / zshrc-theme
Last active August 25, 2022 06:09
.zshrc | macOs
# Path to your oh-my-zsh installation.
export ZSH="/Users/brett.miller/.oh-my-zsh"
export PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
# Set name of the theme to load
ZSH_THEME="powerlevel9k/powerlevel9k"
DISABLE_AUTO_TITLE="true"
# Plugins
@brettmillerb
brettmillerb / azure-pipelines.yml
Created July 7, 2022 08:59
Stackoverflow Pipelines Example
- 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 / Export-AzKeyVaultCertficate.ps1
Last active May 23, 2022 18:20
Export-AzKeyVaultCertficate.ps1
function Export-AzKeyVaultCertificate {
[CmdletBinding()]
param (
[parameter(Mandatory)]
[string]
$VaultName,
[Parameter(Mandatory)]
[string]
$CertName,
@brettmillerb
brettmillerb / Get-QuotaPercentage.ps1
Created January 18, 2022 15:27
PowerShell Azure Subscription Quota Percentage Helper Function
function Get-QuotaPercentage {
[CmdletBinding()]
param (
[Parameter(Mandatory,
ValueFromPipeline)]
$InputObject
)
process {
foreach ($item in $InputObject) {
@brettmillerb
brettmillerb / profile.ps1
Last active January 18, 2022 00:46
Mac Pwsh Profile
Import-Module -Name Toolbox
Import-Module -Name Microsoft.PowerShell.UnixCompleters
Import-Module -Name Terminal-Icons
function BackOne {
Set-Location ..
}
function BackTwo {
Set-Location ../..
}
@brettmillerb
brettmillerb / AdHealthCheck.ps1
Created December 8, 2021 12:37
AD Health Check Report - Really Old Example
[CmdletBinding()]
Param(
[String]$domainname = 'domain.com',
[String]$reportpath = "E:\ADHealthReport\",
[String]$percentlow = 10,
[String]$sendemailtime = "07.00A"
)
@brettmillerb
brettmillerb / Set-VSCodesettings.ps1
Created November 5, 2021 13:26
PowerShell function to set VSCode settings.json properties
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 / Get-TwitchEvent.ps1
Created January 11, 2019 16:04
Twitch User Events
function Get-TwitchEvent {
[CmdletBinding(DefaultParameterSetName = 'Standard')]
param (
[Parameter(Mandatory,
ParameterSetName = 'Standard')]
[string]
$UserName,
[Parameter(Mandatory,
ParameterSetName = 'Pipeline',