Skip to content

Instantly share code, notes, and snippets.

Avatar

Cláudio Silva ClaudioESSilva

View GitHub Profile
@ClaudioESSilva
ClaudioESSilva / CopyAllMissingModules.ps1
Last active May 29, 2020
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…
View CopyAllMissingModules.ps1
#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
View 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 / Convert-FolderContentToMarkdownTableOfContents.ps1
Created Sep 18, 2017
Convert-FolderContentToMarkdownTableOfContents function
View Convert-FolderContentToMarkdownTableOfContents.ps1
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