Handle path that contains spaces in 'RegisterManifest.ps1' (#5859)

This commit is contained in:
Satoshi Tanda 2018-01-11 11:18:24 -08:00 committed by Dongbo Wang
parent 663f3a3496
commit 2ae61c8ce4

View file

@ -79,7 +79,7 @@ foreach ($file in $files)
}
}
[string] $command = "wevtutil um {0}" -f $manifest.FullName
[string] $command = 'wevtutil um "{0}"' -f $manifest.FullName
# Unregister if present. Avoids warnings when registering the manifest
# and it is already registered.
@ -88,7 +88,7 @@ Start-NativeExecution {Invoke-Expression $command} $true
if (-not $Unregister)
{
$command = "wevtutil.exe im {0} /rf:{1} /mf:{1}" -f $manifest.FullName, $binary.FullName
$command = 'wevtutil.exe im "{0}" /rf:"{1}" /mf:"{1}"' -f $manifest.FullName, $binary.FullName
Write-Verbose -Message "Register the manifest: $command"
Start-NativeExecution { Invoke-Expression $command }
}