So i am trying to make a variable match the password requirements for making a virtual machine in azure CLI
to do this it must have 3 of the following !uppercase, 1
For the special characters,the regular expression should be the one in the code below.
You need to use single quote for your regular expression:
do
{
$s=Read-Host -Prompt "please enter a password"
}
until($s -like '[A-Z][A-Z][A-Z][a-z][a-z][a-z][0-9][0-9][0-9][!@$#$%^&*()_+\-\=`[`]{};'':`"\\|,.<>\/? ][!@$#$%^&*()_+\-\=`[`]{};'':`"\\|,.<>\/? ][!@$#$%^&*()_+\-\=`[`]{};'':`"\\|,.<>\/? ]')
write-host "complete entering password"
Test result as below: