This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$Test = "this is a test, love it or <leave> it." | |
$Test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$Ping = Get-WMIObject Win32_PingStatus -Filter "Address = '$IP' AND ResolveAddressNames = TRUE" | |
If ($Ping.StatusCode -eq 0) | |
{ $ComputerName = $Ping.ProtocolAddressResolved | |
} | |
Else | |
{ $ComputerName = "Unable to resolve" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[CmdletBinding()] | |
Param ( | |
[string]$Path, | |
[Alias("q")] | |
[int]$Quakes = 5, | |
[Alias("h")] | |
[int]$Height = 500, | |
[Alias("w")] | |
[int]$Width = 800 | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta name="viewport" content="initial-scale=1.0, user-scalable=no"> | |
<meta charset="utf-8"> | |
<title>Earthquakes Map</title> | |
<style> | |
html, body, #map-canvas { | |
height: $($Height)px; | |
width: $($Width)px; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$QuakesData = Invoke-RestMethod -uri "http://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/4.5_month.geojson" | |
$Count = 1 | |
[array]$Locations = ForEach ($Quake in $QuakesData.Features) | |
{ [PSCustomObject]@{ | |
Title = $Quake.properties.place | |
Magnitude = $Quake.properties.mag | |
TimeDate = [timezone]::CurrentTimeZone.ToLocalTime(([datetime]'1/1/1970').AddMilliseconds($Quake.properties.time)) | |
Lon = $Quake.geometry.coordinates[0] | |
Lat = $Quake.geometry.coordinates[1] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$QuakesData = Invoke-RestMethod -uri "http://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/4.5_month.geojson" | |
[array]$Locations = ForEach ($Quake in ($QuakesData.Features | Select -First $Quakes)) | |
{ [PSCustomObject]@{ | |
Title = $Quake.properties.place | |
Magnitude = $Quake.properties.mag | |
TimeDate = [timezone]::CurrentTimeZone.ToLocalTime(([datetime]'1/1/1970').AddMilliseconds($Quake.properties.time)) | |
Lon = $Quake.geometry.coordinates[0] | |
Lat = $Quake.geometry.coordinates[1] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$Locations = @(Invoke-RestMethod -Uri "http://www.seismi.org/api/eqs" -ErrorAction Stop | Select -ExpandProperty Earthquakes | Select -First $Quakes) | |
$Markers = "var markers = [`n" | |
ForEach ($Num in (0..($Locations.Count - 1))) | |
{ $Region = $Locations[$Num].Region.Replace("`'","\'") | |
$Markers += " ['$Region',$($Locations[$Num].Lat),$($Locations[$Num].Lon),'$($Locations[$Num].timedate)','$($Locations[$Num].magnitude)']" | |
If ($Num -lt ($Locations.Count - 1)) | |
{ $Markers += ",`n" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$Data = @" | |
Place,Address,Item,Qty,Tot | |
Gillette Stadium,1 Patriot Pl Foxborough MA 02035,Green Frogs,550,1100 | |
Fenway Park,4 Yawkey Way Boston MA 02215,Yellow Toads,100,5000 | |
Boston Garden,100 Legends Way Boston MA 02114,Blue Dragons,5,10000 | |
"@ | |
$Locations = ForEach ($Addr in ($Data | ConvertFrom-Csv )) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$Locations = ForEach ($Addr in ($Data | ConvertFrom-Csv )) | |
{ $Addr.Address = $Addr.Address -replace " ","+" | |
$Location = Invoke-RestMethod -uri "http://maps.googleapis.com/maps/api/geocode/json?address=$($Addr.Address)&sensor=false" | |
[PSCustomObject]@{ | |
Place = $Addr.Place | |
Location = $Location.Results.Formatted_Address | |
Lat = $Location.Results.Geometry.Location.Lat | |
Lng = $Location.Results.Geometry.Location.Lng | |
Item = $Addr.Item |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<table> | |
<td id="map-canvas"></td> | |
<td><b><ol>$TableInfo</ol></b></td> | |
</table> | |
</body> |
OlderNewer