Skip to content

Instantly share code, notes, and snippets.

service: media_player.play_media
target:
device_id: b9e3064654ed6eb45dd434c508d656a3
data:
media_content_type: "audio/mp3"
media_content_id: "media-source://media_source/local/filename.mp3"
@chadbaldwin
chadbaldwin / .gitignore
Last active May 11, 2025 07:05
My personal PowerShell profile file
*
!Microsoft.*_profile.ps1
!.gitignore
@chadbaldwin
chadbaldwin / Set-ForegroundWindow.ps1
Last active July 3, 2024 05:02
Function to set the foreground window in Windows using the user32.dll API
function Set-ForegroundWindow {
[CmdletBinding()]
param (
[Parameter(ValueFromPipeline)][string]$ProcessName
)
$type = '
using System;
using System.Runtime.InteropServices;
public class WinAp {
# Dark Theme
$file = gi "${env:ProgramFiles(x86)}\Microsoft SQL Server Management Studio 18\Common7\IDE\ssms.pkgundef"; ($file | gc) -Replace '(.*{1ded0138-47ce-435e-84ef-9ec1f439b749})', '//$1' | Out-File $file;
# Query execution settings
$ssmsUserSettingsFile = "$($env:APPDATA)\Microsoft\SQL Server Management Studio\18.0\UserSettings.xml";
$newXml = "<Element><Key><int>-1</int></Key><Value><string /></Value></Element>
<Element><Key><int>3</int></Key><Value><string /></Value></Element>
<Element><Key><int>4</int></Key><Value><string /></Value></Element>
<Element><Key><int>5</int></Key><Value><string>USE </string></Value></Element>
<Element><Key><int>6</int></Key><Value><string>SELECT FORMAT(COUNT(*),'N0') FROM </string></Value></Element>
<Element><Key><int>7</int></Key><Value><string>SELECT TOP(100) * FROM </string></Value></Element>
@chadbaldwin
chadbaldwin / Windows Setup File.ps1
Last active May 21, 2025 18:13
Used for setting up a new clean install of Windows
# --------------------------------------------------
# -- Windows/System settings
# --------------------------------------------------
# Settings:
# System:
# Notifications & actions:
# Show me the Windows welcome experience...: Uncheck
# Suggest ways I can finish setting up my device...: Uncheck
# Get tips, tricks, and suggestions...: Uncheck
# Multitasking: