I'm developing a PowerShell script to clean up FSLogix profiles stored in an Azure file share. Before running it in production, I want to verify that it correctly identifies inactive, disabled, and deleted-user profiles without removing anything unexpectedly. I don't currently have a separate share containing realistic inactive and active profiles, so I'm looking for practical ways to build a representative test environment and validate the script safely.
3 Answers
Create a separate Azure file share and populate it with test folders and empty VHDX files that match the naming and directory structure used in production. You can script the setup so the test data covers active users, stale profiles, disabled accounts, and deleted users. Run the cleanup against that share first, and consider adding Pester tests so future script changes are checked automatically.
Add PowerShell’s ShouldProcess support to the script so it works with `-WhatIf` and `-Confirm`. Also include detailed logging of every profile the script evaluates and the action it would take. That lets you review the planned deletions without actually changing the share, then compare the output with your expectations before enabling destructive behavior.
Define the cleanup rules explicitly and test each one separately. For example, you might remove profiles that have not been accessed for three months, profiles belonging to users disabled for at least three months, and profiles for accounts that no longer exist. Make sure those retention periods are approved by the business before putting the cleanup into production.

Related Questions
Can't Load PhpMyadmin On After Server Update
Redirect www to non-www in Apache Conf
How To Check If Your SSL Cert Is SHA 1
Windows TrackPad Gestures