Output message in json

Would limit new console output to systems that do not already support EnhancedSessionTransportType. The vast majority of systems supports it and should not print additional messages.
This commit is contained in:
RudiMT 2023-01-20 18:51:00 +01:00 committed by sophia
parent ba562f273b
commit 431d91593a

View File

@ -22,7 +22,10 @@ try {
if($present) {
Hyper-V\Set-VM -VM $VM -EnhancedSessionTransportType $Type
}else{
Write-OutputMessage "This version of HyperV does not support EnhancedSessionTransportType, ignoring."
$message = @{
"EnhancedSessionTransportTypeSupportPresent"=$false;
} | ConvertTo-Json
Write-OutputMessage $message
}
} catch {
Write-ErrorMessage "Failed to assign EnhancedSessionTransportType to ${Type}:${PSItem}"