$host.ui
is a System.Management.Automation.Internal.Host.InternalHostUserInterface
object. $host.ui.promptForCredential(…)
can be used to get a System.Management.Automation.PSCredential
object from a username and a password. $cred = $host.ui.promptForCredential('Connecting to XYZ', 'Enter username and password.', '', 'XYZ') Connecting to XYZ Enter username and password. User: rene Password for user rene: ********
get-credential
cmdLet. $host.ui.write('text') $host.ui.writeDebugLine('xyz was called') $host.ui.writeErrorLine('wrong input.') $host.ui.writeInformation('info') $host.ui.writeLine('just a line') $host.ui.writeProgress(…) $host.ui.writeVerboseLine(…) $host.ui.writeWarningLine(…)
write
cmdlets. $host.ui.supportsVirtualTerminal $host.ui.prompt(…) $host.ui.promptForChoice(…) $host.ui.readLineAsSecureString()