Skip to content

Instantly share code, notes, and snippets.

@dataGriff
dataGriff / workingwithgit.md
Last active September 15, 2018 14:53 — forked from stephlocke/workingwithgit.md
Work with git! 🎓=💪
title author date
Working with Git
Steph Locke
15 September 2018

Source control fundamentals

Source control concepts

@dataGriff
dataGriff / DeployResourceGroupAndKeyVault.ps1D
Last active February 26, 2019 20:08
Deploys resource group and key vault
#
# Install-Module -Force AzureRM #run as administrator
# run all below as administrator!!!
# may get errors if done one bit as admin and one bit not, remove and start again in new window
# remember if using in releases to wrap passwords in double quotes in release! e.g. ""$(Password)""
$failoverGroup = $true
$passwordOverride = $true
$adminPasswordOverride = $true
$secretOverride = $false
@dataGriff
dataGriff / Update-StorageAccountTableSharedAccessPolicyWithSignature.ps1
Last active November 25, 2018 17:11
Update-StorageAccountTableSharedAccessPolicyWithSignature
$resourceGroupName = "datagriff-rg"
$location = "north europe"
$storageAccountName = "datagriffsa123456"
$tableName = "mytable"
$storagePolicyName = “readpolicy”
$expiryTime = (Get-Date).AddDays(7)
$permission = "r" ##r,w,l,d
$requestSaS = 1
function Update-StorageAccountTableSharedAccessPolicyWithSignature {
@dataGriff
dataGriff / Test-AzureResourceExists.Tests.ps1
Last active February 23, 2019 14:01
Azure pester example
## Test Azure Resource Exists
clear-host
Write-Host "Test-AzureResourceExists Starting..."
if ([string]::IsNullOrEmpty($(Get-AzureRmContext).Account)) {Login-AzureRmAccount}
$resourceGroupName = "test-rg"
$resourceNames = @("test1", "test2")
$resourceExists = 0
if (-Not(Get-AzureRmResourceGroup | where {$_.ResourceGroupName -eq $resourceGroupName } | Select Name)) {
Write-Host "Resource group does not exist!" -ForegroundColor Red
##break
@dataGriff
dataGriff / RunPester.ps1
Last active November 25, 2018 19:10
Code to run pester
param(
[string]$testScript,
[string]$resourceGroupName
)
## $testScript = .\AzureTest\Test-AzureResourceExists.tests.ps1
Write-Host "Executing Pester tests..."
$outputPath = $testScript.replace("Tests.ps1","xml");
@dataGriff
dataGriff / Test-SQLCoverage.tests.ps1
Last active November 25, 2018 18:57
Code coverage test example for SQL using pester
## Test Azure Resource Exists
clear-host
Write-Host "Test-SQL Starting..."
$serverName = "test-griff.database.windows.net"
$databaseName = "AdventureWorksLT"
$password = ConvertTo-SecureString "5up3r53cr3t!" -AsPlainText -Force #need to convert to key vault get
Column1 Column2
@dataGriff
dataGriff / Configuration.biml
Last active February 3, 2019 13:00
Adds SQL properties to biml. (1) Add all four biml files below to your SSIS project. (2). Amend configuration.biml file to be your environment. (3) Open Deploy_Metadata.biml file and see biml expansion generated!
<#
//Amend the values below to represent your environment
string connectionName = "Datawarehouse";
string serverName = "localhost";
string databaseName = "AdventureWorksDW";
string schemaName = "dbo";
var includedSchemas = new List<string>{schemaName};