Hyper-V KVP user command
This project allows you to work with KVP Hyper-V data from the virtual machine and host side.
Hyper-V Data Exchange Service (KVP)
(Get-CimInstance -Namespace root/virtualization/v2 -ClassName Msvm_ComputerSystem -Filter 'ElementName="VM_name"' | Get-CimAssociatedInstance -ResultClassName Msvm_KvpExchangeComponent).GuestIntrinsicExchangeItems | %{$Item=([XML]$_).SelectSingleNode("/INSTANCE/PROPERTY[@NAME='Name']/VALUE/child::text()"); if($Item -ne $null) {'"{0}"="{1}"' -f $Item.Value,$Item.SelectSingleNode("/INSTANCE/PROPERTY[@NAME='Data']/VALUE/child::text()").Value}}
(Get-CimInstance -Namespace root/virtualization/v2 -ClassName Msvm_ComputerSystem -Filter 'ElementName="VM_name"' | Get-CimAssociatedInstance -ResultClassName Msvm_KvpExchangeComponent).GuestExchangeItems | %{$Item=([XML]$_).SelectSingleNode("/INSTANCE/PROPERTY[@NAME='Name']/VALUE/child::text()"); if($Item -ne $null) {'"{0}"="{1}"' -f $Item.Value,$Item.SelectSingleNode("/INSTANCE/PROPERTY[@NAME='Data']/VALUE/child::text()").Value}}