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 / 1. LabBuild.ps1
Last active February 13, 2019 22:11
Lab Build
Configuration LabBuild {
param (
[Parameter()]
[ValidateNotNull()]
[PSCredential]$Credential = (Get-Credential -Credential 'Administrator')
)
Import-DscResource -Module PSDesiredStateConfiguration, xActiveDirectory
node $AllNodes.NodeName {
@brettmillerb
brettmillerb / OBSSetup.md
Last active March 13, 2019 19:48
Setting up OBS

OBS Configuration

  • Download and install OBS from OBS Download
  • Disable Hardware Acceleration in Chrome
    - Open Chrome
    - Settings
    - Search for Hardware Acceleration
    - Turn off 'Use hardware acceleration when available'
    - Relaunch Chrome
    
function Get-Syntax {
[CmdletBinding()]
param (
$Command,
[switch]
$Normalise
)
$check = Get-Command -Name $Command
@brettmillerb
brettmillerb / Get-MultiPass.ps1
Last active July 18, 2019 11:20
MultiPass CLiXML Handlers
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.
@brettmillerb
brettmillerb / run.ps1
Last active September 13, 2019 06:36
ServiceNow Helper
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 / Split-FolderPath.ps1
Last active October 10, 2019 13:17
Creates pscustomobject from filepath
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
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 / profile.ps1
Last active October 18, 2019 10:30
Powershell Profile
# Import Mandatory Modules
Import-Module -Name Toolbox
Import-Module posh-git
# function declarations
function Open-Here { explorer $pwd }
function Set-SupportPath { Set-Location C:\support }
function Set-DocsPath { Set-Location $env:OneDrive\documents }
function Set-HomePath { Set-Location $home }
function Set-GitPath { Set-Location C:\support\git }
@brettmillerb
brettmillerb / snippets.json
Created March 2, 2019 12:42
Powershell Snippets
{
/*
// 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": [
HelpUri : https://go.microsoft.com/fwlink/?LinkID=113308
ResolvedCommandName : Get-ChildItem
DisplayName : gci -> Get-ChildItem
ReferencedCommand : Get-ChildItem
ResolvedCommand : Get-ChildItem
Definition : Get-ChildItem
Options : ReadOnly
Description :
OutputType : {System.IO.FileInfo, System.IO.DirectoryInfo}
Name : gci