Skip to content

Instantly share code, notes, and snippets.


Clem Messerli clemmesserli

View GitHub Profile
clemmesserli / Set-F5ProfileLink.ps1
Created Jul 18, 2022
Simple script to point VSCode, ISE, and Terminal for v5 + v7 at a single profile.ps1 file
View Set-F5ProfileLink.ps1
clemmesserli / Get-NotableParams.ps1
Created Feb 3, 2022
Updates PS Help Files and then searches for new params added in support of PS v6 or v7
View Get-NotableParams.ps1
$excludeFilter = @(
clemmesserli / Get-LatestRelease
Created Jan 13, 2022
Snippet used to pull down the latest release of an F5 RPM package
View Get-LatestRelease
$repo = "F5Networks/f5-appsvcs-extension"
$filenamePattern = "*.noarch.rpm"
$releasesUri = "$repo/releases/latest"
$downloadUri = ((Invoke-RestMethod -Method GET -Uri $releasesUri).assets | Where-Object name -like $filenamePattern ).browser_download_url
$filePath = Join-Path -Path $([System.IO.Path]::GetTempPath()) -ChildPath $(Split-Path -Path $downloadUri -Leaf)
Invoke-WebRequest -Uri $downloadUri -Out $filePath
View Invoke-Update-Module.ps1
Module clean-up script during updates
Module clean-up script during updates.
This script will presently remove all pre-existing versions from all 'Modules' paths within $env:PSModulePath.
This script will then install the desired new version within a single PSModulePath based upon the version of PowerShell running the script.
clemmesserli / Invoke-Update-Pester.ps1
Created Jan 8, 2021
This script can be used to forcibly remove the v3/v4 versions that typically ship with Windows and update to latest from PSGallery
View Invoke-Update-Pester.ps1
#Requires -RunAsAdministrator
$modules = Get-Module -Name Pester -ListAvailable
if ($null -ne $modules) {
$pesterPaths = (get-item $modules.modulebase).parent.Fullname | Sort-Object -Unique
foreach ($pesterPath in $pesterPaths) {
takeown /F $pesterPath /A /R
View MyRemoteSession.psm1
Function New-MyRemoteSession {
Setup a PowerShell profile on a remote computer
By default this function will copy the local 'profile.ps1' file from $PSHOME to same location on the remote computer you choose
PS C:\> New-MyRemoteSession -ComputerName "server01.local"
Copies profile.ps1 from local $PSHOME folder path to remote $PSHOME folder path and sets the profilename to 'WithProfile'
clemmesserli / Get-ChromeCred.ps1
Created Jun 18, 2020
Get any credentials saved within chrome browser
View Get-ChromeCred.ps1
$Path = "$env:USERPROFILE\AppData\Local\Google\Chrome\User Data\Default\Login Data"
#If Path doesnt exist > Stop
Add-Type -AssemblyName System.Security
# Credit to Matt Graber for his technique on using regular expressions to search for binary data
$Stream = New-Object IO.FileStream -ArgumentList "$Path", 'Open', 'Read', 'ReadWrite'
$Encoding = [system.Text.Encoding]::GetEncoding(28591)
$StreamReader = New-Object IO.StreamReader -ArgumentList $Stream, $Encoding
clemmesserli / Get-PasswordVault.ps1
Last active Jun 18, 2020
Returns all credentials found for logged on user of windows credential manager
View Get-PasswordVault.ps1
Read Password Vault
Get Windows Password Vault for Logged on user
#function Get-PasswordVault {
clemmesserli / GetPowerShell
Created May 1, 2020
Ways to get latest version of PowerShell
View GetPowerShell
iex "& { $(irm } -UseMSI -Preview"
wget; sudo bash -preview; rm
View gist:8aaa40cc59578282c8ff39d9c99cc5a7
Snippets CTL+ALT+J
Auto-Format CTL+ALT+F
Command Palette CTL+SHIFT+P
Expand Aliases CTL+ALT+E