Instantly share code, notes, and snippets.

View previous-talks.md
View check-deployment-channels.sql
select * from dbo.Deployment d LEFT JOIN dbo.Channel c
ON d.[JSON] LIKE '%"ChannelID":"' + c.Id + '"%'
WHERE c.Id is null
select * from dbo.Deployment d LEFT JOIN dbo.Release r ON d.ReleaseId = r.Id
WHERE r.ChannelId IS NULL
select * from dbo.Deployment d cross apply (
select top 1 c.Id as ChannelId from project p inner join channel c on p.Id = c.projectId
where p.Id = d.ProjectId
View retentionpolicydeletefiles.ps1
$applicationDirectoryPath = $OctopusParameters["Octopus.Tentacle.Agent.ApplicationDirectoryPath"]
$deploymentJournalPath = Get-ChildItem -Path "$applicationDirectoryPath\.Tentacle" -Filter "DeploymentJournal.xml" -Recurse
if($deploymentJournalPath) {
[xml]$deploymentJournal = Get-Content $deploymentJournalPath.FullName
$deploymentJournal.Deployments.Deployment | % {
if(Test-Path $_.ExtractedTo) {
Write-Host "$($_.ExtractedTo) will be removed"
Remove-Item -Path $_.ExtractedTo -Recurse -Force -Verbose
} else {
Write-Host "$($_.ExctractedTo) has already been removed"