SyntaxFix
Write A Post
Hire A Developer
Questions
You can use the -as operator. If casting succeed you get back a number:
$numberAsString -as [int]