Skip to content

Instantly share code, notes, and snippets.


fen fenneh

  • London
View GitHub Profile
fenneh / Update-StepTemplatesOnDeploymentProcesses.ps1
Last active Aug 27, 2015 — forked from Dalmirog-zz/Update-StepTemplatesOnDeploymentProcesses.ps1
Update-StepTemplatesOnDeploymentProcesses (nice name, i know)
View Update-StepTemplatesOnDeploymentProcesses.ps1
Updates the Step Templates used on Deployment Processes to the latest versions
Step templates can be updated from the library on Octopus, but that doesnt mean that the Deployment processes using that template will start using the latest version right away. Normally, the user would have to update the step template on each deployment process manually. This script takes care of that.
Update-StepTemplatesOnDeploymentProcesses -ActionTemplateID "ActionTemplates-3" -OctopusURI "http://localhost" -APIKey "API-RLMWLZBPMX5DRPLCRNZETFS4HA"
Update-StepTemplatesOnDeploymentProcesses -AllActionTemplates -OctopusURI "" -APIKey "API-TSET42BPMX5DRPLCRNZETFS4HA"
View WindowsServiceLib.psm1
Set-StrictMode -Version Latest
$libPath = (Split-Path -Parent $MyInvocation.MyCommand.Definition)
Import-Module $libPath\SecurityLib.psm1
function New-WindowsService {
[Parameter(Mandatory=$True,Position=0,HelpMessage="The name of the Windows Service")]
View PSSessions.ps1
View Deploy-Windows-Service-Via-MSBuild.proj.xml
<Project DefaultTargets="CopyOutputs;DeployService" xmlns="" ToolsVersion="4.0">
<!-- These settings control what the service's name, description etc appear in services.msc task panel. -->
<PropertyGroup Label="ServiceMetaData">
<ServiceDisplayName>Shiny New Service</ServiceDisplayName>
<ServiceDescription>A shiny new service, that changes the world for the greater good.</ServiceDescription>
View OctoDeploy.ps1
[string] $EnvironmentName,
[string] $Version,
[string] $ProjectName,
[string] $OctopusApiKey,
[string] $OctopusServerUrl,
[string] $ReleaseNotes
View msbuild-aliases.ps1
Set-Alias MSBuild (Join-Path -Path (Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\MSBuild\ToolsVersions\2.0").MSBuildToolsPath -ChildPath "MSBuild.exe")
Set-Alias MSBuild (Join-Path -Path (Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\MSBuild\ToolsVersions\3.5").MSBuildToolsPath -ChildPath "MSBuild.exe")
Set-Alias MSBuild (Join-Path -Path (Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\MSBuild\ToolsVersions\4.0").MSBuildToolsPath -ChildPath "MSBuild.exe")
View gist:8aaaefc48f6a42142b48
# Assumptions
# 1. If you have a Octopus release deployed, say, 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.
View emailfunction.ps1
$smtp = "nice.smtp.server.brok"
$from = ""
$to = ""
$subject = "Interesting subject~!"
$body = "Nice Curves!"
Send-Mailmessage -SmtpServer $smtp -From $from -To $to -Subject $subject -Body $body
fenneh / gist:2568373
Created May 1, 2012
Win 2008 R2 IIS 7.5 PCI Cipher & Protocol Powershell Functions
View gist:2568373
function Set-IISSecurityProtocols {
$protopath = "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols"
& reg.exe add "$protopath\PCT 1.0\Server" /v Enabled /t REG_DWORD /d 00000000 /f
& reg.exe add "$protopath\SSL 2.0\Server" /v Enabled /t REG_DWORD /d 00000000 /f
& reg.exe add "$protopath\SSL 3.0\Server" /v Enabled /t REG_DWORD /d 00000001 /f
& reg.exe add "$protopath\TLS 1.0\Server" /v Enabled /t REG_DWORD /d 00000001 /f
& reg.exe add "$protopath\TLS 1.1\Server" /v Enabled /t REG_DWORD /d 00000001 /f
& reg.exe add "$protopath\TLS 1.1\Server" /v DisabledByDefault /t REG_DWORD /d 00000000 /f
& reg.exe add "$protopath\TLS 1.2\Server" /v Enabled /t REG_DWORD /d 00000001 /f
& reg.exe add "$protopath\TLS 1.2\Server" /v DisabledByDefault /t REG_DWORD /d 00000000 /f
fenneh / PortQueryFWTest.ps1
Created May 3, 2012
Using PortQry to test Firewall Rules
View PortQueryFWTest.ps1
# Grab some user input
$Server = Read-Host "Enter the Server's name or IP"
$Port = Read-Host "Enter the Port Number"
# Be careful of this path~!
$K = C:\PortQryV2\PortQry.exe -n $Server -e $Port -p TCP
$L = $K -Match "LIS?"
If($L -ne $null)
You can’t perform that action at this time.