Skip to content

Instantly share code, notes, and snippets.

View PlagueHO's full-sized avatar
😼
Working on Game Master Copilot using Semantic Kernel, Azure OpenAI and Blazor 8

Daniel Scott-Raynsford PlagueHO

😼
Working on Game Master Copilot using Semantic Kernel, Azure OpenAI and Blazor 8
View GitHub Profile
@PlagueHO
PlagueHO / Set-AzNetworkSecurityGroupAddRule.ps1
Last active October 7, 2022 07:01
PowerShell function to add or update a rule in all Azure Network Security Groups (NSG) across a set of Azure subscriptions
<#
.SYNOPSIS
Function to loop over all Azure Network Security Groups in multiple
subscriptions and add an NSG rule to it if it does not already exist.
If the rule already exists, it will remove it and add it. The NSG will
then be replaced.
This function is not idempotent, it will replace the NSG regardless
of whether it needed to be or not.
@PlagueHO
PlagueHO / Set-AzureRmKeyVaultAccessPolicyForUser.ps1
Last active October 7, 2022 06:58
Assign List and Get policy to a user in Azure Key Vault
Set-AzureRmKeyVaultAccessPolicy -VaultName $keyVaultName -ResourceGroupName $resourceGroupName `
-UserPrincipalName 'Joe.Boggs@contoso.com' `
-PermissionsToCertificates list,get `
-PermissionsToKeys list,get `
-PermissionsToSecrets list,get
@PlagueHO
PlagueHO / Install-PowerShellOnUbuntu1604.sh
Created August 19, 2016 08:10
Install PowerShell on Ubuntu 16.04 using Bash
wget -O powershell_6.0.0-alpha.9-1ubuntu1.16.04.1_amd64.deb https://github.com/PowerShell/PowerShell/releases/download/v6.0.0-alpha.9/powershell_6.0.0-alpha.9-1ubuntu1.16.04.1_amd64.deb
sudo apt-get install libunwind8 libicu55
sudo dpkg -i powershell_6.0.0-alpha.9-1ubuntu1.16.04.1_amd64.deb
rm powershell_6.0.0-alpha.9-1ubuntu1.16.04.1_amd64.deb
@PlagueHO
PlagueHO / Test-SSLProtocol.ps1
Last active September 16, 2021 19:19
Test SSL Protocols
<#
.DESCRIPTION
Outputs the SSL protocols that the client is able to successfully use to connect to a server.
.PARAMETER ComputerName
The name of the remote computer to connect to.
.PARAMETER Port
The remote port to connect to. The default is 443.
@PlagueHO
PlagueHO / Install-DockerOnWS2016UsingDSC.ps1
Last active June 22, 2021 14:21
Install Docker on Windows Server 2016 using DSC
<#PSScriptInfo
.VERSION 1.0.2
.GUID a8d543c8-d93f-43ba-8f92-819a35ce44ac
.AUTHOR Daniel Scott-Raynsford
.COMPANYNAME
@PlagueHO
PlagueHO / azuredeploy.json
Created February 24, 2021 03:24
ARM Template for Deploying Azure Database for PostgreSQL with read-only replica and no public network access.
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"serverName": {
"type": "string",
"metadata": {
"description": "Server Name for Azure database for PostgreSQL"
}
},
@PlagueHO
PlagueHO / CreateAzureDevOpsAgentPoolVMSS.sh
Created January 26, 2021 01:19
Create an Azure DevOps Agent Pool VMSS
az vmss create \
--name dsragentspool \
--resource-group dsr-azuredevops-rg \
--image UbuntuLTS \
--vm-sku Standard_DS2_v2 \
--storage-sku Standard_LRS \
--authentication-type SSH \
--instance-count 2 \
--disable-overprovision \
--upgrade-policy-mode manual \
@PlagueHO
PlagueHO / azure-pipelines.yml
Created January 24, 2021 06:39
Azure DevOps Multi-Stage YAML Pipeline triggered off Main Branch with access to Secrets & Service Connections and using Environments
trigger:
branches:
include:
- 'main'
pr: none
stages:
- stage: Build
jobs:
- template: templates/build.yml
@PlagueHO
PlagueHO / azure-pipelines.yml
Last active January 24, 2021 02:55
Azure DevOps Multi-Stage YAML Pipeline triggered off Main Branch with access to Secrets & Service Connections
trigger:
branches:
include:
- 'main'
pr: none
stages:
- stage: Build
jobs:
- template: templates/build.yml
@PlagueHO
PlagueHO / ICloneable_Class_PowerShell_Finished.ps1
Created March 11, 2016 01:21
Creating an ICloneable class in PowerShell, with the Clone method implemented.
class Car:ICloneable {
[Object] Clone () {
$NewCar = [Car]::New()
foreach ($Property in ($this | Get-Member -MemberType Property))
{
$NewCar.$($Property.Name) = $this.$($Property.Name)
} # foreach
return $NewCar
} # Clone
[String] $Make