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
$arg1 = "hello1" | |
$arg2 = "hello2" | |
$p = $(start-process -filepath .\bin\debug\hello.exe -argumentlist $arg1 -nonewwindow -passthru; start-process -filepath .\bin\debug\hello.exe -argumentlist $arg2 -nonewwindow -passthru); | |
#$p | wait-process | |
[console]::TreatControlCAsInput = $true | |
while($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
# complete rip off of http://blog.mirthlab.com/2012/05/25/cleanly-retrying-blocks-of-code-after-an-exception-in-ruby/ | |
# | |
# usage | |
# retriable -tries 5 -action { do-work-that-could-throw-exception } | |
# | |
function retriable($tries=3, $interval=1, [scriptblock]$action) | |
{ |
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
set-psdebug -strict | |
# bleh | |
# | |
$global:boxes = @{} | |
<# | |
Here we are defining an internal PowerShell DSL for creating 'boxes'. |
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
<# | |
Report on unmerged changesets for release planning. | |
#> | |
function get_unmerged_changesets($source, $target) | |
{ | |
write-host "getting unmerged changesets for $source and $target" | |
$changesets = @() | |
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
using System; | |
using System.Diagnostics; | |
using System.Security.Cryptography; | |
using System.Text; | |
namespace Crtypto | |
{ | |
class Program | |
{ | |
static void Main(string[] args) |
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
set-executionpolicy Unrestricted | |
winrm quickconfig -quiet | |
enable-wsmancredssp -role client -delegatecomputer * |
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
param($computername=$(throw "-computername is required"), $username=$(throw "-username is required"), $password=$(throw "-password is required")) | |
<# | |
.SYNOPSIS | |
Bootstraps a server for use with WinRM. | |
Requires running under a username which is an adminstrator on remote machine. | |
Requires PSEXEC from sysinternals | |
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 invoke-remoteexpression($computer = “\\$ENV:ComputerName”, [ScriptBlock] $expression = $(throw “Please specify an expression to invoke.”), [switch] $noProfile , $username, $password) | |
{ | |
$commandLine = “echo . | powershell “ | |
if($noProfile) | |
{ | |
$commandLine += “-NoProfile “ |
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 ServerRepository(connection) | |
{ | |
var servers = [ | |
{ name : "testin 1"}, | |
{ name: "testin 2"} | |
]; | |
var self = this; | |
self.connection = connection; |
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
$cred = get-credential | |
$session = new-pssession -computername fqdn -credential $cred | |
invoke-command { import-module bitstransfer; start-bitstransfer -source \\fnp\package_1234.zip -destination c:\temp\package1234.zip } -session $session -asjob -jobname "update" | |
receive-job $jobid | |
<# | |
The remote use of BITS is not supported. For more information about BITS, see the MSDN documentation at http://go.microsoft.com/FWLINK/?LinkId=140888. |