Skip to content

Instantly share code, notes, and snippets.

View ClaudioESSilva's full-sized avatar

Cláudio Silva ClaudioESSilva

View GitHub Profile
@ClaudioESSilva
ClaudioESSilva / Convert-FolderContentToMarkdownTableOfContents.ps1
Created September 18, 2017 17:26
Convert-FolderContentToMarkdownTableOfContents function
function Convert-FolderContentToMarkdownTableOfContents{
<#
.SYNOPSIS
Create a Table of Contents in markdown
.DESCRIPTION
This function can be used to generate a markdown file that contains a Table of Contents based on the contents of a folder
.PARAMETER BaseFolder
It’s the folder’s location on the disk
.PARAMETER BaseURL
to build the URL for each file. This will be added as a link
@ClaudioESSilva
ClaudioESSilva / New-OutlookEmail.ps1
Created February 12, 2020 15:38
New-OutlookEmail.ps1
function New-OutlookEmail {
<#
.SYNOPSIS
Will open a new Outlook email item and set some properties.
.DESCRIPTION
Will open a new Outlook email item and set some properties.
Email will be sign and encrypted.
Will keep the default signature.
Email will not be sent!
@ClaudioESSilva
ClaudioESSilva / CopyAllMissingModules.ps1
Last active May 29, 2020 15:27
You need dbatools PowerShell module. This script will copy all missing 'View', 'TableValuedFunction', 'DefaultConstraint', 'StoredProcedure', 'Rule', 'InlineTableValuedFunction', 'ScalarFunction', 'Database Trigger', 'Table/View Triggers' from a source database to a destination one within same instance. No error handling if compilation fails (Ex…
#Vars
$srcInstance = "localhost"
$destInstance = "localhost"
$srcDatabase = "db1"
$destDatabase = "db2"
# Will create SMO instance object that we will use to run script out the definition of the objects
$sqlSrcInst = Connect-DbaInstance $srcInstance
# Will create SMO instance object that we will use later to run the scripts on the destination database