Skip to content

Instantly share code, notes, and snippets.

@grokk-it
grokk-it / crayon_ex-01
Created September 1, 2020 15:10
crayon examples
`$ComputerNameList = Get-Content C:\Temp\computerlist.txt
Get-CimInstance -ClassName Win32_LogicalDisk -ComputerName $ComputerNameList -Filter DriveType=3 |
Where-Object Deviceid -eq c: |
Select-Object PSComputerName, DeviceID,
@{Name = 'Size (GB)'; Expression = { [math]::truncate($_.size / 1GB) } },
@{Name = 'Freespace (GB)'; Expression = { [math]::truncate($_.freespace / 1GB) } }`
@grokk-it
grokk-it / litanyagainstcloud.txt
Created October 8, 2019 22:58
The Litany Against Cloud
I must not cloud.
Cloud is the mind-killer.
Cloud is the little-death that brings total obliteration.
I will face the cloud.
I will permit it to pass over me and through me.
And when it has gone past I will turn the inner eye to see its path.
Where the cloud has gone there will be nothing. Only localhost will remain."
> Stockholm syndrome:
https://www.macobserver.com/columns-opinions/devils-advocate/the-cloud-is-a-lie/
<=
>=
(?<=ABC)
(?<=From: ).*$
function Copy-RCSSFile {
<#
.SYNOPSIS
Copy files from a given path to a remote computer.
.PARAMETER ComputerName
Target remote computer
.PARAMETER Path
@grokk-it
grokk-it / PSANSI256.txt
Last active October 24, 2020 07:48
PowerShell ANSI 256-color chart
# 256-Color Foreground & Background Charts
$esc=$([char]27)
echo "`n$esc[1;4m256-Color Foreground & Background Charts$esc[0m"
foreach ($fgbg in 38,48) { # foreground/background switch
foreach ($color in 0..255) { # color range
#Display the colors
$field = "$color".PadLeft(4) # pad the chart boxes with spaces
Write-Host -NoNewLine "$esc[$fgbg;5;${color}m$field $esc[0m"
#Display 6 colors per line
if ( (($color+1)%6) -eq 4 ) { echo "`r" }