Skip to content

Instantly share code, notes, and snippets.

powershell and chill

Chrissy LeMaire potatoqualitee

powershell and chill
Block or report user

Report or block potatoqualitee

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
potatoqualitee / Invoke-WsusDbQuery.ps1
Created Aug 1, 2019
Create a connection to a WSUS database using PowerShell
View Invoke-WsusDbQuery.ps1
# No longer used but didn't want to throw it away.
function Invoke-WsusDbQuery {
param (
[string]$ComputerName = $script:WsusServer,
[PSCredential]$Credential = $script:WsusServerCredential,
potatoqualitee / Save-KBFile.ps1
Last active Jul 28, 2019
Download Windows patch files / KB (patchid like KBxxxxx) and save them to disk using PowerShell
View Save-KBFile.ps1
function Save-KBFile {
Downloads patches from Microsoft
Downloads patches from Microsoft
The KB name or number. For example, KB4057119 or 4057119.
View gallery.ps1
potatoqualitee / sql2014.AdventureWorks2014.tables.json
Last active Dec 21, 2018
Modified New-DbaDbMaskingConfig output
View sql2014.AdventureWorks2014.tables.json
"Name": "AdventureWorks2014",
"Tables": [
"Name": "Employee",
"Schema": "HumanResources",
"Columns": [
"Name": "NationalIDNumber",
"ColumnType": "nvarchar",
View sql2014.AdventureWorks2014.tables.json
"Name": "AdventureWorks2014",
"Tables": [
"Name": "AWBuildVersion",
"Schema": "dbo",
"Columns": [
"Name": "Database Version",
"ColumnType": "nvarchar",
View publish.ps1
Set-Content -Encoding UTF8 -Path C:\github\dbatools\allcommands.ps1 -Value "### DO NOT EDIT THIS FILE DIRECTLY ###"
Get-ChildItem -Path "C:\github\dbatools\functions\*.ps1" -Recurse | Get-Content | Add-Content C:\github\dbatools\allcommands.ps1
Get-ChildItem -Path "C:\github\dbatools\internal\functions\*.ps1" -Recurse | Get-Content | Add-Content C:\github\dbatools\allcommands.ps1
Remove-Item -Path C:\github\dbatools\ -ErrorAction Ignore
Compress-Archive -Path C:\github\dbatools\allcommands.ps1 -DestinationPath C:\github\dbatools\
Remove-Item -Recurse C:\github\dbatools\allcommands.ps1 -ErrorAction Ignore
Remove-Item -Recurse C:\gallery -Force
mkdir C:\gallery\dbatools
View package.json
"name": "search",
"displayName": "dbatools simple search",
"description": "search right from your code: dbatools, microsoft docs and google",
"version": "1.0.0",
"icon": "resources/search.png",
"publisher": "dbatools",
"engines": {
"vscode": "^1.11.0"
View filestream_enable.vbs
' cscript filestream_enable.vbs [/Machine:<MachineName>] [/Instance:<InstanceName>] [/Level:<0|1|2|3>] [/Share:<ShareName>]
' from the codeplex site
InstanceName = "MSSQLSERVER"
MachineName = "."
TargetLevel = 3
View sql-enums.xml
# from
<member name="P:Microsoft.SqlServer.Management.Smo.AvailableSQLServers.ResultTypes">
return what types of results does this object support
potatoqualitee / format-cbh.ps1
Last active Oct 7, 2018
reformat and standardize comment based help in powershell
View format-cbh.ps1
function Get-Header ($text) {
$start = $text.IndexOf('<#')
$text.SubString(0, $start - 2)
function Format-Help ($text) {
$start = $text.IndexOf('<#')
$end = $text.IndexOf('#>')
$help = $text.SubString($start + 2, $end - $start - 2)
You can’t perform that action at this time.