Skip to content

Instantly share code, notes, and snippets.

View raandree's full-sized avatar

Raimund Andrée [MSFT] raandree

View GitHub Profile
@raandree
raandree / DscAppPoolRecyclingIssue.ps1
Created January 9, 2018 00:15
DSC Pull Server data loss reproduction
$pullServer = Get-LabVM -Role DSCPullServer
$sqlServer = Get-LabVM -Role SQLServer2016
$before = Invoke-LabCommand -ActivityName 'Get Row Count' -ComputerName $sqlServer -ScriptBlock {
Invoke-Sqlcmd -Database DSC -Query "SELECT COUNT(*) AS Count FROM StatusReport"
} -PassThru
Invoke-LabCommand -ActivityName 'Backup DSC Database' -ComputerName $sqlServer -ScriptBlock {
mkdir C:\SQLBackups -Force
$backupCmd = "BACKUP DATABASE [DSC] TO DISK = N'C:\SQLBackups\DSC {0:yyMMdd-hhmmss}.bak' WITH NOFORMAT, NOINIT, NAME = N'DSC-Full Database Backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10" -f (Get-Date)
@raandree
raandree / Show-Tree.ps1
Created December 14, 2017 13:15
Show-Tree.ps1
using namespace System.Collections.Generic
function Show-Tree
{
# .SYNOPSIS
# Print a tree given a key property and parent property
#
# .PARAMETER InputObject
#
# The object to print.
@raandree
raandree / DSC Pull Scenario 1 with SQL Server.ps1
Created May 11, 2017 08:00
Creates a DSC Pull server lab. The pull server uses a database in a SQL Server 2016.
throw "NotImplementedYet"