Skip to content

Instantly share code, notes, and snippets.

View Korijn's full-sized avatar

Korijn van Golen Korijn

View GitHub Profile
@Korijn
Korijn / watch.ps1
Created January 5, 2024 15:48
Powershell CLI file watcher (put this in your $profile to use it)
function Wait-FileChange {
param(
[string]$FilePath,
[string]$Command
)
$AbsPath = (Resolve-Path $FilePath).Path
$IsDir = (Get-Item $AbsPath).PSIsContainer
if ($IsDir) {