Skip to content

Instantly share code, notes, and snippets.

View fenneh's full-sized avatar
🔥
Hi

fen fenneh

🔥
Hi
View GitHub Profile
@fenneh
fenneh / Update-StepTemplatesOnDeploymentProcesses.ps1
Last active August 27, 2015 15:32 — forked from Dalmirog-zz/Update-StepTemplatesOnDeploymentProcesses.ps1
Update-StepTemplatesOnDeploymentProcesses (nice name, i know)
<#
.Synopsis
Updates the Step Templates used on Deployment Processes to the latest versions
.DESCRIPTION
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.
.EXAMPLE
Update-StepTemplatesOnDeploymentProcesses -ActionTemplateID "ActionTemplates-3" -OctopusURI "http://localhost" -APIKey "API-RLMWLZBPMX5DRPLCRNZETFS4HA"
.EXAMPLE
Update-StepTemplatesOnDeploymentProcesses -AllActionTemplates -OctopusURI "http://Octopusdeploy.MyCompany.com" -APIKey "API-TSET42BPMX5DRPLCRNZETFS4HA"
.LINK
@fenneh
fenneh / PSSessions.ps1
Created March 13, 2014 01:00
PS Sessions
New-PSSession
Enter-PSSession
Exit-PSSession
Remove-PSSession
Set-StrictMode -Version Latest
$libPath = (Split-Path -Parent $MyInvocation.MyCommand.Definition)
Import-Module $libPath\SecurityLib.psm1
function New-WindowsService {
param
(
[Parameter(Mandatory=$True,Position=0,HelpMessage="The name of the Windows Service")]
[string]$serviceName,
<Project DefaultTargets="CopyOutputs;DeployService" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
<!-- These settings control what the service's name, description etc appear in services.msc task panel. -->
<PropertyGroup Label="ServiceMetaData">
<ServiceName>ShinyNewService</ServiceName>
<ServiceDisplayName>Shiny New Service</ServiceDisplayName>
<ServiceDescription>A shiny new service, that changes the world for the greater good.</ServiceDescription>
</PropertyGroup>
<Choose>
param
(
[string] $EnvironmentName,
[string] $Version,
[string] $ProjectName,
[string] $OctopusApiKey,
[string] $OctopusServerUrl,
[string] $ReleaseNotes
)
@fenneh
fenneh / msbuild-aliases.ps1
Created May 9, 2014 10:03
MSBuild Aliases
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")
#
# 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.
#
@fenneh
fenneh / gist:2568373
Created May 1, 2012 14:37
Win 2008 R2 IIS 7.5 PCI Cipher & Protocol Powershell Functions
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
fenneh / emailfunction.ps1
Created May 1, 2012 14:49
Powershell E-Mail
$smtp = "nice.smtp.server.brok"
$from = "Test@Testing.com"
$to = "Self@DismantleRepair.me"
$subject = "Interesting subject~!"
$body = "Nice Curves!"
Send-Mailmessage -SmtpServer $smtp -From $from -To $to -Subject $subject -Body $body
@fenneh
fenneh / PortQueryFWTest.ps1
Created May 3, 2012 22:16
Using PortQry to test Firewall Rules
# 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)
{