Windows Server 2016

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

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. (https://github.com/DeploymentBunny/Files/tree/master/Tools/Start-VIADeDupJob)


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

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

/mike

Categories: Windows Server 2016

Tagged as:

2 replies »

  1. Any reason not to use the -Wait parameter on the Start-DedupJob commands? You get that oh so pretty Powershell progress bar at the top.

Leave a Reply

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

WordPress.com Logo

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

Facebook photo

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

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.