I have the output below. I want to get only IP Address line. I wrote a for loop for it but it doesnt work.
__GENUS : 2
__CLASS : Win32_NetworkAdapterConfiguration
__SUPERCLASS :
__DYNASTY :
__RELPATH :
__PROPERTY_COUNT : 1
__DERIVATION : {}
__SERVER :
__NAMESPACE :
__PATH :
IPAddress : {192.168.1.156, fe80::801:8189:f074:bcda}
PSComputerName :
Here is my code:
sonuc = session.run_ps('Get-WmiObject -Query "SELECT IPAddress FROM Win32_NetworkAdapterConfiguration where ipEnabled=TRUE"')
for line in sonuc.std_out:
if "IPAddress" in line:
print(line)
How can I reach the IP Address line?
sonuc.std_out?sonuc.std_outis a function or the output?