We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The code here is using Get-VMIntegrationService $Name -Name "Key-Value Pair Exchange").Enabled to check if KV pair exchange service is enabled.
Get-VMIntegrationService $Name -Name "Key-Value Pair Exchange").Enabled
However, when you are using a non-English locale of Windows, you will get other names like 键值对交换 (in chinese):
键值对交换
And it throws a error when getting by name:
# Get-VMIntegrationService WindowsOnlineImage-Sysprep354251398 -Name "Key-Value Pair Exchange" Get-VMIntegrationService : 找不到具有给定名称的集成组件。 所在位置 行:1 字符: 1 + Get-VMIntegrationService WindowsOnlineImage-Sysprep354251398 -Name "K ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidArgument: (:) [Get-VMIntegrationService],VirtualizationException + FullyQualifiedErrorId : InvalidParameter,Microsoft.HyperV.PowerShell.Commands.GetVMIntegrationService
which will cause "Could not retrieve VM runtime logs"
So I think we should remove the integration service enabled check in order to retrive the log correctly:
--- a/WinImageBuilder.psm1 +++ b/WinImageBuilder.psm1 @@ -1158,8 +1158,7 @@ function Wait-ForVMShutdown { $vmState = (Get-VM -Name $Name).State $isOff = $vmState -eq "Off" try { - if ($vmState -ne "Running" -or ` - !(Get-VMIntegrationService $Name -Name "Key-Value Pair Exchange").Enabled) { + if ($vmState -ne "Running") { continue } $currentVMMessages = Get-KVPData -VMName $Name
The text was updated successfully, but these errors were encountered:
can confirm the same issue when buildong on a German Win11. Your change resolves it.
Sorry, something went wrong.
[cloudbase#352] Could not retrieve VM runtime logs
794ae1e
If it needs to keep the integration service check, it can be done like the following I think
--- a/WinImageBuilder.psm1 +++ b/WinImageBuilder.psm1 @@ -1195,7 +1197,7 @@ function Wait-ForVMShutdown { $isOff = $vmState -eq "Off" try { if ($vmState -ne "Running" -or ` - !(Get-VMIntegrationService $Name -Name "Key-Value Pair Exchange").Enabled) { + !(Get-VMIntegrationService $Name | Where-Object Id -Match "2A34B1C2-FD73-4043-8A5B-DD2159BC743F").Enabled) { continue } $currentVMMessages = Get-KVPData -VMName $Name
The ID value is described at MicrosoftDocs/azure-docs#52634
No branches or pull requests
The code here is using
Get-VMIntegrationService $Name -Name "Key-Value Pair Exchange").Enabled
to check if KV pair exchange service is enabled.However, when you are using a non-English locale of Windows, you will get other names like
键值对交换
(in chinese):And it throws a error when getting by name:
which will cause "Could not retrieve VM runtime logs"
So I think we should remove the integration service enabled check in order to retrive the log correctly:
The text was updated successfully, but these errors were encountered: