Skip to content

Instantly share code, notes, and snippets.

💭
Logged into org account

Brett Miller brettmillerb

💭
Logged into org account
Block or report user

Report or block brettmillerb

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Get-RandomAdilioSticker.ps1
function Get-RandomAdilioSticker {
[CmdletBinding()]
param ()
begin {
$results = irm -Uri 'https://api.github.com/repos/adilio/ps-design/git/trees/master?recursive=1'
}
process {
start ("{0}/{1}" -f 'https://raw.githubusercontent.com/adilio/ps-design/master', ($results.tree | ? path -match 'png$' | Get-Random | Select-Object -ExpandProperty path))
@brettmillerb
brettmillerb / StreamStarting.html
Last active Oct 11, 2019
Twitch Stream Starting Animation
View StreamStarting.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<style>
body {
@brettmillerb
brettmillerb / Split-FolderPath.ps1
Last active Oct 10, 2019
Creates pscustomobject from filepath
View Split-FolderPath.ps1
using namespace System.Collections.Specialized
Get-ChildItem -Path C:\support\git\gitpersonal | Select-Object -ExpandProperty FullName |
function Split-FolderPath {
[CmdletBinding()]
param (
[Parameter(ValueFromPipeline)]
[string[]]
$Path
@brettmillerb
brettmillerb / run.ps1
Last active Sep 13, 2019
ServiceNow Helper
View run.ps1
using namespace System.Net
using namespace System.Management.Automation
# Input bindings are passed in via param block.
param (
$Request,
$TriggerMetadata
)
# Write to the Azure Functions log stream.
@brettmillerb
brettmillerb / Get-MultiPass.ps1
Last active Jul 18, 2019
MultiPass CLiXML Handlers
View Get-MultiPass.ps1
function Get-MultiPass {
<#
.SYNOPSIS
Retrieves a previously created MultiPass file
.DESCRIPTION
Retrieves a previously created MultiPass file from the specified Path
.PARAMETER Path
Specifies a path to the location of a credential XML file.
View Get-Syntax.ps1
function Get-Syntax {
[CmdletBinding()]
param (
$Command,
[switch]
$Normalise
)
$check = Get-Command -Name $Command
View DockerFile
# escape=`
ARG fromTag=latest
ARG WindowsServerCoreRepo=mcr.microsoft.com/windows/servercore
# Use server core as an installer container to extract PowerShell,
# As this is a multi-stage build, this stage will eventually be thrown away
FROM ${WindowsServerCoreRepo}:${fromTag} AS installer-env
ARG PS_VERSION=6.2.0
ARG PS_PACKAGE_URL=https://github.com/PowerShell/PowerShell/releases/download/v${PS_VERSION}/PowerShell-${PS_VERSION}-win-x64.zip
View Get-AzCachedAccessToken.ps1
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
View snippets.json
{
/*
// Place your snippets for PowerShell 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": [
View Get-MSTeamsGroupID.ps1
function Get-MsTeamsGroupId {
[CmdletBinding()]
param (
[Parameter(Mandatory=$true,
Position=0,
ValueFromPipeline=$true,
ValueFromPipelineByPropertyName=$true)]
[ValidateNotNullOrEmpty()]
[string]
$TeamName
You can’t perform that action at this time.