Quantcast
Channel: Windows PowerShell Forum
Viewing all articles
Browse latest Browse all 2314

Remote Read-Host ohne Warn-Meldung

$
0
0

Hallo zusammen,

ich möchte für nachfolgenden Befehl die Warn-Meldung unterdrücken:

Invoke-Command -ComputerName HostA.Domain.Local -ScriptBlock {
    $var = Read-Host "Passwort" -AsSecureString
}


Meldung:

WARNING: A script or application on the remote computer A4TSQL111.A4T.LOCAL is sending a prompt request. When you are prompted, enter sensitive information, such as credentials or passwords, only if you trust the r
emote computer and the application or script that is requesting the data.

Ich verstehe den Ursprung dieser Meldung und kann auch nachvollziehen, dass diese wichtig ist; allerdings stört sie im Script-Ablauf. Ich habe bereits mit -WarningAction SilentlyContinous und mit 3>$Null geteste, ich bekomme diese Meldung nicht unterdrückt.

Hat mir jemand hierzu einen Tipp?

Viele Grüße
Kai Koppelmann


Viewing all articles
Browse latest Browse all 2314