Skip to content

Instantly share code, notes, and snippets.

View chaddoncooper's full-sized avatar

Chad Cooper chaddoncooper

  • Arcta Solutions
  • United Kingdom
View GitHub Profile
@chaddoncooper
chaddoncooper / gist:cc59597a4019656e3036412fe14335fc
Created August 1, 2024 13:59
Powershell IIS remove certificate and bindings
$ConfirmPreference = 'None'
$ApiPortBinding = 443
$Subject = "SubjectName"
Get-ChildItem Cert:\localmachine\my | Where-Object { $_.Subject -match $Subject } | Remove-Item -Force
Get-ChildItem Cert:\localmachine\CA | Where-Object { $_.Subject -match $Subject } | Remove-Item -Force
Get-ChildItem Cert:\localmachine\root | Where-Object { $_.Subject -match $Subject } | Remove-Item -Force
if (-Not (netsh http show sslcert ipport=0.0.0.0:$(ApiPortBinding) | find "The system cannot find the file specified"))
@chaddoncooper
chaddoncooper / gist:ae5edca5af4dc9c5ac0e1c44f09f3835
Created August 1, 2024 13:57
Powershell Install .NET 8 Windows Hosting Bundle
function Get-DotNetCoreInstaller([string]$dotNetVersion, [bool]$useProxy, [string]$proxyServerAddress, [string]$outputFilePath) {
$fileName = "dotnet-hosting-win.exe"
$releasesJSONURL = "https://dotnetcli.blob.core.windows.net/dotnet/release-metadata/" + $dotNetVersion + "/releases.json"
$webClient = New-Object System.Net.WebClient
if ($useProxy -eq $true) {
if (($null -eq $proxyServerAddress) -or ($proxyServerAddress -eq "")) {
Write-Host "##vso[task.logissue type=error;]Proxy server address was not specified"
[Environment]::Exit(1)
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using Castle.MicroKernel;
using Castle.Windsor;
namespace Windsor.Extensions
{
public static class WindorContainerExtensions