Skip to content

Instantly share code, notes, and snippets.

View wsmelton's full-sized avatar
🦆
Little bit of this, little bit of that

Shawn Melton wsmelton

🦆
Little bit of this, little bit of that
View GitHub Profile
@wsmelton
wsmelton / sqlcommunity-channel.md
Last active April 28, 2021 15:17
Table listing of channels in SQL Community Slack
MemberCount Name Purpose
9363 announcements welcome to SQL Community Slack! You can click on the "Channels" to browse all the public channels. This channel is for announcements by moderators.
9129 sqlhelp Another way to ask for help besides Twitter....
@wsmelton
wsmelton / SSMS_ProductInformation.ps1
Last active January 14, 2021 21:42
Listing of ProductID and Product Name for SSMS install with PowerShell DSC
<#
Listing of the required information to install SQL Server Management Studio via the Package resource with PowerShell DSC.
# Example config:
Configuration InstallSSMS {
Package InstallSsms {
Ensure = "Present"
ProductID = <GUID value>
Name = Full SSMS Name that displays in Program Features
Path = SSMS-Setup-ENU.exe
@wsmelton
wsmelton / module.FileIntegrity.tests.ps1
Last active October 29, 2020 00:53
Pester 5 File Integrity Tests using 5.1 version of Pester
$moduleRoot = (Resolve-Path "$PSScriptRoot\..").Path
$allFiles = Get-ChildItem -Path $moduleRoot -Recurse -Filter "*.ps1" |
Where-Object FullName -NotLike "$moduleRoot\tests\*" |
Where-Object FullName -NotLike "$moduleRoot\Build.ps1"
Describe "Verifying module PS1 files" -Foreach $allFiles {
BeforeAll {
$name = $_.Name
$fullName = $_.FullName
$file = $_
@wsmelton
wsmelton / thycotic_terminal_theme.json
Created September 22, 2020 23:30
Thycotic Theme for Windows Terminal
{
"name": "thycotic",
// entire background
"background": "#081F2C",
// default text
"foreground": "#B3D565",
//quoted values
"cyan": "#3CC4E5",
// commands
"brightYellow": "#80BB01",
@wsmelton
wsmelton / prompt.ps1
Last active September 9, 2020 23:54
My prompt that is part of my profile for PowerShell
function Prompt {
$major = $PSVersionTable.PSVersion.Major
$minor = $PSVersionTable.PSVersion.Minor
$patch = $PSVersionTable.PSVersion.Patch
if ($major -lt 6) {
Write-Host "[PS $($major).$($minor)] [" -NoNewline
} else {
$patch = $PSVersionTable.PSVersion.Patch
Write-Host "[PS $($major).$($minor).$($patch)] [" -NoNewline
}
@wsmelton
wsmelton / ignoreCertPolicy.ps1
Created August 17, 2020 14:06
Working with sites that have untrusted cert for site, where CA may not be accessible, etc.
if (-not("dummy" -as [type])) {
add-type -TypeDefinition @"
using System;
using System.Net;
using System.Net.Security;
using System.Security.Cryptography.X509Certificates;
public static class Dummy {
public static bool ReturnTrue(object sender,
X509Certificate certificate,
@wsmelton
wsmelton / keybindings.json
Created August 2, 2020 03:16
Keybindings VS Code
// Place your key bindings in this file to overwrite the defaults
[
{
"key": "alt+up",
"command": "workbench.action.navigateUp"
},
{
"key": "alt+down",
"command": "workbench.action.navigateDown"
},
@wsmelton
wsmelton / keybindings.json
Created August 2, 2020 03:16
Keybindings VS Code
// Place your key bindings in this file to overwrite the defaults
[
{
"key": "alt+up",
"command": "workbench.action.navigateUp"
},
{
"key": "alt+down",
"command": "workbench.action.navigateDown"
},
@wsmelton
wsmelton / profile_containers.ps1
Last active July 10, 2020 15:36
Functions to dynamically create. Add to your profile and just have the latest release of Docker for Windows installed.
function New-SqlContainer {
<#
.SYNOPSIS
Use to create n+ number of containers for development purposes.
.PARAMETER Number
Provide the number of containers you want created, minimum of 1.
.PARAMETER Prefix
Provide the prefix to use in the contain names (e.g. kringer1, kringer2, etc)
.PARAMETER Version
Version of SQL Server, based on the images you have pulled down (e.g. 2017, 2019)
@wsmelton
wsmelton / Add-TextToBitMap.ps1
Created March 20, 2020 01:16
Trying to add text to a give bmp image file
#Ref: https://stackoverflow.com/a/6827017/12974596
[Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms");
$file = Get-ChildItem 'C:\temp\template.bmp'
$img = New-Object System.Drawing.BitMap($file.FullName)
$newFile = 'C:\temp\eureka.bmp'
[String]$drawString = "lab-ss-01 server"
$colorBlue = (New-Object System.Drawing.ColorConverter).ConvertFromString("blue")
$drawFont = New-Object -TypeName System.Drawing.Font -ArgumentList "Arial",16
$drawBrush = New-Object -TypeName System.Drawing.SolidBrush -ArgumentList $colorBlue
[float]$x = '150.0'