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
# ------------------------------------------------------------------------ | |
# NAME: CSV_SelectColumns.ps1 | |
# AUTHOR: Chris Koester | |
# DATE: 11/2/2015 | |
# | |
# KEYWORDS: CSV, text, text file | |
# | |
# COMMENTS: This script is used to loop through all CSV files in a folder, | |
# select the desired columns, then output the files to a separate folder. | |
# |
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
# Checks if a website and port are accessible | |
# Returns True if accessible and times out if not accessible | |
# Use port 80 for HTTP and 443 for HTTPS | |
$site = "google.com" | |
$port = "443" | |
$tcp = New-Object System.Net.Sockets.TcpClient | |
$tcp.connect($site, $port) | |
$tcp.Connected |
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
$url = "http://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/significant_month.geojson" | |
$date = (Get-Date).ToString('yyyy-MM-dd') | |
$filePath = 'C:\Data\' + 'USGS Significant Earthquakes - Past Month' + ' ' + $date + '.js' | |
Invoke-RestMethod -Uri $url -Method GET -OutFile $filePath |
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
using System; | |
using System.Net; | |
using System.Collections.Generic; | |
using System.Web.Script.Serialization; | |
[Microsoft.SqlServer.Dts.Pipeline.SSISScriptComponentEntryPointAttribute] | |
public class ScriptMain : UserComponent | |
{ | |
string json; | |
DateTime epoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc); |