Merge pull request #8248 from marcinbojko/master

hyper-v fix for compacting only .vhd|.vhdx files
This commit is contained in:
Megan Marsh 2019-10-21 11:47:15 -07:00 committed by GitHub
commit e5becfc854
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -861,7 +861,7 @@ func CompactDisks(path string) (result string, err error) {
var script = ` var script = `
param([string]$srcPath) 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 # Failure to find any disks is treated as a 'soft' error. Simply print out
# a warning and exit # a warning and exit
if ($disks.Length -eq 0) { if ($disks.Length -eq 0) {