Powershell hr

Feb 16, 2014 at 12:00

I saw this on reddit (or possibly hackernews) the other day that produces a simple banner line in bash.

So here’s a powershell version:

function hr($txt) { $ui = (Get-Host).UI.RawUI $width = $ui.WindowSize.width $n = ($width / $txt.Length) -1 $bar = “$txt” * $n echo $bar }