When searching i come upon this thread:
New-UDTextBox -Mask for MAC Address? - PowerShell Universal - Ironman Software Forums
I have sort of the same issue with a simple mask i want to use:
basically a-z with a max 10 chars
how can this be done without having the ‘column’ effect?
These do not work:
New-UDTextbox -Mask @(’/[a-z]/’,’/{0,10}/’)
New-UDTextbox -Mask @(’/{0,10}$/’)
New-UDTextbox -Mask @(’/[a-z]{0,10}$/’)
A mac address is just 6 groups of 2 hex chars right?
In which case, I had a go:
New-UDTextbox -Mask @('/[0-9a-fA-F]/','/[0-9a-fA-F]/','-','/[0-9a-fA-F]/','/[0-9a-fA-F]/','-','/[0-9a-fA-F]/','/[0-9a-fA-F]/','-','/[0-9a-fA-F]/','/[0-9a-fA-F]/','-','/[0-9a-fA-F]/','/[0-9a-fA-F]/','-','/[0-9a-fA-F]/','/[0-9a-fA-F]/')
Probably not the most concise but the problem I had with this is the input character does not lead it stays at position zero and fills forward which seems the wrong way around to me, I don’t know if that’s by design or if I’m doing something wrong
Also, as to why it’s so long winded, I initially tried to use '/[1-9a-fA-F]{2}/'
to represent two characters, but it broke (not sure why) and wouldnt let me type into the box, so I ended up splitting it out.
@insomniacc - Thanks for posting this workaround
@adam - Following the release of 3.1.0 in July of '22 it appears that the Mask parameter of New-UDTextBox no longer accepts a string array. Is there a way that we can incorporate @insomniacc’s workaround again?