powershell xml select attribute value where clause

后端 未结 2 923
清歌不尽
清歌不尽 2021-01-27 04:36

I have a xml file with the following elements:




        
2条回答
  •  天命终不由人
    2021-01-27 04:38

    The non-XPATH method:

    ($qrda.ClinicalDocument.recordTarget.patientRole.telecom | Where {$_.use -eq "HP"}).value
    

    Or (thanks to Tomalak's helpful comment), using the comparison statement format:

    ($qrda.ClinicalDocument.recordTarget.patientRole.telecom | Where use -eq "HP").value
    

提交回复
热议问题