Skip to content

Instantly share code, notes, and snippets.

View HeyItsGilbert's full-sized avatar

Gilbert Sanchez HeyItsGilbert

View GitHub Profile
@jborean93
jborean93 / NoGui.ps1
Last active October 31, 2023 00:39
Generates an exe called NoGui.exe that can spawn a hidden windows
<#
NOTE: Must be run in Windows PowerShell (5.1), PowerShell (7+) cannot create standalone exes.
This is designed to create a simple exe that can be used to spawn any console
application with a hidden Window. As NoGui.exe is a GUI executable it won't
spawn with an associated console window and can be used to then create a new
process with a hidden console window with the arguments it was created with.
The arguments after -- will be used as the new process, for example
C:\path\NoGui.exe -- pwsh.exe
@Wra7h
Wra7h / Get-ProcessPipes.ps1
Last active May 3, 2024 00:41
Use PowerShell to get the PIDs associated with Named Pipes
function Get-ProcessPipes{
param(
[Parameter(Mandatory=$false)]
[string]$CSV,
[Parameter(Mandatory=$false)]
[switch]$All
)
Add-Type -TypeDefinition @"
using System;
@jborean93
jborean93 / PSGet Publisher Checks.md
Last active April 15, 2024 23:53
Behaviour of signed PowerShell scripts

PSGet Code Signing

This is to try and document the behaviour around PowerShellGet/PSResourceGet code signing publisher behaviour.

Setup

The following code can be used to set up this scenario. This must be run as an administrator in Windows PowerShell.

Note: PowerShell uses implicit remoting for the New-SelfSignedCertificate which breaks the constains serialization. You must run this on Windows PowerShell.

@mklement0
mklement0 / Debug-String.ps1
Last active August 24, 2023 06:40
PowerShell function to visualize control characters and Unicode characters in strings
<#
Prerequisites: PowerShell v5.1 and above (verified; may also work in earlier versions)
License: MIT
Author: Michael Klement <mklement0@gmail.com>
DOWNLOAD and DEFINITION OF THE FUNCTION:
irm https://gist.github.com/mklement0/7f2f1e13ac9c2afaf0a0906d08b392d1/raw/Debug-String.ps1 | iex
@keyan
keyan / config_management_terms.md
Last active March 22, 2024 15:55
Chef <-> Salt <-> Puppet terminology equivalence

Recently I have had to deal with Salt configuration. I am doing product work so I didn't want to focus too much on deeply grasping Salt, but instead knowing the terminology equivalents to Chef/Puppet which I am comfortable with.

Salt Chef Puppet
state resource resource
states recipes manifests
formula* cookbook module
pillars databags hiera
grains ohai facter