ElseIf and Else are not recognizable

I’m trying to perform this script but ElseIf part is not recognizable by PowerShell (The term ‘ElseIf’ is not recognized as the name of a cmdlet, function), where I’m wrong?

$Yes = "Yes"
$No = "No"
$PCNameStatus = Read-Host -Prompt "Yes/No"
If ($Yes -match $PCNameStatus) {
    $PCNAME = Read-Host -Prompt "Please specify the name you want to assign"
    Rename-Computer -NewName $PCNAME
}

ElseIf ($No -match $PCNameStatus) {
    Write-Host "It's time to reboot"
    Start-Sleep -Seconds 10
    Restart-Computer
}

Else {
    Write-Host "The answer wasn't in Yes/No format"
}

Works fine.
VSCode and save as script.

Anytime you are checking a single variable against multiple values, switch is a bit cleaner imho:

$PCNameStatus = Read-Host -Prompt 'Do you want to do x. Y or N'
switch ($PCNameStatus) {
    'Y' {
        $PCNAME = Read-Host -Prompt "Please specify the name you want to assign"
        # Rename-Computer -NewName $PCNAME
    }
    'N' {
        Write-Host "It's time to reboot"
        ?Start-Sleep -Seconds 10
        # Restart-Computer
    }
    default {
        Write-Host "The answer wasn't in Y/N format"
    }
}