This file contains hidden or 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 car { | |
[CmdletBinding(DefaultParameterSetName='DefaultParameter', HelpUri='http://go.microsoft.com/fwlink/?LinkID=113387', RemotingCapability='None')] | |
param( | |
[Parameter(ValueFromPipeline=$true)] | |
[psobject] | |
${InputObject}, | |
[Parameter(ParameterSetName='SkipLastParameter', Position=0)] | |
[Parameter(ParameterSetName='DefaultParameter', Position=0)] | |
[System.Object[]] |
This file contains hidden or 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
$TempPath = [IO.Path]::GetTempPath() | |
$SBin = "C:\Program Files (x86)\RabbitMQ Server\rabbitmq_server-3.5.3.60710\sbin" | |
$NodeNameBase = [IO.Path]::GetFileNameWithoutExtension([IO.Path]::GetRandomFileName()) | |
$NodeName = "$NodeNameBase@$Env:COMPUTERNAME" | |
$RabbitBase = Join-Path $TempPath $NodeNameBase | |
$ErlangHome = "c:\Program Files\erl7.0" | |
$RabbitPort = 5672 | |
$MgmtPort = 15672 |
This file contains hidden or 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
<# | |
Copyright 2015 Chris Duck | |
Licensed under the Apache License, Version 2.0 (the "License"); | |
you may not use this file except in compliance with the License. | |
You may obtain a copy of the License at | |
http://www.apache.org/licenses/LICENSE-2.0 | |
Unless required by applicable law or agreed to in writing, software |
This file contains hidden or 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
$ModuleName = "YourModule" | |
$Verbs = Get-Command -Module $ModuleName | Select -Unique -ExpandProperty Verb | Sort | |
Get-Command -Module $ModuleName | Group Noun | %{ | |
$Cmds = $_.Group | |
$Noun = $_.Name | |
$VerbCoverage = [Ordered]@{ | |
Noun = $Noun | |
} |
This file contains hidden or 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 | |
Outputs the SSL protocols that the client is able to successfully use to connect to a server. | |
.NOTES | |
Copyright 2014 Chris Duck | |
http://blog.whatsupduck.net | |
Licensed under the Apache License, Version 2.0 (the "License"); |
This file contains hidden or 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
$ModulePath = Join-Path $env:USERPROFILE "Documents\WindowsPowerShell\Modules" | |
"m1","m2","m3","m4","m5","m6" | %{ mkdir (Join-Path $ModulePath $_ ) -ea 0 } | |
New-ModuleManifest -Path (Join-Path $ModulePath "m1\m1.psd1") -RequiredModules "m5","m2" | |
New-ModuleManifest -Path (Join-Path $ModulePath "m2\m2.psd1") -RequiredModules "m3","m4" | |
New-ModuleManifest -Path (Join-Path $ModulePath "m3\m3.psd1") -RequiredModules "m4" | |
New-ModuleManifest -Path (Join-Path $ModulePath "m4\m4.psd1") -RequiredModules "m5" | |
New-ModuleManifest -Path (Join-Path $ModulePath "m5\m5.psd1") |
This file contains hidden or 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
$VMHost = "yourhost" | |
New-TagCategory -Name "TestCat" | |
New-Tag -Name "TestTag" -Category "TestCat" | |
New-VM -Name "test/tag" -vmhost $VMHost | |
New-TagAssignment -Tag TestTag -Entity "test/tag" | |
Get-TagAssignment -Category "TestCat" | %{$_.entity} | fl |
This file contains hidden or 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
$here = Split-Path -Parent $MyInvocation.MyCommand.Path | |
$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") | |
Describe "Some-Function" { | |
Mock "Export-ModuleMember" -ParameterFilter { $Function -eq "Some-Function" } -Verifiable | |
#I've moved this down here, is this OK? | |
. "$here\$sut" | |
Context "Other Tests" { |
This file contains hidden or 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
import java.util.zip.* | |
String backupFile = "c:\\backup.ab"; | |
String outFile = "c:\\backup.tar"; | |
int skip = 0; | |
System.setProperty("line.separator", (String)(char)10); | |
File f = new File(backupFile); | |
FileInputStream fis = new FileInputStream(f); | |
InputStreamReader sr = new InputStreamReader(fis); |
This file contains hidden or 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
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.VisualBasic") > $Null | |
$Watchers = @{} | |
$TabCollectionChangedEvent = { | |
$EventArgs.NewItems | %{ | |
Register-ObjectEvent -InputObject $_.Files -EventName CollectionChanged -Action $FileCollectionChangedEvent | |
} | |
} | |
$FileCollectionChangedEvent = { |