We’re excited to share a new open-source PowerShell module on GitHub that provides PowerShell-native management of ReFS snapshots. It wraps the existing refsutil streamsnapshot in cmdlets designed for scripting and automation, with pipeline support and consistent error handling.
If you’re already using ReFS for resilient storage on Windows Server or client, this tooling makes it significantly easier to integrate ReFS snapshots into your existing PowerShell-based management and automation workflows.
Why PowerShell-native ReFS snapshot management?
ReFS has long supported stream-level snapshots through the refsutil streamsnapshot command-line utility, enabling point-in-time capture of individual files or streams rather than an entire volume or filesystem. This makes stream snapshots well suited for targeted comparison or recovery scenarios where full volume snapshots would be unnecessary or too heavyweight. While powerful, refsutil was designed as a low-level utility—not easy to compose into scripts, pipelines, or scheduled automation.
The ReFSSnapshots PowerShell module addresses that gap by exposing ReFS snapshot functionality through idiomatic PowerShell cmdlets, making snapshots easier to:
- Automate as part of routine server operations
- Integrate into existing PowerShell scripts and modules
- Apply consistently across many files or volumes using the pipeline
- Manage safely with parameter validation and structured error handling
What the ReFSSnapshots module provides
The ReFSSnapshots module supports the following capabilities:
- Create snapshots of files or streams at a specific point in time
- List snapshots, including wildcard-based queries
- Delete snapshots with confirmation safeguards
- Compare snapshots against the current file state
- Restore files from a previous snapshot state
- Export snapshots to standalone files on any volume
- Automate snapshot creation via Task Scheduler
- Apply retention policies to clean up older snapshots automatically
All cmdlets are designed with pipeline support, so they can be composed alongside existing storage, monitoring, or validation scripts.
Some common scenarios that this module addresses include:
- Operational safety points taken before patching, upgrades, or configuration changes
- Automated comparison workflows, where changes between known states need to be evaluated programmatically
- Scripted maintenance jobs that incorporate snapshot creation and cleanup as part of routine operations
- Advanced Windows client or workstation scenarios using ReFS for large datasets, development artifacts, or experimental workflows, where lightweight, file‑level snapshots are useful without introducing a full backup solution
Getting started
Setup instructions, documentation, and examples are available in the GitHub repository.
System requirements
- Windows Server 2019+ or Windows 10+
- An ReFS-formatted volume (version 3.7 or later)
- PowerShell 5.1 or newer (including PowerShell Core)
Examples
The following snippets are drawn from the module's GitHub examples and mapped to the scenarios called out above. They illustrate how ReFSSnapshots can be composed into routine operations, comparison workflows, scheduled maintenance, and lightweight workstation use.
Operational safety point before a configuration change — Take a named snapshot of a critical file immediately before applying a server configuration update, so you have a known-good point to compare against or restore from.
New-RefsSnapshot -Path D:\Data\database.dat -Name "PreChange_$(Get-Date -Format 'yyyyMMdd_HHmm')"
Automated comparison workflow — List recent snapshots for a file and compare the most recent one against the current state to evaluate what has changed since the last known baseline.
Get-RefsSnapshot -Path D:\Data\database.dat -Name "PreChange_*" |
Sort-Object SnapshotName -Descending |
Select-Object -First 1 |
Compare-RefsSnapshot
Scripted maintenance job with retention — Register a daily scheduled task that automatically creates snapshots of a database file and keeps only the most recent 14, so older snapshots are cleaned up as part of routine operations.
Register-RefsSnapshotSchedule -Path D:\Data\database.dat -Interval Daily -At "2:00 AM" -RetentionCount 14
Lightweight workstation snapshots for development artifacts — Use the pipeline to create a single named snapshot across many files in a working directory—useful on a Windows client when you want a quick, file-level safety net before an experimental change, without standing up a full backup solution.
Get-ChildItem E:\Repos\MyProject\artifacts\*.bin |
New-RefsSnapshot -Name "BeforeRefactor_$(Get-Date -Format 'yyyyMMdd')"
Try it out!
ReFSSnapshots provides a PowerShell-native surface over existing ReFS stream snapshot capabilities, enabling composable, scriptable file-level snapshot management on supported Windows Server and client systems. Give it a try and share your feedback on GitHub.
‑‑ Christina Curlette