Skip to content

Instantly share code, notes, and snippets.

View gbargsley's full-sized avatar

Garry Bargsley gbargsley

View GitHub Profile
@gbargsley
gbargsley / FailedJobs-HTML
Created September 4, 2020 19:02
FailedJobs-HTML
$today = get-date -Format "MM/dd/yyyy"
$header = @"
<style>
h1 {
font-family: Arial, Helvetica, sans-serif;
color: #e68a00;
font-size: 28px;
}
h2 {
font-family: Arial, Helvetica, sans-serif;
@gbargsley
gbargsley / lastbackup.ps1
Created September 3, 2019 16:11
LastBackup
$MyInstances = Get-DbaRegServer -SqlInstance cmsserver -Group "SDLC" | Sort-Object Name
$today = get-date -Format "dd MMM yyyy"
$style = "
<style>
TABLE{border-width: 1px;border-style: solid;border-color: black;border-collapse: collapse}
TH{border-width: 1px;padding: 2px;border-style: solid;border-color: black;background-color:rgb(255, 255, 255);font-size:16;color:black}
TD{border-width: 1px;padding: 5px;border-style: solid;border-color: black;color:black;font-size:14}
</style>
"
@gbargsley
gbargsley / cheatsheet.ps1
Created February 13, 2019 16:24 — forked from pcgeek86/cheatsheet.ps1
PowerShell Cheat Sheet / Quick Reference
Get-Command # Retrieves a list of all the commands available to PowerShell
# (native binaries in $env:PATH + cmdlets / functions from PowerShell modules)
Get-Help # Get all help topics
Get-Help -Name about_Variables # Get help for a specific about_* topic (aka. man page)
Get-Help -Name Get-Command # Get help for a specific PowerShell function
Get-Help -Name Get-Command -Parameter Module # Get help for a specific parameter on a specific command
###################################################
# Flow Control Statements
@gbargsley
gbargsley / ScriptPublications.psq
Created October 8, 2015 18:46
ScriptPublications
param ($sqlServer,$path,[switch]$scriptPerPublication)
Import-Module Repl
if ($sqlServer -eq "")
{
$sqlserver = Read-Host -Prompt "Please provide a value for -sqlServer"
}
if ($path -eq "")
{