문제

I am trying to read the "-Dhttp.port" value with no luck.

AS you can see in the attached image, "Options" is a sub-key and I am able to read "Options" using the following snippet (this shows unnecessary PowerShell items too though)

Get-ItemProperty $PATH -Name "Options"    

Now from the multi-line "Options" I want to read the value of specific sub-key "-Dhttp.port" which is 80 here

enter image description here

Output for Get-ItemProperty $PATH -Name "Options" is

enter image description here

I want to read only "Options", and from Options key I want to read value of "-Dhttp.port".

도움이 되었습니까?

해결책

PS>( Get-ItemProperty $PATH |select -ExpandProperty Options|where {$_ -match "-Dhttp.port"}).split("=")[1]
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top