You need to use the pipe for an or statement to work not a slash
This...
while ($choice -notmatch "y/n"
...should be this...
while ($choice -notmatch "y|n"
This is wrong, because you do not have a populated variable in the posted code to use...
Disable-ADAccount $Username
... based on your code, it should be this...
Disable-ADAccount $User
No need to seperate the variable in the choice statment. Just do this.
$choice = read-host "Are you sure you want to disable the following user? (Y or N) $name"
Example:
$choice = ""
$User = read-host "enter username"
$Name = $User
while ($choice -notmatch "y|n")
{
$choice = read-host "Are you sure you want to disable the following user? (Y/N) $Name"
If ($Choice -eq "y")
{ $User }
}
enter username: test
Are you sure you want to disable the following user? (Y/N) test: u
Are you sure you want to disable the following user? (Y/N) test: u
Are you sure you want to disable the following user? (Y/N) test: y
test
enter username: test1
Are you sure you want to disable the following user? (Y/N) test1: h
Are you sure you want to disable the following user? (Y/N) test1: h
Are you sure you want to disable the following user? (Y/N) test1: n