Skip to content

Instantly share code, notes, and snippets.

@bigbadmoshe
bigbadmoshe / New-WoodyRestartNotification.ps1
Created November 28, 2022 11:18 — forked from SMSAgentSoftware/New-WoodyRestartNotification.ps1
Creates a Toy Story-themed restart notification in top left of primary screen
Add-Type -AssemblyName PresentationFramework,System.Windows.Forms
# Set screen working area, and start and finish location of the window 'top' property (for animation)
$workingArea = [System.Windows.Forms.Screen]::PrimaryScreen.WorkingArea
$TopStart = $workingArea.Top - 449
$TopFinish = $workingArea.Top + 10
[xml]$Xaml = @"
<Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
@bigbadmoshe
bigbadmoshe / New-CustomToastNotification.ps1
Created November 28, 2022 12:48 — forked from SMSAgentSoftware/New-CustomToastNotification.ps1
Create your own toast notification with WPF and PowerShell
# Demo script to display a custom 'toast' notification
# Load required assemblies
Add-Type -AssemblyName PresentationFramework, System.Windows.Forms
# User-populated variables
$WindowHeight = 140
$WindowWidth = 480
$Title = "New Blog Post by SMSAgent!"
$Text = "Trevor Jones has posted a new blog: Create a custom toast notification with WPF and PowerShell. Click here to read."
@bigbadmoshe
bigbadmoshe / New-WPFMessageBox.ps1
Last active July 2, 2023 13:19 — forked from SMSAgentSoftware/New-WPFMessageBox
PowerShell function to display a customizable WPF message box / window
Function New-WPFMessageBox {
# For examples for use, see my blog:
# https://smsagent.wordpress.com/2017/08/24/a-customisable-wpf-messagebox-for-powershell/
# CHANGES
# 2017-09-11 - Added some required assemblies in the dynamic parameters to avoid errors when run from the PS console host.
# Define Parameters
[CmdletBinding()]
@bigbadmoshe
bigbadmoshe / Get-WindowsVersion.ps1
Last active November 28, 2022 14:44 — forked from SMSAgentSoftware/Get-WindowsVersion.ps1
Finds the Windows version including Edition, Version and OS Build numbers for local or remote computers
function Get-WindowsVersion
{
[CmdletBinding()]
Param
(
[Parameter(
Mandatory = $false,
ValueFromPipelineByPropertyName = $true,
ValueFromPipeline = $true
)]