$message = "Do you want to block logons with Microsoft accounts?"
$yes = New-Object System.Management.Automation.Host.ChoiceDescription "&Yes", `
  "Blocks logons with Microsoft accounts."
$no = New-Object System.Management.Automation.Host.ChoiceDescription "&No", `
  "Does nothing."
$options = [System.Management.Automation.Host.ChoiceDescription[]]($yes, $no)
$result = $host.ui.PromptForChoice($title, $message, $options, 1)
switch ($result) {
  0 {
    $dir = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System'
    Set-ItemProperty $dir -Name NoConnectedUser -Type DWORD -Value 3
  }
  1 {
    'Please, uninstall OneDrive from this PC right now, if it is installed.'
  }
}
