PowerShell automation for remote .NET Framework deployment and Windows Server patching — no external modules required.
This repository contains two PowerShell scripts for enterprise server management. Both are designed to run from a central management server against multiple remote targets — no agents, no external modules, no internet required.
- Script 1: .NET Framework 4.8 Installer
- Script 2: Windows Server Patching
- Prerequisites
- Tech Stack
- Changelog
- License
install-dotnet48.ps1 — Automates .NET Framework 4.8 installation on remote Windows Servers using an existing offline installer.
-
✈️ Pre-flight Check — Skips installation if .NET Framework 4.8 (Release Key ≥ 528040) is already present. -
🔐 Admin Validation — Verifies the PowerShell session runs with administrator privileges.
-
🤫 Quiet Mode — Runs the installer with
/q /norestartflags. -
✅ Post-install Verification — Validates the installed .NET version after completion.
-
📊 Smart Exit Codes — Treats both
0(success) and3010(reboot required) as successful, logs the reboot requirement but does not auto-restart.
# Basic usage — point to your offline installer on a network share
.\install-dotnet48.ps1 -InstallerPath "\\fileserver\share\ndp48-x86-x64-allos-enu.exe"
# Custom log path
.\install-dotnet48.ps1 -InstallerPath "\\fileserver\share\ndp48-x86-x64-allos-enu.exe" `
-LogPath "D:\Logs\dotnet48.log"| Parameter | Required | Default | Description |
|---|---|---|---|
-InstallerPath |
✅ | — | Path to the .NET 4.8 offline installer EXE (e.g. UNC path) |
-LogPath |
❌ | %TEMP%\dotnet48-install.log |
Custom log file location |
Patch-WindowsServers.ps1 — Remotely patches multiple Windows Servers from a central system using the built-in Windows Update Agent API.
-
🔌 No External Modules — Uses the Windows Update Agent COM API via a temporary scheduled task running as SYSTEM. No
PSWindowsUpdate, no third-party dependencies. -
🖥️ Multi-server Support — Patches a list of servers in sequence from one management machine.
-
📋 Before/After Comparison — Reports OS version and build number before and after patching.
-
🔄 Smart Reboot Handling — Reboots servers when required and waits for them to come back online.
-
📺 Live Terminal Output — Real-time progress reporting during execution.
-
📄 CSV Export — Generates a report file in the current directory after completion.
# Define target servers
$servers = "APP01", "DB01", "WEB03"
# Run with admin privileges
.\Patch-WindowsServers.ps1 -Servers $servers- Connects to each server via PowerShell Remoting (WinRM)
- Creates a temporary scheduled task under
C:\ProgramData\Remote-Patching - The task runs as SYSTEM and calls the Windows Update Agent API to search and install updates
- Equivalent to clicking "Check for updates" → "Install now" in Windows Settings
- Reports results and cleans up the temporary task
- Windows Server 2016
- Windows Server 2019
- Windows Server 2022
- PowerShell 5.1 or newer on the management server
- PowerShell Remoting (WinRM) enabled on all target servers
- Domain or local admin credentials for the target servers
- No internet access required — updates can be pre-staged via WSUS or manual deployment
- Task Scheduler must be available on target servers
.net-Remote-Installer/
├── install-dotnet48.ps1 # .NET Framework 4.8 installer
├── Patch-WindowsServers.ps1 # Remote patching automation
└── README.md
- 🚀 Initial release
- ✨ .NET Framework 4.8 remote installer with pre-flight checks
- ✨ Windows Server patching via Windows Update Agent API
- ✨ CSV report export
Unlicensed — provided as-is for enterprise use.
Made with 🖤 by cheswick.dev