2017-03-14

指定 VDI Golden Image VHDX 到 SSD Tier

$Path = "D:\VDI"

$Files = ((Get-ChildItem -path $Path -R) | where {$_.Name -like "*.vhdx"}).FullName
$SSDTier = (Get-StorageTier | where {$_.MediaType -eq 'SSD' -and $_.Size -gt 0} | Select FriendlyName).FriendlyName
foreach ($File in $Files) {
    Write-Host
    Write-Host "Move ""$File"""
    Write-Host " to  ""$SSDTier"""
    Write-Host
Set-FileStorageTier -FilePath $File -DesiredStorageTierFriendlyName $SSDTier
}

沒有留言: