Skip to content

Instantly share code, notes, and snippets.

View whiteken's full-sized avatar
:octocat:

Kenny White whiteken

:octocat:
View GitHub Profile
az group create -n webapps-dev-rg -l westus2
az appservice plan create --name webapps-dev-plan \
--resource-group webapps-dev-rg \
--sku s1 \
--is-linux
az webapp create -g webapps-dev-rg \
-p webapps-dev-plan \
-n mp10344884 \
@whiteken
whiteken / downloadTerraform.ps1
Created June 16, 2021 12:41 — forked from rchaganti/downloadTerraform.ps1
Download and Install Terraform - Windows (PowerShell)
[CmdletBinding(DefaultParameterSetName='Version')]
param
(
[Parameter(ParameterSetName='Latest', Mandatory = $true)]
[Parameter(ParameterSetName='Version', Mandatory = $true)]
[String]
$SaveToPath,
[Parameter(ParameterSetName='Version', Mandatory = $true)]
[String]
@whiteken
whiteken / When not to RegEx
Created June 15, 2021 09:02
RegEx is not always the answer
function Test-Something {
[cmdletbinding()]
param(
#Required. Supply something to be tested.
[parameter(Mandatory = $true)][string]$Whatever
)
Write-Host "$Whatever has been tested OK."
}
@whiteken
whiteken / Get-S3ObjectContent
Last active June 10, 2021 15:10
Read an AWS S3 file in memory without download. I needed content from an S3 stored file inside a Lambda function (which is read only). Regular Read-S3Object has to download the file first. If there is an easier way please let me know!
function Get-S3ObjectContent {
<#
.Synopsis
Get-Content for AWS S3 file without download
.DESCRIPTION
Retreives file content from a file stored in Amazon S3 bucket without downloading
.EXAMPLE
Use the following example when already authenticated with aws, e.g. inside an aws lambda function