Skip to content

Instantly share code, notes, and snippets.

View dbafromthecold's full-sized avatar

Andrew Pruski dbafromthecold

View GitHub Profile
@FriedrichWeinmann
FriedrichWeinmann / poc-moduleScopeHierarchy.ps1
Last active May 30, 2019 20:31
Demonstrates the scope pyramid for functions in Modules
New-Module -Name Test -ScriptBlock {
function Get-Test1
{
[CmdletBinding()]
param ()
$var = 24
$depth = 0
try
{
@fatherjack
fatherjack / PowerShell Prompt.ps1
Last active August 23, 2019 21:32
provides some useful information to your PowerShell prompt
function Prompt {
<#
.Synopsis
Your custom PowerShell prompt
# borrowing heavily from https://dbatools.io/prompt but formatting the execution time without using the DbaTimeSpanPretty C# type
.Description
Custom prompt that includes the following features:
@jessfraz
jessfraz / boxstarter.ps1
Last active April 11, 2024 16:02
Boxstarter Commands for a new Windows box.
# Description: Boxstarter Script
# Author: Jess Frazelle <jess@linux.com>
# Last Updated: 2017-09-11
#
# Install boxstarter:
# . { iwr -useb http://boxstarter.org/bootstrapper.ps1 } | iex; get-boxstarter -Force
#
# You might need to set: Set-ExecutionPolicy RemoteSigned
#
# Run this boxstarter by calling the following from an **elevated** command-prompt:
@Alex-Yates
Alex-Yates / PruskiYatesRelayAbstract
Created May 4, 2017 12:44
Session abstract for SQL Relay
Title:
How to provision n >TB virtual SQL Server environments from scratch in seconds on a laptop with limited diskspace using containers and clones
Abstract:
Provisioning dev environments is often a slow, complicated and manual process. Often devs simply don't have the diskspace.
You can solve many of the these problems with virtualisation and source controlled powershell scripts. We'll show you how by talking you through:
DOCKER CONTAINERS (virtual servers)
1. Defining containers
@chubin
chubin / Enable-wttr.in-for-PowerShell
Created February 22, 2016 22:19
How to enable wttr.in in a PowerShell console
# To enable ANSI sequences in a PowerShell console run the following commands.
# After that you can use wttr.in in you PowerShell just lake that:
# (curl http://wttr.in/ -UserAgent "curl" ).Content
#
# More on it:
# http://stknohg.hatenablog.jp/entry/2016/02/22/195644 (jp)
#
Add-Type -MemberDefinition @"
[DllImport("kernel32.dll", SetLastError=true)]
@julz
julz / main.go
Created November 20, 2015 12:39
containersched minicontainer
package main
import (
"fmt"
"os"
"os/exec"
"syscall"
)
func main() {