Skip to content

Instantly share code, notes, and snippets.

View SQLDBAWithABeard's full-sized avatar
🦄
Generally bearding

Rob Sewell SQLDBAWithABeard

🦄
Generally bearding
View GitHub Profile
1..100 | ForEach-Object {
$number = $Psitem
switch (($number % 5) -eq 0 -and ($number % 3 -eq 0)) {
$true { 'FizzBuzz' }
Default {
switch ($number % 3) {
0 { 'Fizz' }
Default {
switch ($number % 5) {
0 { 'Buzz' }
@SQLDBAWithABeard
SQLDBAWithABeard / recycle.ps1
Created July 20, 2020 12:11
Recycle Bin with PowerShell
$shell = New-Object -com shell.application
$rb = $shell.Namespace(10)
$rb.Items() | Sort ModifyDate -Descending | Select -first 10 | ft
@SQLDBAWithABeard
SQLDBAWithABeard / Secret_Management_Opening_Programmes_with_other_credentials.ipynb
Last active April 27, 2022 14:21
Secret_Management_Opening_Programmes_with_other_credentials
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@SQLDBAWithABeard
SQLDBAWithABeard / Using Secrets Management for demos.ipynb
Last active July 18, 2020 09:23
Using Secret Management with docker
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@SQLDBAWithABeard
SQLDBAWithABeard / Secrets_Management_with_PowerShell.ipynb
Last active February 17, 2024 01:57
Using Secrets Management
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
<#
Nasty, horrible, dirty method of filling a database with duff data.
We used this for some data movement load testing into Azure
It uses Itziks method of creating a numbers table and then converts them into the right(ish)
datatype which it gets from the schema.
Nothing more No PKs, no FKs, no constraints
All dates, datetimes etc are 1901-01-01 00:00:00
@SQLDBAWithABeard
SQLDBAWithABeard / notify teams sql agent jobid convert.ps1
Last active July 27, 2020 18:09
Converting a jobid agent token and notify teams
Param(
$SqlInstance,
$JobID
)
$webhookurl = ""
function Notify-TeamsSQlAgentJob {
Param(
$SQLInstance,
$JobID,
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@SQLDBAWithABeard
SQLDBAWithABeard / snippet.json
Created June 29, 2020 12:40
markdown table snippet
"Table": {
"prefix": "table",
"body": [
"| ${1:Heading1} | ${2:Heading2} | ${3:Heading3} |",
"|------------|----------------:|-----------------:|",
"| | | |"
],
"description": "Log output to console"
}
@SQLDBAWithABeard
SQLDBAWithABeard / settings.json
Last active June 17, 2020 16:51
windows terminal settings
// This file was initially generated by Windows Terminal 1.0.1401.0
// It should still be usable in newer versions, but newer versions might have additional
// settings, help text, or changes that you will not see unless you clear this file
// and let us generate a new one for you.
// To view the default settings, hold "alt" while clicking on the "Settings" button.
// For documentation on these settings, see: https://aka.ms/terminal-documentation
{
"$schema": "https://aka.ms/terminal-profiles-schema",