PowerShell script

Winsage
August 15, 2025
Microsoft released the mandatory Windows 11 update KB5063878 for August, which includes the Quick Machine Recovery feature for remote troubleshooting of PCs. Users have reported installation issues, encountering error codes such as 0x80240069, 0x80240031, and 0x800f0922. Microsoft has acknowledged these as known errors, particularly affecting those using Windows Server Update Services (WSUS). The installation problems occur regardless of whether the system is newly installed or has been updated multiple times. Microsoft offers a temporary solution called "Known Issue Rollback" to revert the problematic update and suggests modifying the Windows registry or using a PowerShell script as a workaround. Users can also manually download the update from Microsoft's Update Catalog for immediate installation.
Winsage
August 3, 2025
Microsoft has transitioned from the traditional command prompt to Windows PowerShell, a command-line interface tool designed for scripting and task automation. Key commands in PowerShell include: 1. Get-Process: Retrieves information about processes running on a local computer or a remote server, including process names, IDs, CPU usage, and memory consumption. Example usage includes filtering processes by memory usage or specific applications. 2. Get-Command: Lists all available commands within PowerShell, including cmdlets, functions, aliases, and scripts. It helps users discover commands for specific tasks. 3. Set-ExecutionPolicy: Configures the PowerShell script execution policy, determining whether scripts can run and under what conditions. It allows power users to adjust policies for executing custom scripts. 4. Get-EventLog: Accesses detailed system logs for troubleshooting errors or auditing system activity, including warnings and security breaches. It can filter logs based on criteria like log name and entry type. 5. Where-Object: Filters objects in a pipeline based on specified conditions, allowing users to narrow down results for analysis, reporting, and automation. It can be combined with other commands for enhanced functionality.
Winsage
July 13, 2025
A PowerShell script developed by GitHub user Anduin2017 allows users to create a new Windows 11 installation on an empty physical drive while retaining access to files and applications from the existing installation. The process requires running the script in an elevated PowerShell window, providing inputs such as the location of the empty drive and the edition of Windows to install from an ISO file. Users can continue using their PC during the installation, and upon completion, they can choose between the existing and new installations upon reboot. To set up necessary applications, users can customize PowerShell modules using a sample install.ps1 file from the GitHub project. This method is particularly beneficial for users relying on cloud storage solutions like OneDrive, as it allows for a refreshed operating system with minimal downtime and easy access to data. The streamlined approach is designed for users who frequently encounter Windows issues and need clean installations, enabling rapid replication of a base system with essential programs.
Winsage
June 25, 2025
The process of gathering historical data for a Windows storage dashboard involves two steps: creating a PowerShell script to collect and save the data, and configuring the Windows Task Scheduler to run this script at set intervals. The script collects data on file system drives using the Get-PSDrive cmdlet, creating a custom PowerShell object with columns for Timestamp, Drive, UsedGB, FreeGB, and TotalGB, which is then exported to a CSV file. The script specifies the CSV file path, appends new data without overwriting existing data, and excludes type information from the header. The generated CSV file includes a header row and records for each drive with their respective usage statistics.
Winsage
June 9, 2025
The 'inetpub' folder, which appears on system drives (C:) after the April 2025 security update for Windows 10 and 11, is essential for protecting users against the security vulnerability CVE-2025-21204. This vulnerability involves improper link resolution before file access and can allow an authorized attacker to escalate privileges. Although the folder may seem empty and Internet Information Services (IIS) might not be in use, its deletion can compromise the effectiveness of the security patch, exposing systems to vulnerabilities. Microsoft recommends using a PowerShell script to restore the folder if deleted, rather than recreating it through IIS, which may add unwanted system folders.
Winsage
June 9, 2025
A recent Microsoft security update has created a new folder named "inetpub" on Windows systems, which is essential for system security. If users delete this folder, it can lead to significant vulnerabilities. Microsoft has released a Powershell script, Set-InetpubFolderAcl.ps1, to restore the "inetpub" folder and set the correct permissions. Systems that installed the April security update (KB5055528) must take immediate action if the "inetpub" directory is missing. The script also updates access rights for the "DeviceHealthAttestation" directory, if it exists. Administrative rights are required to run the script. This issue was highlighted by IT security researcher Kevin Beaumont, who noted that deleting the "inetpub" folder could disrupt the installation of future security updates.
Winsage
June 6, 2025
Users may face a significant vulnerability related to a Windows update from April 2025, particularly concerning the "inetpub" folder, which is essential for the security of Windows 11 systems. Microsoft clarified that this folder, linked to Internet Information Services (IIS) and necessary for hosting capabilities, should not be deleted. If users have removed the folder, they must restore it to address the security patch for CVE-2025-21204, as its absence can lead to risks such as privilege escalation and unauthorized access. Microsoft has provided a PowerShell script to restore the folder without enabling IIS, and users are advised to follow specific commands to execute the fix. However, many users may not take action, leaving their systems vulnerable.
Winsage
June 6, 2025
Windows users have encountered a new "inetpub" folder on their primary drive after the April 2025 Patch Tuesday update. This folder is empty and occupies no storage space, but many users have deleted it out of concern. Microsoft has stated that the folder is part of a security patch for vulnerability CVE-2025-21204 and should not be removed, as it is linked to Internet Information Services (IIS). Users can restore the folder using a PowerShell script if they have deleted it. The folder addresses a security flaw related to improper link resolution that could allow local attackers to manipulate files. Instructions for restoring the folder include running PowerShell as Administrator, allowing signed scripts, downloading a specific script, and applying the fix.
Search