Windows location api
Jump to navigation
Jump to search
PS C:\> $fac = new-object –ComObject LocationDisp.LatLongReportFactory PS C:\> $report = $fac.LatLongReport
The $report object then has all the location state, i.e.
PS C:\> $report
Latitude : -33.795303544576 Longitude : 151.234523452754 ErrorRadius : 65 Altitude : 3.1126156789E-322 AltitudeError : 10 Timestamp : 16/10/2013 3:04:24 AM
Similarly you can get civic address information using the civic report:
PS C:\> $civfac = new-object –ComObject LocationDisp.CivicAddressReportFactory PS C:\> $civfac.CivicAddressReport
AddressLine1 : 1 AddressLine2 : George St City : Sydney StateProvince : NSW PostalCode : 2000 CountryRegion : Australia DetailLevel : 5 Timestamp : 16/10/2013 3:04:53 AM