Merge pull request #8248 from marcinbojko/master

hyper-v fix for compacting only .vhd|.vhdx files
pull/8253/head
Megan Marsh 7 years ago committed by GitHub
commit e5becfc854
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -861,7 +861,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