How can we center text in PowerShell? WindowWidth doesn\'t exist apparently, so is there a way somehow to keep the text centered?
WindowWidth
We want this output :<
You can calculate the spaces you need to add and then include them as follows:
$Width = 3 for ($i=1; $i -le 7; $i+=2) { Write-Host (' ' * ($width - [math]::floor($i / 2))) ('*' * $i) }