hyper-v fix for compacting vhdx/vhd only

pull/8248/head
Marcin Bojko 6 years ago
parent d4ff29f6c5
commit 1b4ffe546f
No known key found for this signature in database
GPG Key ID: 8F26D8C281F16F8F

@ -860,7 +860,7 @@ func CompactDisks(path string) (result string, err error) {
var script = `
param([string]$srcPath)
$disks = Get-ChildItem -Path $srcPath -Recurse -Filter *.vhd* -ErrorAction SilentlyContinue | % { $_.FullName }
$disks = Get-ChildItem -Path $srcPath -Recurse -ErrorAction SilentlyContinue |where {$_.extension -in ".vhdx",".vhd"} |foreach { $_.FullName }
# Failure to find any disks is treated as a 'soft' error. Simply print out
# a warning and exit
if ($disks.Length -eq 0) {

Loading…
Cancel
Save