Powershell Return Code mit VB Script abfragen
Guten Tag ihr Administratoren
Ich habe hier Schwierigkeiten mit VB Skript. Eigentlich möchte ich einfach meine Ausgabe aus dem PS Skript mit VB Skript übernehmen. Ich hoffe jemand kann mir helfen.
Mein PS Skript sieht folgendermassen aus:
$agendax=(get-eventlog application -newest 2 -InstanceId 123 -computer vin002.hrms.ch) | format-list;
$agendax>"L:\PM\Script\tempagendax.txt";
$string=(Select-String -Path "L:\PM\Script\tempagendax.txt" -Pattern "Mailboxes Scanned" -SimpleMatch);
if ($string -match "75") {return 0}
elseif ($string -match "74") {return 0}
elseif ($string -match "73") {return 0}
elseif ($string -match "72") {return 0}
elseif ($string -match "71") {return 0}
elseif ($string -match "70") {return 0}
elseif ($string -match "69") {return 0}
elseif ($string -match "68") {return 0}
elseif ($string -match "67") {return 0}
elseif ($string -match "66") {return 0}
elseif ($string -match "65") {return 0}
elseif ($string -match "64") {return 0}
elseif ($string -match "63") {return 0}
elseif ($string -match "62") {return 0}
elseif ($string -match "61") {return 0}
elseif ($string -match "60") {return 0}
else {return 1};
Der PS Skript funktioniert. Ich möchte gerne den return-Wert 0 oder 1 mit dem VB Skript abfangen.
Vielen Dank und freundliche Grüsse Philipp Meier
$agendax=(get-eventlog application -newest 2 -InstanceId 123 -computer vin002.hrms.ch) | format-list;
$agendax>"L:\PM\Script\tempagendax.txt";
$string=(Select-String -Path "L:\PM\Script\tempagendax.txt" -Pattern "Mailboxes Scanned" -SimpleMatch);
if ($string -match "75") {return 0}
elseif ($string -match "74") {return 0}
elseif ($string -match "73") {return 0}
elseif ($string -match "72") {return 0}
elseif ($string -match "71") {return 0}
elseif ($string -match "70") {return 0}
elseif ($string -match "69") {return 0}
elseif ($string -match "68") {return 0}
elseif ($string -match "67") {return 0}
elseif ($string -match "66") {return 0}
elseif ($string -match "65") {return 0}
elseif ($string -match "64") {return 0}
elseif ($string -match "63") {return 0}
elseif ($string -match "62") {return 0}
elseif ($string -match "61") {return 0}
elseif ($string -match "60") {return 0}
else {return 1};
Der PS Skript funktioniert. Ich möchte gerne den return-Wert 0 oder 1 mit dem VB Skript abfangen.
Vielen Dank und freundliche Grüsse Philipp Meier
Please also mark the comments that contributed to the solution of the article
Content-Key: 192138
Url: https://administrator.de/contentid/192138
Printed on: April 26, 2024 at 03:04 o'clock
3 Comments
Latest comment