Skip to content

Instantly share code, notes, and snippets.

View devblackops's full-sized avatar
🎯
Lookin' for code in all the wrong places

Brandon Olin devblackops

🎯
Lookin' for code in all the wrong places
View GitHub Profile

How to get @DevBlackOps Terminal-Icons module working in PowerShell on Windows

Note: since version 0.1.1 of the module this now works in Windows PowerShell or PowerShell Core.

  1. Download and install this version of Literation Mono Nerd Font which has been specifically fixed to be recognised as monospace on Windows:

https://github.com/haasosaurus/nerd-fonts/blob/regen-mono-font-fix/patched-fonts/LiberationMono/complete/Literation%20Mono%20Nerd%20Font%20Complete%20Mono%20Windows%20Compatible.ttf

(see this issue for more info: ryanoasis/nerd-fonts#269)

@austoonz
austoonz / Invoke-FastPing
Last active March 1, 2019 17:02
A PowerShell Function that uses asynchronous ping commands to quickly ping a fleet of target machines.
# This has been replaced by the FastPing PowerShell Module.
## Source
[GitHub](]https://github.com/austoonz/FastPing)
## Installation
```powershell
Install-Module -Name FastPing -Scope CurrentUser
@Jaykul
Jaykul / PoshStep.psm1
Created January 26, 2017 06:35
Invoke-Step with dependencies
class DependsOn : System.Attribute {
[string[]]$Name
DependsOn([string[]]$name) {
$this.Name = $name
}
}
function Invoke-Step {
@Tiberriver256
Tiberriver256 / PSWebServer.psm1
Last active March 6, 2024 03:49
Sample of making a simple webserver in PowerShell. If you have more complex needs checkout Pode (https://github.com/Badgerati/Pode) as a fully fledged PowerShell web server.
Function New-PSWebServer {
<#
.Synopsis
Creates a web server that will invoke PowerShell code based on routes being asked for by the client.
.Description
New-PSWebServer creates a web server. The web server is composed of a schema that defines the client's requests to routes where PowerShell code is executed.
Under the covers, New-PSWebServer uses the HTTPListener .NET class to execute powershell code as requested, retrieves the results and sends data back through the httplistener web server framework.
@sunnyc7
sunnyc7 / Sharestate.ps1
Last active November 27, 2020 23:10
Sharing state across different runspaces using a shared variable
# Sharing state across different runspaces using a shared variable
# Expirmenting with Boe's stuff
# http://learn-powershell.net/2013/04/19/sharing-variables-and-live-objects-between-powershell-runspaces/
# Create a synhronized HashTable which will be shared across different runspaces
$hash = [hashtable]::Synchronized(@{})
$hash.one = 1
# You can also create a non-synchronized hashtable, and that will work too. (i.e. Can be used to share state across runspaces)
$hash = [hashtable]::new()