Skip to content

Instantly share code, notes, and snippets.

@davidroberts63
davidroberts63 / Get-OctopusDeployPermissionsReport.ps1
Last active November 30, 2022 15:43
Octopus Deploy Permissions Report
[CmdletBinding()]
param(
[string]
$ProjectName,
[string]
$ProjectGroup,
[string]
$RootUri,
@davidroberts63
davidroberts63 / TlsThumbprintForOctopusUse.ps1
Created July 5, 2022 14:18
Gets the most recent thumbprint of a TLS certificate on a Windows host for use within Octopus Deploy processes.
function FindTlsThumbprintToUse
{
param(
[String]$VariableName = "TlsThumbprint"
)
$thumbprint = Get-ChildItem -Path cert:\LocalMachine\My\* -EKU "Server Authentication" |
Where-Object {
# The last where, for -eq $true helps avoid returning a null object in some cases.
$_.DnsNameList -and ($_.DnsNameList.punycode.endswith(".yourtlddomain.here") | Where-Object { $_ -eq $true })
@davidroberts63
davidroberts63 / cancel-builds.ps1
Last active March 6, 2020 14:28
AzPi-Build-Canceler
param(
[String]
$ProjectName,
[String]
$AccountName,
[PSCredential]
$TokenCredential
)
@davidroberts63
davidroberts63 / the-url.txt
Created October 2, 2019 16:28
Just download Docker for Windows
https://download.docker.com/win/stable/Docker%20for%20Windows%20Installer.exe
<#
.SYNOPSIS
Gets focused Az log information on resources. Helpful to determine who created what.
.DESCRIPTION
Providing only the ResourceGroupName will retrive logs for all items in that resource group. You can additionall filter the operations. If you also provide the resource name and type then only logs for that single items will be retrieved
.PARAMETER ResourceGroupName
Specifies the name of the resource group.
@davidroberts63
davidroberts63 / CreateAppInAppServicePlan.ps1
Created October 22, 2017 00:23
Azure App Service Plan Setup
[CmdletBinding()]
param(
$groupName = 'SpotYield-Dev',
$locationName = 'South Central US',
$planName = 'SpotYield',
$webAppName = 'SpotYieldUi',
$apiAppName = 'SpotYieldApi',
$webNetName = 'WebNet'
)
@davidroberts63
davidroberts63 / code-self-signed-cert.ps1
Created October 20, 2017 21:37
Fix VS Code 'self signed' cert a better way
# Links that helped me figure this out
# https://stackoverflow.com/questions/23788564/npm-add-root-ca
# https://docs.npmjs.com/files/npmrc
#
@davidroberts63
davidroberts63 / 0_reuse_code.js
Created January 16, 2017 14:56
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@davidroberts63
davidroberts63 / TheChessmassSong.md
Last active December 22, 2016 15:52
The Chessmas song
@davidroberts63
davidroberts63 / GetAppPoolSiteBindings.ps1
Created November 29, 2016 21:56
Get site bindings for all apppools
import-module webadministration
$ErrorActionPreference = "SilentlyContinue"
$bindings = Get-WebBinding
$bindings | Select -First 1 *
function GetAppPoolApps($appPool)
{
if($appPool -like "#{*") { return }
$apps = Get-WebConfigurationProperty "/system.applicationHost/sites/site/application[@applicationPool='$appPool']" "machine/webroot/apphost" -name path -ErrorAction SilentlyContinue
if(!$apps) { return }