Skip to content
avmaksimovPublic

About

A collection of PowerShell utilities for Windows administration, maintenance, and recovery.

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

PSWinKit

English | Русский

PSWinKit is a growing collection of independent Windows PowerShell utilities. Every utility runs without required command-line parameters and shares a small library for localization, UAC elevation, startup and shutdown.

Utilities

Utility Purpose
Remove-Paths Interactively and permanently delete selected files and directories, including protected folders
Check-Windows Check Windows health and optionally repair issues using CHKDSK, DISM and SFC
Check-WinRE Inspect system partitions, optimize C: and Recovery, and audit obsolete partitions for removal

Requirements and use

Supported operating systems: Windows 10/11 and Windows Server 2016 or later (including Windows Server 2019, 2022 and 2025); Windows PowerShell 5.1; x86/x64 where supported. Some utilities require administrator privileges. The shared library does not require PowerShell 7 or third-party modules.

Windows Server 2016 is an ongoing compatibility baseline. Future changes must continue to work with Windows PowerShell 5.1 and supported APIs/cmdlets available on Server 2016. Newer Windows-only capabilities must be checked before use, with safe handling of unsupported operations. WinRE and disk repair operations depend on system tools and partition layout; see each utility's limitations. This is a maintenance requirement, not a claim of successful runtime testing of every operation on every server edition.

From a PowerShell console in the repository root:

.\Remove-Paths\Remove-Paths.ps1
.\Check-Windows\Check-Windows.ps1
.\Check-WinRE\Check-WinRE.ps1

For utility-specific instructions and safety warnings, follow the utility link above. Preserve the directory layout; each utility loads Common/Common.ps1 by a relative path.

Installation and updates

Initial installation

Open Windows PowerShell 5.1 in the existing directory where you want to install PSWinKit. Download the repository ZIP to a temporary location, extract it, and run install.ps1:

$dir = Join-Path $env:TEMP ('PSWinKit-' + [guid]::NewGuid().ToString('N'))
$zip = "$dir.zip"

$url = 'https://github.com/avmaksimov/PSWinKit/archive/refs/heads/main.zip?cacheBust=' + [guid]::NewGuid().ToString('N')
Invoke-WebRequest -Uri $url `
    -Headers @{ 'Cache-Control' = 'no-cache'; 'Pragma' = 'no-cache' } `
    -OutFile $zip -UseBasicParsing -ErrorAction Stop

Expand-Archive -LiteralPath $zip -DestinationPath $dir
& (Join-Path $dir 'PSWinKit-main\install.ps1')

The installer reads files and translations from the extracted archive and installs them directly into the current working directory (Get-Location), without creating a nested PSWinKit folder. The PSWinKit-main folder exists only in the temporary ZIP extraction directory. update.ps1 is not used for initial installation. During initial installation, install.ps1 retrieves the latest main commit SHA and date from the GitHub API and stores them in install-info. If the API is unavailable, the commit information remains unknown.

Subsequent updates

From the existing PSWinKit installation directory, run:

.\update.ps1

update.ps1 compares the installed SHA with the latest commit on GitHub's main branch. If they differ or the installed SHA is unknown, it downloads the source archive and invokes a fresh install.ps1. When the GitHub API is available, the archive is pinned to a specific commit and its SHA and date are recorded; if the API is unavailable, it falls back to main.zip without verified version metadata. The installer does not require elevation unless the destination directory requires it.

Before applying changes, verify the destination and the INSTALL, REPLACE, UNCHANGED, REMOVE summary. File results appear in sorted path order as each SHA-256 check completes; removal candidates are shown after old-inventory validation. The totals appear after the safety notes, immediately before the final confirmation. The installer preserves unrelated files, skips any path containing a dot-prefixed name (including Git metadata) and does not copy itself. It maintains a locally generated install.psd1 with an installed-files list for removal of obsolete files and a separate install-info section containing the verified full commit SHA and UTC commit date. If the GitHub API cannot verify the commit, the fields remain empty; a missing install-info is treated as a first installation. If the file or list is missing or invalid, obsolete-file removal is skipped. File contents are compared with SHA-256; all changes including removals require one confirmation. Existing-version backups and automatic rollback are not provided. Do not manually edit install.psd1.

Project organization

The project is available under the MIT License.

Commit dates are displayed in the Windows local time and regional format. An equal commit SHA skips the file-by-file check; for a manual reinstall use the latest install.ps1 from the source archive.

About

A collection of PowerShell utilities for Windows administration, maintenance, and recovery.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages