Skip to content

Instantly share code, notes, and snippets.

View theznerd's full-sized avatar
☠️
PowerShell 4 Lyfe!

Nathan Ziehnert theznerd

☠️
PowerShell 4 Lyfe!
View GitHub Profile
#### You need the following DLLs from the MahApps.Metro NuGet Package
#### Put them all in the root folder the script is run from
# ControlzEx.dll
# MahApps.Metro.dll
# System.Windows.Interactivity.dll
## Load The Assemblies/DLLs
Add-Type -assemblyName PresentationFramework
Add-Type -assemblyName PresentationCore
Add-Type -assemblyName WindowsBase
@theznerd
theznerd / Starter Snippet #1
Last active April 23, 2019 04:49
MEMUG-PSComp1-StartingData
$domains = @("thiswebsiteprobablydoesntexist.com","thiswebsiteprobablydoesntexisttoo.com","z-nerd.com","thiswebsiteprobablydoesntexisteither.com","thiswebsiteprobablydoesntexist2.com","catapultsystems.com","thiswebsiteprobablydoesntexisttoday.com")
$numRetries = 3
$retryWait = 5
Start-Process -Wait -WindowStyle Hidden -FilePath "$PSScriptRoot\ServiceUI_x64.exe" -ArgumentList "-process:tsprogressui.exe `"c:\Windows\System32\WindowsPowershell\v1.0\powershell.exe`" -ExecutionPolicy Bypass -WindowStyle Hidden -File `"$PSScriptRoot\UserNotification.ps1`" -SettingsFile `"$PSScriptRoot\Settings.ini`""
Start-Process -Wait -WindowStyle Hidden -FilePath "$PSScriptRoot\ServiceUI_x64.exe" -ArgumentList "-process:tsprogressui.exe `"c:\Windows\System32\WindowsPowershell\v1.0\powershell.exe`" -ExecutionPolicy Bypass -WindowStyle Hidden -File \`"$PSScriptRoot\UserNotification.ps1\`" -SettingsFile \`"$PSScriptRoot\Settings.ini\`""
Start-Process -Wait -WindowStyle Hidden -Verb RunAs -FilePath "$PSScriptRoot\ServiceUI_x64.exe" -ArgumentList "-process:tsprogressui.exe `"c:\Windows\System32\WindowsPowershell\v1.0\powershell.exe`" -ExecutionPolicy Bypass -WindowStyle Hidden -File `"$PSScriptRoot\UserNotification.ps1`" -SettingsFile `"$PSScriptRoot\Settings.ini`""
Start-Process -Wait -WindowStyle H
<?xml version="1.0" encoding="UTF-8"?>
<WMIConfiguration>
<Namespace Path="ROOT\cimv2">
<Class Name="Win32_Service">
<Property Name="AcceptPause" />
<Property Name="AcceptStop" />
<Property Name="Caption" />
<Property Name="CheckPoint" />
<Property Name="CreationClassName" />
<Property Name="DelayedAutoStart" />