Instantly share code, notes, and snippets.

View Install-AWSCLI.ps1
# https://docs.aws.amazon.com/cli/latest/userguide/awscli-install-windows.html
$dlurl = "https://s3.amazonaws.com/aws-cli/AWSCLI64PY3.msi"
$installerPath = Join-Path $env:TEMP (Split-Path $dlurl -Leaf)
Invoke-WebRequest $dlurl -OutFile $installerPath
Start-Process -FilePath msiexec -Args "/i $installerPath /passive" -Verb RunAs -Wait
Remove-Item $installerPath
View AutoHotkey.ahk
OnExit, ExitSub
;AUTO LOAD SCRIPTS
;==============================================================================
Loop, AutoHotkey.d\*.ahk
{
OutputVarPID =
Run, %A_AhkPath% "%A_LoopFileFullPath%", , , OutputVarPID
CloseProcessesOnExit = %CloseProcessesOnExit%%OutputVarPID%`n
}
View WindowsServerSetup.ps1
# Install Google Chrome (code downloaded from another Gist)
Invoke-Expression ((Invoke-WebRequest "https://gist.githubusercontent.com/dansmith65/4c012304ed96596dbbcad8e4a15f7583/raw/Install-GoogleChrome.ps1").Content)
# Install Nodepad++ (code downloaded from another Gist)
Invoke-Expression ((Invoke-WebRequest "https://gist.githubusercontent.com/dansmith65/a862f301fce553b26db9689ad0f87b6a/raw/Install-NotepadPlusPlus.ps1").Content)
# Install AWS CLI (code downloaded from another Gist)
Invoke-Expression ((Invoke-WebRequest "https://gist.githubusercontent.com/dansmith65/79275f15fe25550e65ccd4d6bf1448cf/raw/Install-AWSCLI.ps1").Content)
# Set Timezone
View Install-GoogleChrome.ps1
$InstallerPath = Join-Path $env:TEMP "chrome_installer.exe"; Invoke-WebRequest "https://dl.google.com/chrome/install/latest/chrome_installer.exe" -OutFile $InstallerPath; Start-Process -FilePath $InstallerPath -Args "/silent /install" -Verb RunAs -Wait; Remove-Item $InstallerPath
View Install-NotepadPlusPlus.ps1
# https://github.com/notepad-plus-plus/notepad-plus-plus/issues/604#issuecomment-126175283
$res = Invoke-WebRequest https://notepad-plus-plus.org/update/getDownloadUrl.php
if ($res.StatusCode -ne 200) {throw ("status code to getDownloadUrl was not 200: "+$res.StatusCode)}
$dlurl = ($res.Content | Select-Xml /GUP/Location).node.InnerXML
$installerPath = Join-Path $env:TEMP (Split-Path $dlurl -Leaf)
Invoke-WebRequest $dlurl -OutFile $installerPath
Start-Process -FilePath $installerPath -Args "/S" -Verb RunAs -Wait
Remove-Item $installerPath
View Get-TodoistBackup.ps1
# Get-TodoistBackup.ps1
# Created By: Daniel Smith dan@dansmith65.com
#
# Download the latest backup from Todoist
#
$token = ""
# get list of backups from Todoist
View VerifyVariablesNotEmpty.fmfn
/**
* =====================================
* VerifyVariablesNotEmpty ( nameList )
*
* RETURNS:
* True (1) if a locally scoped $variable matching each value in nameList
* is not empty; False (0) otherwise.
*
* PARAMETERS:
* nameList: A return-limited list of names to check. Names do not need to
View #.fmfn
/**
* =====================================
* # ( name ; value )
*
* RETURNS:
* An name-value pair in Let notation.
*
* PARAMETERS:
* name: The name for the returned name-value pair. name can be any value
* that would be a valid Let() variable name.
View RowContainingValue.fmfn
/**
* =====================================
* RowContainingValue ( data ; firstColumnValue ; columnSeparator ; rowSeparator )
*
* RETURNS:
* First row from an array of data where the first columns value matches.
* WITHOUT trailing column separator.
*
* PARAMETERS:
* data: array of data with single characters delimiting columns/rows
View #SanitizeName.fmfn
/**
* ============================================================================
* #SanitizeName ( name )
*
* PURPOSE:
* Remove characters that are not valid for use in a Let() variable name.
*
* RETURNS:
* Text that is a valid Let() variable name, if an error occurs, the original text is returned.
*