This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Set-AzureRmKeyVaultAccessPolicy -VaultName $keyVaultName -ResourceGroupName $resourceGroupName ` | |
-UserPrincipalName 'Joe.Boggs@contoso.com' ` | |
-PermissionsToCertificates list,get ` | |
-PermissionsToKeys list,get ` | |
-PermissionsToSecrets list,get |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<#PSScriptInfo | |
.VERSION 1.0.2 | |
.GUID a8d543c8-d93f-43ba-8f92-819a35ce44ac | |
.AUTHOR Daniel Scott-Raynsford | |
.COMPANYNAME |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$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" | |
} | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trigger: | |
branches: | |
include: | |
- 'main' | |
pr: none | |
stages: | |
- stage: Build | |
jobs: | |
- template: templates/build.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trigger: | |
branches: | |
include: | |
- 'main' | |
pr: none | |
stages: | |
- stage: Build | |
jobs: | |
- template: templates/build.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |