Hi @Martin Thomas Duffy ,
I understand that you are hoping to return the string padded with zeroes up to 8 characters. Powershell has the built-in PadLeft method that you can use to accomplish this. I wrote and tested this function and it worked to do what you were hoping to accomplish:
function formatAccountString ($str) {
return $str.PadLeft(8, '0')
}
Here is the result using 4444:
Let me know if this helps.
-
If this answer helped resolve your question, please remember to "mark as answer" so that others in the community with similar questions can more easily find a solution.