Skip to content

Instantly share code, notes, and snippets.

Shooting for the stars!

Andrew Pla AndrewPla

Shooting for the stars!
View GitHub Profile
AndrewPla / Show-MyTrelloBoard.ps1
Last active May 19, 2021 14:46
Displays a visual representation of a Trello Board inside the terminal.
View Show-MyTrelloBoard.ps1
#Requires -modules Microsoft.PowerShell.ConsoleGuiTools, PowerTrello
# Read more about positions
# Getting started with Terminal.UI by Adam Driscoll
# options
AndrewPla / Type-PentesterLab.ahk
Last active January 7, 2020 19:29
This is an AutoHotkey script. when ctrl + q is pressed 'pentesterlab' is typed, enter is pressed, it pauses, and repeats types pentesterlab and presses enter again. This is useful if you are doing pentesterlab exercises and don't want to type the same username and password manually.
View Type-PentesterLab.ahk
Send, pentesterlab
sleep 250
Send, {enter}
Sleep 555
Send, pentesterlab
sleep 250
Send, {enter}
AndrewPla / New-TempDirectory
Last active December 29, 2019 12:48
Cross-platform function to create temp folders. Created by Justin Grote
View New-TempDirectory
function New-TempDirectory {
$pathToCreate = join-path ([io.path]::GetTempPath()) ([io.path]::GetRandomFileName())
New-Item -ItemType Directory -Path $pathToCreate
AndrewPla / PicoCTF2019_Based.ps1
Created December 1, 2019 18:16
This script was written to solve the Based challenge from PicoCTF 2019.
View PicoCTF2019_Based.ps1
This script was written to solve the Based challenge from PicoCTF 2019.
This script connects to a target computer nad port and converts the output from Base2, Base8, and Base16.
It establishes a tcp connection, answers the questions and returns the flag for this challenge.
[string]$computer = '',
$port = '44303',
AndrewPla / Get-PublicIPInfo.ps1
Last active January 12, 2020 10:51
Returns Public IP info from Can be ran on remote computers
View Get-PublicIPInfo.ps1
function Get-PublicIPInfo {
Returns Public IP info from
.Parameter IPAddress
Supply an IP address that you would like to lookup.
.Parameter ComputerName
Names of computers to run this command on.
.Parameter Credential
Credential used by Invoke-Command when performing the lookup on a remote machine.
AndrewPla / Get-MmaEvent.ps1
Last active September 6, 2019 15:31
View Get-MmaEvent.ps1
function Get-MmaEvent {
Returns upcoming MMA events from
$request = Invoke-WebRequest -Uri ''
# Only grab the events that have a countdown.
$content = $request.Links.outertext | Where-Object {$_ -like '*days*'}
AndrewPla / Add-WindowsTerminalSchemes.ps1
Last active February 7, 2022 09:18
Updates the Windows Terminal profiles.json file with all the schemes from
View Add-WindowsTerminalSchemes.ps1
# Path to the profile when installed from the Windows Store.
$profilePath = "C:\Users\$Env:Username\AppData\Local\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState\profiles.json"
# Remove existing comments from the profiles.json file.
$profile = (Get-Content $ProfilePath) -replace '(?m)(?<=^([^"]|"[^"]*")*)//.*' -replace '(?ms)/\*.*?\*/' | Out-String | ConvertFrom-Json
$backupProfilePath = "$home\Documents\WindowsTerminalprofiles.json"
Write-Verbose "Backing up profile to $backupProfilePath"
$profile | ConvertTo-Json | Set-Content $backupProfilePath
AndrewPla / Parse-TOPdeskAccessLog.ps1
Last active March 6, 2020 18:33
Downloads access log from TOPdesk. We then extract the logfile from the zip and parse it. Finally we output an object. I blogged about this at:
View Parse-TOPdeskAccessLog.ps1
.Parameter Credential
Enter WEBdav creds for an account with the WEBDav Read permission
.Parameter TOPdeskURL
The URL of the topdesk instance. eg:,
.Parameter OutputFolder
Folder where you want the logs to be downloaded to. If not provided, the files will be downloaded into your tmp folder and will be cleaned up at the end.
.Parameter MonthsBack
Select how many months back you want to go. Default select the current month. 1 would be for this month, 3 whereas 3 would be the last 3 months
.Parameter DaysBack
AndrewPla / Download-Latest_TOPdesk_Backup.ps1
Created January 28, 2019 14:01
Download the latest backup from TOPdesk using PowerShell.
View Download-Latest_TOPdesk_Backup.ps1
# Credential needs to
$Credential = Get-Credential -Message 'enter TOPdesk operator credential with WebDAV permissions.'
$OutputFolder = 'C:\path\to\folder'
$tdurl = ''
$psDriveParams = @{
PSProvider = 'FileSystem'
Root = "\\$tdUrl@SSL\webdav" # ex: '\\\webdav'
Credential = $Credential
Name = 'TOPdesk'
AndrewPla / Iterate Over PSCustomObject Properties Example.ps1
Created January 6, 2019 19:21
iterate through all properties on a pscustomobject. This is example code to accompany a blogpost.
View Iterate Over PSCustomObject Properties Example.ps1
# Create a pscustomobject from a hashtable
$object = [pscustomobject]@{ Key1 = 'Val1' ; Key2 = 'Val2' }
# Grab all noteproperty members
$objMembers = $object.psobject.Members | where-object membertype -like 'noteproperty'
foreach ($member in $objMembers) {
# Now you can do what you want with the name and value.