Skip to content

Instantly share code, notes, and snippets.

View Jaykul's full-sized avatar
😀
Learning

Joel Bennett Jaykul

😀
Learning
View GitHub Profile
Set-PowerLinePrompt `
-SetCurrentDirectory `
-RestoreVirtualTerminal `
-PowerLineFont `
-FullColor `
-Title {
$title = "PowerShell {0} - {1} ({2}) - PID: {3}" -f $PSVersionTable.PSVersion.ToString(),(Convert-Path $pwd), $pwd.Provider.Name,$PID
if (Test-Elevation) {
"Elevated - $title"
} else {
@amandadebler
amandadebler / BootlegPowerShellGet.psm1
Last active October 16, 2019 18:34 — forked from Jaykul/PowerShellGet.psm1
PowerShell Gallery Module - Bootleg Edition
<#
Forked from https://github.com/jaykul Gist, posted in response to my Twitter
whinge about PowerShellGet in the enterprise - Thank you, Joel Bennett!
This adds the ability to use a web proxy, using your current session's
credentials. Might add option to use other credentials, if there's demand.
It also adds a 'BL' (Bootleg) prefix to the nouns, just to prevent confusion with the "real"
cmdlets. Feel free to remove them.
@lnattrass
lnattrass / get_tds_cert.py
Last active February 6, 2025 23:30
A terrible way to connect to MS SQL Server and dump the certificate as a PEM
import sys
import pprint
import struct
import socket
import ssl
from time import sleep
# Standard "HELLO" message for TDS
prelogin_msg = bytearray([ 0x12, 0x01, 0x00, 0x2f, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x06, 0x01, 0x00, 0x20,
0x00, 0x01, 0x02, 0x00, 0x21, 0x00, 0x01, 0x03, 0x00, 0x22, 0x00, 0x04, 0x04, 0x00, 0x26, 0x00,
@msnelling
msnelling / Install-Miniconda.ps1
Created December 16, 2016 09:01
Installs Miniconda from extracted .exe installer
param(
[string]$Exe7z,
[string]$PackageDir,
[string]$InstallDir
)
Function Expand-ToDirectory {
param(
[string]$Archive,
[string]$TargetDir
@bielawb
bielawb / CompleteShould.ps1
Created November 29, 2016 18:44
TabExpansion for Should
Register-ArgumentCompleter -Native -CommandName Should -ScriptBlock {
param ($WordToComplete, $CommandAst)
$options = @(
'Be'
'BeExactly'
'BeLike'
'BeGreaterThan'
'BeLessThan'
'Contain'
'Match'
Add-Type @"
using System;
using System.Runtime.InteropServices;
public class NativeConsoleMethods
{
[DllImport("kernel32.dll", CharSet = CharSet.Unicode, SetLastError = true)]
public static extern IntPtr GetStdHandle(int handleId);
@lzybkr
lzybkr / Convert-ArgumentCompleterRegistrationScript.ps1
Created April 27, 2015 18:41
Script to convert TabExpansion++ completers to use Register-ArgmentCompleter
param(
[Parameter(ValueFromPipelineByPropertyName = $true, Mandatory, Position = 0)]
[Alias("PSPath")]
[string]$Path,
[string]$OutputPath
)
process