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
$key = "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" | |
if(-not(Test-Path $key)) { | |
New-Item $key -Force | |
} | |
New-ItemProperty -Path $key -Name "NoAutoRebootWithLoggedOnUsers" -PropertyType DWORD -Value 1 |
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
[Behaviors] | |
public class UnitMaskConverterBehaviors | |
{ | |
It should_convert_0_to_A = () => _converter.Convert(0).ShouldEqual('A'); | |
It should_convert_1_to_B = () => _converter.Convert(1).ShouldEqual('B'); | |
It should_convert_2_to_C = () => _converter.Convert(2).ShouldEqual('C'); | |
It should_convert_4_to_D = () => _converter.Convert(4).ShouldEqual('D'); | |
It should_convert_8_to_E = () => _converter.Convert(8).ShouldEqual('E'); | |
It should_convert_16_to_F = () => _converter.Convert(16).ShouldEqual('F'); | |
It should_convert_32_to_G = () => _converter.Convert(32).ShouldEqual('G'); |
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
#requires -Version 3.0 | |
function Connect-VM { | |
[CmdletBinding(DefaultParameterSetName='name')] | |
param( | |
[Parameter(ParameterSetName='name')] | |
[Alias('cn')] | |
[System.String[]]$ComputerName=$env:COMPUTERNAME, | |
[Parameter(Position=0, | |
Mandatory,ValueFromPipelineByPropertyName, |
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
task :default => [ :puts ] | |
def says(*args, &block) | |
copy = block | |
body = proc { | |
copy.call | |
puts args.message | |
} | |
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
if(Test-Path Function:Register-TabExpansion) { | |
Register-TabExpansion -Name 'rake' -Type Command -Handler { | |
rake -T | %{ $_ -match '(^rake)(?<task>.*)(#.*)' } | %{ $matches['task'] } | %{ $_.Trim() } | |
} | |
} |
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
$packages = Get-ChildItem (Join-Path $ENV:chocolateyinstall 'lib') |
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 New-FileSystemWatcher { | |
param( | |
[ValidateNotNullOrEmpty()] | |
[string] $Path = (Split-Path $MyInvocation.MyCommand.Definition) | |
) | |
$watcher = New-Object System.IO.FileSystemWatcher | |
$watcher.Path = $path | |
$watcher.IncludeSubdirectories = $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
public interface IAmAnAction | |
{ | |
void Handle(dynamic data = null); | |
} |
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 InstallShield | |
class InstallShieldConfiguration | |
attr_accessor :command, :parameters, :ism, :product_version, :product_code | |
attr_reader :new_product_code | |
def initialize | |
@command = File.join ENV['ProgramFiles(x86)'], 'InstallShield/2010 StandaloneBuild/System/IsCmdBld.exe' | |
@parameters = [] | |
end |
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
def auto_add_dependencies(projects) | |
projects.each do |project| | |
each_project_dependency do |dependency| | |
@dependencies.push dependency | |
end | |
end | |
end | |
def get_packages_config(project) | |
return File.join File.dirname project, 'packages.config' |