Skip to content

Instantly share code, notes, and snippets.

@briangig
briangig / Copy-AzNSGRules.ps1
Last active November 8, 2022 22:38 — forked from kpatnayakuni/Copy-AzNSGRules.ps1
Copy Azure NSG Security Rules from one NSG to another
Function Copy-AzNSGRules
{
<#
.SYNOPSIS
Copies Azure NSG security rules from one NSG to another
.DESCRIPTION
Copies all the Azure Network Security Group security rules
$Address = Read-Host -Prompt 'Enter address to find' -ErrorAction SilentlyContinue
$RuleMatch = Get-TransportRule | Where-Object {$_.SentTo -like "*$Address*" }
if (!$RuleMatch){
Write-Host "No match found. Try again" -ForegroundColor Yellow
Exit
}
Enable-RemoteDesktop
cinst sysinternals
##########
# Tweaked Win10 Initial Setup Script
# Primary Author: Disassembler <disassembler@dasm.cz>
# Original Version: 1.4, 2016-01-16
# Tweaked based on personal preferences for @alirobe 2016-03-23 - v1.4.1
# NOTE: MAKE SURE YOU READ THIS SCRIPT CAREFULLY BEFORE RUNNING IT + ADJUST COMMENTING AS APPROPRIATE
# This script will reboot your machine when completed.
##########
# Ask for elevated permissions if required