New-UDTextBox -mask is gone?

Product: PowerShell Universal
Version: 1.4.6

I tried finding older topics, but apparently mask has been removed since then? It still shows up in the documentation, but it is clearly no longer an option in the product. Is that correct? Is there any field masking at all anymore?

What version are you on?

In v5, a masked text input can be accomplished with New-UDTextbox -Type password <...>

P.S. Welcome!!

Oh awesome thanks. Yes I am on v5. New to PSU, so I’m trying to use the documentation but it doesn’t seem to be fully updated yet.

But what about phone numbers? That doesn’t appear to be a mask you can do with it.

Correct - to my knowledge at least. I have a custom method I use to format phone numbers that you may be able to make use of with the -OnChange event handler:

function Format-PhoneNumber ($Number) {
  $PhoneNumberFormat = "+1 (###) ###-####"
  $PhoneNumber = "{0:$PhoneNumberPattern}" -f [int64]($Number)
  return $PhoneNumber
}

Usage:
Format-PhoneNumber -Number "2125550123"
Returns:
+1 (212) 555-0123
DISCLAIMER: I have no earthly idea how this will work when using the OnChange handler if the value gets fed back into itself. Be careful!

@adam Just upgraded to v5 and I use lot of New-UDTextbox and New-UDTableColumn -Mask
To format my forms fields, also use regex in some cases.

Can you return this feature?

PS. Got few issues that removed features BREAKS my code!
This happen not just in this case.

PLEASE help us upgrade PSU version easily without rewrite our code :pray:

yes please return that option
not every masked entered text is password.
is used it for making sure that entered string starts with certain value

New-UDTextbox -Id 'new_ad_group' -Value "TECH_PU_"  -Mask "TECH_PU_*******************************" 

maybe not the perfect way but its working.
this way text in UDTextbox starts automatically with this TECH_PU_ and if user decides to delete required portion of the string - it cannot be done.
now i dont have an easy way to achieve that.

1 Like

I’m in the process of installing v5.2 and moving a couple apps over and noticed this appears to be my only issue. Hopefully, this gets added back before my planned deployment. Not sure my OCD can handle invalid formats. :stuck_out_tongue_winking_eye:

I opened an issue for this: Reimplement -Mask on New-UDTextbox · Issue #4236 · ironmansoftware/powershell-universal · GitHub

1 Like