<# FPS:Containers:Common:Public:ConvertTo-DotFill:ACTIVE
#>
function ConvertTo-DotFill ([int] $pDots, [string] $pStr) {
<#
.Description
Module: Common
Public CmdLet:
ConvertTo-DotFill.ps1
Dependencies: None
This CmdLet right-dot-pads the
string sent for the number of dots to make a consistent spacing
sequence. It's a
simple re-use of the ConvertTo and is used a good bit
throughout FPS.
.USAGE
Called throughout FPS to determine a CmdLet's
existence. Returns the
.EXAMPLE
if (Push-NeededFor ConvertTo-DotFill) { . (Get-ActiveFileNm -PS1 ConvertTo-DotFill) }
$newStr=ConvertTo-DotFill
40 'Dot Fill This'
Expected Result: The variable $newString
will be set to "Dot Fill This ......................... "
.CC
[2024.11.06 JD] Original code release
.NOTES
If the fill number <= the current length of the str,
the original str will be returned.
#>
$strNew = ($pStr -as [string])+' '
while ($strNew.length -lt ($pDots-1)) { $strNew += '.' }
($strNew+' ')
}