Skip to content

Instantly share code, notes, and snippets.

View illusive-man's full-sized avatar

Serge Kanashin illusive-man

View GitHub Profile
@markwragg
markwragg / Sort-Natural.ps1
Last active February 5, 2024 12:16
PowerShell natural sort. A regex way to sort files that have a number in them correctly, e.g rather than img1, img10, img11, img2, -> img1, img2, img10, img11
# http://stackoverflow.com/a/5429048/2796058
$ToNatural = { [regex]::Replace($_, '\d+', { $args[0].Value.PadLeft(20) }) }
Get-ChildItem | Sort-Object $ToNatural
@bradtraversy
bradtraversy / webdev_online_resources.md
Last active May 22, 2024 06:03
Online Resources For Web Developers (No Downloading)
@mklement0
mklement0 / Get-CmdletMinPsVersion.ps1
Last active November 22, 2019 15:57
Get-CmdletMinPsVersion: PowerShell function for determining the minimum PowerShell version required to run given standard cmdlets.
function Get-MinPsVersionForCmdlet {
<#
.SYNOPSIS
Determines the minimum PowerShell version required for a given standard cmdlet.
.DESCRIPTION
NOTE:
* v3 or higher is required to run this function.
* Only cmdlets with help topics defined in the GitHub
PowerShell-documentation repository at