$cred = $host.ui.promptforcredential('','','','');
$name = $cred.username;
$password = $cred.getnetworkcredential().password;