{"id":25322679,"url":"https://github.com/dpo007/wsus-approver","last_synced_at":"2025-04-07T22:41:32.633Z","repository":{"id":277251839,"uuid":"931815752","full_name":"dpo007/WSUS-Approver","owner":"dpo007","description":"This PowerShell script automates the approval and declination of updates in a WSUS (Windows Server Update Services) server.","archived":false,"fork":false,"pushed_at":"2025-03-12T21:54:47.000Z","size":21,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-12T22:30:54.434Z","etag":null,"topics":["powershell","windows-update","wsus"],"latest_commit_sha":null,"homepage":"","language":"PowerShell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dpo007.png","metadata":{"files":{"readme":"ReadMe.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-02-12T22:39:45.000Z","updated_at":"2025-03-12T21:54:50.000Z","dependencies_parsed_at":"2025-02-13T00:36:43.689Z","dependency_job_id":null,"html_url":"https://github.com/dpo007/WSUS-Approver","commit_stats":null,"previous_names":["dpo007/wsus-approver"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dpo007%2FWSUS-Approver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dpo007%2FWSUS-Approver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dpo007%2FWSUS-Approver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dpo007%2FWSUS-Approver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dpo007","download_url":"https://codeload.github.com/dpo007/WSUS-Approver/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247744128,"owners_count":20988778,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["powershell","windows-update","wsus"],"created_at":"2025-02-13T23:47:29.623Z","updated_at":"2025-04-07T22:41:32.613Z","avatar_url":"https://github.com/dpo007.png","language":"PowerShell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# WSUS Automatic Approval/Declination\n\n## Overview\nThis PowerShell script automates the approval and declination of updates in a **WSUS (Windows Server Update Services)** server. It builds upon the original script **`wsus-approval.ps1`**, acquired from [this GitHub repository](https://github.com/hkbakke/wsus-helpers), and introduces several key improvements.\n\n### **Original Script Source:**\n- **File Name:** `wsus-approval.ps1`\n- **Repository:** [hkbakke/wsus-helpers](https://github.com/hkbakke/wsus-helpers)\n- **Purpose:** Automate WSUS update approvals and declinations\n\n## 🚀 Key Enhancements \u0026 New Features\n### **1️⃣ Improved Documentation \u0026 Code Structure**\n✅ Added **structured help comments** (`.SYNOPSIS`, `.DESCRIPTION`, `.PARAMETER`, `.EXAMPLE`, `.NOTES`)\n\n✅ Introduced **debug values section** for easier testing\n\n✅ Enhanced code readability with **better modularization**\n\n\n### **2️⃣ New \u0026 Improved Parameters**\n| Parameter | Description |\n|------------|----------------|\n| `-DeclineOnly` | Skips approvals, only declines updates |\n| `-IncludeUpgrades` | Optionally includes \"Upgrades\" classification in approvals |\n| `-RestrictToLanguages` | Limits updates to specific languages/locales (default: en-us, en-gb). If empty, all language versions of an update will be approved. |\n\n### **3️⃣ Enhanced Logging System**\n✅ **Timestamped logging** with **colored console output** for better readability\n\n✅ Logs written to a **rotating log file** (`wsus-approver_Day_Hour.log`)\n\n✅ More structured logging for **debugging and traceability**\n\n\n### **4️⃣ Smarter Update Filtering \u0026 Approval Process**\n✅ **New function:** `TestUpdateTitleLanguageMatch` - identifies language-specific updates.\n\n✅ **Replaced inefficient `if-else` conditions** with a **PowerShell `switch` statement** for better performance\n\n✅ **Declines superseded/expired updates only after approving new ones**\n\n✅ **Handles license agreement acceptance more explicitly** before approving updates\n\n\n### **5️⃣ Optimized Execution \u0026 Error Handling**\n✅ Sets **default error action to `Stop`** to ensure failures are caught\n\n✅ **Prevents unnecessary processing** on deselected updates\n\n✅ **More modular functions** for better maintenance\n\n\n## 🛠️ Available Parameters\n| **Parameter** | **Description** |\n|--------------|----------------|\n| `-WsusServer` | Specifies the WSUS server to connect to (default: `localhost`) |\n| `-Port` | Sets the port to use for WSUS (default: `8530`) |\n| `-UseSSL` | Enables SSL for WSUS connection |\n| `-NoSync` | Prevents synchronization before processing updates |\n| `-Reset` | Resets the update list before processing |\n| `-DryRun` | Runs in dry-run mode (no actual changes made) |\n| `-DeclineOnly` | Only declines updates, skipping approvals |\n| `-IncludeUpgrades` | Includes \"Upgrades\" classification in approvals |\n| `-DeclineIA64` | Declines IA64 updates (default: `true`) |\n| `-DeclineARM64` | Declines ARM64 updates (default: `true`) |\n| `-DeclineX86` | Declines x86 updates (default: `true`) |\n| `-DeclineX64` | Declines x64 updates (default: `false`) |\n| `-DeclinePreview` | Declines preview updates (default: `true`) |\n| `-DeclineBeta` | Declines beta updates (default: `true`) |\n| `-RestrictToLanguages` | Limits updates to specific languages/locales (default: en-us, en-gb). If empty, all language versions of an update will be approved. |\n\n## 🔧 How to Use\n### **Basic Example:**\n```powershell\n# Connects to WSUS and runs a dry run without making any changes\n.\\WSUS-Approver.ps1 -DeclineOnly -DryRun\n```\n\n### **Advanced Example:**\n```powershell\n# Approve updates including upgrades, decline non-English (US) updates, and perform real changes\n.\\WSUS-Approver.ps1 -IncludeUpgrades -RestrictToLanguages @(\"en-us\")\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdpo007%2Fwsus-approver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdpo007%2Fwsus-approver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdpo007%2Fwsus-approver/lists"}