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 Show-Notification { | |
[cmdletbinding()] | |
Param ( | |
[string] | |
$ToastTitle, | |
[string] | |
[parameter(ValueFromPipeline)] | |
$ToastText | |
) |
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 Convert-PesterResultToJUnitXml { | |
[CmdletBinding()] | |
param ( | |
[Parameter(Mandatory)] | |
$PesterResult | |
) | |
$junit = '<?xml version="1.0" encoding="utf-8"?>' | |
$junit += "`n" + '<testsuites name="Pester" tests="{0}" failures="{1}" disabled="{2}" time="{3}">' -f @( | |
$PesterResult.TotalCount, |
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
$err=$null | |
[System.Management.Automation.PSParser]::Tokenize((Get-Content (Get-PSReadLineOption).HistorySavePath),[ref]$err) | | |
Where-Object {$_.type -eq 'command'} | | |
Select-Object Content | Group-Object Content | | |
Sort-Object Count, Name -Descending | Select-Object Count, Name -First 20 |
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
module PSFSharp.Stuff | |
open System.Management.Automation | |
[<Cmdlet("Get","Stuff")>] | |
type GetStuffCommand() as self = | |
inherit PSCmdlet() | |
override PSCmdlet.ProcessRecord() = | |
self.WriteObject(self.Param) |
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 Auto-Complete() | |
{ | |
Return (Invoke-RestMethod -Uri "http://api.bing.com/qsml.aspx?query=$($TextBox1.text)").searchsuggestion.section.item.text | |
} | |
Function Create-WinForm() | |
{ | |
#Calling the Assemblies | |
[void] [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms") |
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 Get-Direction() | |
{ | |
Param( | |
[Parameter(Mandatory=$true,Position=0)] $Origin, | |
[Parameter(Mandatory=$true,Position=1)] $Destination, | |
[Parameter(Position=2)] [ValidateSet('driving','bicycling','walking')] $Mode ="driving", | |
[Switch] $InMiles | |
) | |