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
# | |
# Assumptions | |
# | |
# 1. If you have a Octopus release deployed, say 1.0.0.73, there is a git | |
# tag set for that commit in GitHub that is "v1.0.0.73". | |
# | |
# 2. You have TeamCity label each successful build in GitHub with the format | |
# "v{build number}. Sidenote: it appears that TeamCity only labels the | |
# default branch, but not feature branches. | |
# |
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
# This is a super **SIMPLE** example of how to create a very basic powershell webserver | |
# 2019-05-18 UPDATE — Created by me and and evalued by @jakobii and the comunity. | |
# Http Server | |
$http = [System.Net.HttpListener]::new() | |
# Hostname and port to listen on | |
$http.Prefixes.Add("http://localhost:8080/") | |
# Start the Http Server |
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
$commandArgs = "/i Octopus-Server.msi /quiet INSTALLLOCATION=C:\OctopusServer /lv Octopus-Server-Install-Log.txt" | |
Start-Process "msiexec" $commandArgs -Wait -Verb RunAs |
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
Add-Type -TypeDefinition @' | |
using System; | |
using System.Management.Automation; | |
public class DynamicParamExample | |
{ | |
[Parameter()] | |
[ValidateSet("one", "two", "three")] | |
public string MyDynamicParameter { get; set; } | |
} |
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
if (-not $PSBoundParameters.ContainsKey('ConfigurationData')) { | |
Write-Verbose "" | |
Write-Verbose "Resolving ConfigurationData" | |
$ScopeToCheck = 1 | |
do { | |
try { | |
$ConfigurationData = Get-Variable -scope $ScopeToCheck -Name 'ConfigurationData' -ValueOnly -ErrorAction Stop | |
} | |
catch { | |
Write-Verbose "`t`tNothing in scope $ScopeToCheck for ConfigurationData" |
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
$ConfigurationData = @{ | |
AllNodes = @( | |
@{ | |
NodeName = 'Server01' | |
Applications = @{ | |
Mercurial = @{ | |
Name = 'Mercurial 2.5.1 (x64)' | |
ProductId = 'F39802E0-BE92-4896-A67B-85144CF01831' | |
SourcePath = '\\servername\sharename\Mercurial\' | |
Installer = 'mercurial-2.5.1-x64.msi' |
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
$configData = @{ | |
AllNodes = @( | |
@{ | |
NodeName = '*' | |
AllNodesProperty = 'AllNodesValue' | |
} | |
@{ | |
NodeName = 'Node1' | |
FilterNumber = 1 |
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
$utilsType = [scriptblock].Assembly.GetType('System.Management.Automation.PsUtils') | |
$flags = [System.Reflection.BindingFlags]'Instance, Static, Nonpublic' | |
$method = $utilsType.GetMethod('EvaluatePowerShellDataFileAsModuleManifest', $flags) | |
$context = $ExecutionContext.GetType().GetField('_context', $flags).GetValue($ExecutionContext) | |
$path = (gmo bitstransfer -list).Path | |
$hashTable = $method.Invoke($null, @($null, $path, $context, $true)) | |
$hashTable |
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
#requires -version 2 | |
# | |
# Powershell Snake Game | |
# Author : Kurt Jaegers | |
# | |
function SetEmptySquare($x, $y) | |
{ | |
$matrix[$x, $y] = $emptysquare |
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
// based on http://robrelyea.wordpress.com/2007/02/10/winforms-xaml/ | |
// converted to an Extension Method by @CADbloke | |
// a list: http://msdn.microsoft.com/en-us/library/ms750559(v=vs.110).aspx | |
// here's moar code:http://wf2wpf.codeplex.com/SourceControl/latest but it converts source files, not actual controls. | |
// Here's a site that does code too http://www.win2wpf.com/ | |
// http://www.codeproject.com/Articles/25795/Creating-the-Same-Program-in-Windows-Forms-and-WPF | |
// ReSharper disable SpecifyACultureInStringConversionExplicitly | |
using System; |
OlderNewer