The Deployment Bunny

OS Deployment, Virtualization, Microsoft based Infrastructure…

  • Archives

  • Meta

PowerShell is King – A Data Deduplication script that runs the Optimization,Garbage Collection and Scrubbing in a single sweep, including progress

Posted by Mikael Nystrom on April 28, 2017

I use Windows Server 2016 on all my lab machines, therefore I also use Data Deduplication to save space. But I don’t run it in the background, i run it basically when I need space.

The PowerShell script. (

Function Wait-VIADedupJob
while ((Get-DedupJob).count -ne 0 )
Start-Sleep -Seconds 30

foreach($item in Get-DedupVolume){
$item | Start-DedupJob -Type Optimization -Priority High -Memory 80
$item | Start-DedupJob -Type GarbageCollection -Priority High -Memory 80 -Full
$item | Start-DedupJob -Type Scrubbing -Priority High -Memory 80 -Full


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: