Skip to content

Instantly share code, notes, and snippets.

View imfioki's full-sized avatar

Brandon Garcia imfioki

View GitHub Profile
@imfioki
imfioki / WinSCP_Upload_SFTP.ps1
Created June 14, 2019 03:15
Uploading files to SFTP server using Powershell, WinSCP .NET Assembly, AWS SSM Parameter Store, SSH keys, and monitoring via AWS SNS notifications
# Download and install .NET assembly at: https://winscp.net/eng/downloads.php#additional
# This process will send SNS notifications upload upload failure.
# Define connection parameters and globals
$server = '<127.0.0.1>'
$sftpUser = '<sftp_user>'
$ssmParam = '<sftp_password>'
$awsRegion = '<us-east-1>'
$snsTopic = '<sns_topic>'
$snsSubject = 'An error has occurred in production SFTP[IAM]'
$sftp_pass = (Get-SSMParameter -Region $awsRegion -Name $ssmParam -WithDecryption $true).Value
@imfioki
imfioki / psReporting.ps1
Created June 14, 2019 02:53
Reporting in Powershell
# Here's a brisk tutorial on a basic method of reporting within Powershell.
# Yes, I know custom objects exist. :)
# Define the name for our table
$tableName = "<table_name>"
# Create the table object
$table = New-Object System.Data.DataTable "$tableName"
# Define columns for the table

Keybase proof

I hereby claim:

  • I am imfioki on github.
  • I am bgar (https://keybase.io/bgar) on keybase.
  • I have a public key ASBAj3rcZoF4rPSyrqCwj-O709dEY8V6l8qPfH5IHDclygo

To claim this, I am signing this object: