This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
New-Module -Name Test -ScriptBlock { | |
function Get-Test1 | |
{ | |
[CmdletBinding()] | |
param () | |
$var = 24 | |
$depth = 0 | |
try | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"os" | |
"os/exec" | |
"syscall" | |
) | |
func main() { |