Skip to content

Instantly share code, notes, and snippets.

@davelee212
davelee212 / export-vse-fw-rules.ps1
Last active May 9, 2019 16:50
export-vse-fw-rules.ps1
# Run from a PowerCLI shell that has been logged into the vCloud Director instance using “Connect-CIServer -server url”
# and then run the script passing the following parameters:
# -file or -f = The CSV file to export rules to
# -edge or -e = The Edge Gateway Name
#
# Example:
# ./export-vse-fw-rules.ps1 -f myfwrules.csv -e “My vShield Edge”
#
param (
@davelee212
davelee212 / azurepolicy-cosmosdb-aliases
Created January 23, 2020 11:15
Alias for CosmosDB - helpful for building Azure Policy
Generated using: (Get-AzPolicyAlias -NamespaceMatch 'DocumentDB').Aliases | Select Name
Name
----
Microsoft.DocumentDB/databaseAccounts/sku.name
Microsoft.DocumentDB/databaseAccounts/virtualNetworkRules[*]
Microsoft.DocumentDB/databaseAccounts/virtualNetworkRules[*].id
Microsoft.DocumentDB/databaseAccounts/isVirtualNetworkFilterEnabled
Microsoft.DocumentDB/databaseAccounts/consistencyPolicy.defaultConsistencyLevel
Microsoft.DocumentDB/databaseAccounts/enableAutomaticFailover
@davelee212
davelee212 / import-vse-fw-rules.ps1
Last active September 29, 2020 13:02
import-vse-fw-rules.ps1
# Run from a PowerCLI shell that has been logged into the vCloud Director instance using “Connect-CIServer -server url”
# and then run the script passing the following parameters:
# -file or -f = The CSV file containing the rules to import
# -edge or -e = The Edge Gateway Name
#
# Example:
# ./import-vse-fw-rules.ps1 -f myfwrules.csv -e “My vShield Edge”
param (
[parameter(Mandatory = $true, HelpMessage="Edge Gateway Name")][alias("-edge","e")][ValidateNotNullOrEmpty()][string[]]$egwname,
@davelee212
davelee212 / ImportvAppFWRules.ps1
Last active September 30, 2020 14:28
ImportvAppFWRules.ps1
# Run from a PowerCLI shell that has been logged into the vCloud Director instance using “Connect-CIServer -server url”
# and then run the script passing the following parameters:
# -file or -f = The CSV file to import rules from
# -vOrg or -o = The Organisation Name (assumes the org only has one Org VDC)
# -vAppName or -v = The name of the vApp to import rules into
# -vAppNet or -n = The name of the vApp Network to import firewall rules into
# Example:
# ./ImportvAppFWRules.ps1 -f myrules.csv -o MyOrg -v My_vApp -n My_vAppNetwork
This file has been truncated, but you can view the full file.
Available aliases as at 23-Jan-2020
Generated using: (Get-AzPolicyAlias).Aliases | Select Name
"Microsoft.CDN/profiles/sku.name"
"Microsoft.Cdn/profiles/sku"
"Microsoft.Cdn/profiles/resourceState"
"Microsoft.Cdn/profiles/provisioningState"
"microsoft.cdn/profiles/endpoints/isHttpAllowed"
"microsoft.cdn/profiles/endpoints/isHttpsAllowed"