如何从管道链中的父对象输出属性?
例如:
get-vm | get-vmdisk | forEach {Get-VHDInfo $ _.DiskPath} | 选择-Property Path,ParentPath,VM.VMElementName
基本上它是我想知道的VM.VMElementName(我编写了这个语法).它不是直接对象(来自Get-VHDInfo),而是我想要获取值的祖父母(来自get-vm).
powershell
powershell ×1