Skip to content

Instantly share code, notes, and snippets.

View ayseff's full-sized avatar
🎯
Focusing

Avraham Seff ayseff

🎯
Focusing
  • Greater New York City Area
View GitHub Profile
@stevenkuhn
stevenkuhn / gist:5062660
Last active March 7, 2023 16:03
This PowerShell script generates release notes for Octopus Deploy that contain the GitHub commits and JIRA issues from the current build to the latest production release. It will also create the Octopus release based on the TeamCity build number.
#
# 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.
#
@19WAS85
19WAS85 / powershell-web-server.ps1
Last active November 4, 2024 16:50
A simple web server built with powershell.
# 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
@davidroberts63
davidroberts63 / Install-OctopusServer.ps1
Last active June 19, 2018 01:59
Automate Octopus Deploy Server Install and Configuration
$commandArgs = "/i Octopus-Server.msi /quiet INSTALLLOCATION=C:\OctopusServer /lv Octopus-Server-Install-Log.txt"
Start-Process "msiexec" $commandArgs -Wait -Verb RunAs
@dlwyatt
dlwyatt / AlternativeDynamicParamMethod.ps1
Created September 4, 2014 12:08
DynamicParam class example
Add-Type -TypeDefinition @'
using System;
using System.Management.Automation;
public class DynamicParamExample
{
[Parameter()]
[ValidateSet("one", "two", "three")]
public string MyDynamicParameter { get; set; }
}
@dlwyatt
dlwyatt / ResolveConfigurationData-Original.ps1
Last active September 26, 2016 18:35
Resolve ConfigurationData updates
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"
@dlwyatt
dlwyatt / Resolve-DscConfigurationPropertyUpdate.ps1
Created September 24, 2014 00:39
Resolve-DscConfigurationProperty update
$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'
$configData = @{
AllNodes = @(
@{
NodeName = '*'
AllNodesProperty = 'AllNodesValue'
}
@{
NodeName = 'Node1'
FilterNumber = 1
@dlwyatt
dlwyatt / ugly.ps1
Created December 26, 2014 01:22
PSD1 import ugliness
$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
@dlwyatt
dlwyatt / Snake.ps1
Created December 31, 2014 19:34
Snake update
#requires -version 2
#
# Powershell Snake Game
# Author : Kurt Jaegers
#
function SetEmptySquare($x, $y)
{
$matrix[$x, $y] = $emptysquare
@CADbloke
CADbloke / WindowsFormToXaml.cs
Created January 21, 2015 02:36
Windows Forms to XAML Converter
// 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;