Skip to content

Instantly share code, notes, and snippets.

View danjpadgett's full-sized avatar

Dan Padgett danjpadgett

View GitHub Profile
@danjpadgett
danjpadgett / PowerPrompt.ps1
Last active April 2, 2019 09:21
prompt for a/c power during in place upgrade.
##//Call this at the start of the TS. serviceui.exe -process:TsProgressUI.exe %windir%\System32\WindowsPowerShell\v1.0\powershell.exe -WindowStyle hidden -executionpolicy Bypass -file .\PowerCheck.ps1
##//DEMO - https://imgur.com/a/44TfdxX
if (Get-WmiObject -Query "Select BatteryStatus from Win32_Battery WHERE BatteryStatus=2") {break}
else {
$T1 = New-Object -ComObject "Microsoft.SMS.TsProgressUI"
$T1.CloseProgressDialog()
@9to5IT
9to5IT / Script_Template.ps1
Last active August 29, 2025 11:59
PowerShell: Script Template
#requires -version 2
<#
.SYNOPSIS
<Overview of script>
.DESCRIPTION
<Brief description of script>
.PARAMETER <Parameter_Name>
<Brief description of parameter input required. Repeat this attribute if required>