in

Analyze Data with PowerShell | U.S. Presidential Election 2020 Dataset

Most of my videos on PowerShell have centered around language techniques. Let’s change gears a little bit and do something a bit more practical, like data analysis. While perusing the Internet, I discovered a New York Times API that provides 2020 U.S. election data in a JSON format. Let’s use PowerShell to download that data locally and then load it and run some queries against it!

PowerShell natively offers a ConvertFrom-Json command. Quite simply, this command accepts a JSON string as input, and in return, it provides a PowerShell object exposing the various properties on the JSON data structure.

Where-Object can be used to filter PowerShell objects using a specified “filter script.” The filter script is applied to each object in the pipeline.

Add-Member is a powerful command that enables you to add properties and methods to PowerShell objects. In this video, we’ll use Add-Member to add a new calculated property to each object in an array. We’ll take the UNIX timestamp in microseconds and turn it into a new property that contains a more human-friendly System.DateTime object.

Producer: Trevor Sullivan
Website: https://trevorsullivan.net
Patreon: https://patreon.com/trevorsullivan
Twitter: https://twitter.com/pcgeek86

#Microsoft #PowerShell #Analytics

Written by Steven Turner

US Presidential Election 2020 Results Live: America Decides – Donald Trump or Joe Biden | LBC

ELECTION 2020: Live coverage of the presidential election; Florida and Tampa Bay area results