The printf command offers well-defined behavior following the POSIX standard, which means it works the same way across shells ...
Don’t copy and paste the same code over and over again. Instead, create a PowerShell function and save yourself time.