I have a php script on a webserve that displays (as plain text, no html formatting) dhcp leave information. The output is in the following format, seperated by commas:
dnsname,leavetime,macaddress,ipaddress
i want to be able to parse this information using the invoke-webrequest powershell command and just get the mac address.
I have tried the following code:
invoke-webrequest "http://www.xxx.xxx"
The output to the console is:
StatusCode : 200
StatusDescription : OK
Content : *hostname*,in 7 days ,**Mac Address**,*ip address*
RawContent : HTTP/1.1 200 OK
Keep-Alive: timeout=2, max=100
Connection: Keep-Alive
Content-Length: 50
Content-Type: text/plain; charset=ISO-8859-1
Date: Mon, 25 Feb 2013 12:04:33 GMT
Server: Apache
ega008...
Forms :
Headers : {[Keep-Alive, timeout=2, max=100], [Connection, Keep-Alive], [Content-Length, 50], [Content-Type,
text/plain; charset=ISO-8859-1]...}
Images : {}
InputFields : {}
Links : {}
ParsedHtml :
RawContentLength : 50
Instead of all this, all I want is the mac address (Highlighted bold)
Any help greatly appreciated.
thanks.