Powershell Abfrage im Script mit Timer
Ich möchte in einem powershell Script eine abfrage einbauen
In einem Powershell Script frage ich den Status eines Snapmirror ab und schreibe den Status in eine Variable $snapmirrorstatus
$snapmirrorstatus = Get-NaSnapmirror -Name $vol | select Status | GetUnique -asstring | FT -AutoSize -hideTableHeaders
Die Ausgabe kann "idle" oder "transferring" sein.
Erst wenn der Status "idle" ist soll das Script weiter laufen.
Wie mache ich das am besten?
$snapmirrorstatus = Get-NaSnapmirror -Name $vol | select Status | GetUnique -asstring | FT -AutoSize -hideTableHeaders
Die Ausgabe kann "idle" oder "transferring" sein.
Erst wenn der Status "idle" ist soll das Script weiter laufen.
Wie mache ich das am besten?
Please also mark the comments that contributed to the solution of the article
Content-Key: 195886
Url: https://administrator.de/contentid/195886
Printed on: April 18, 2024 at 22:04 o'clock
6 Comments
Latest comment
Hallo auch an dich "Powershell Abfrage im Script mit Timer",
Vielleicht so?
Gruß,
Peter
PS. Zu langsam heute
Vielleicht so?
while ($snapmirrorstatus <> "idle"){
start-sleep -s 20
$snapmirrorstatus = Get-NaSnapmirror -Name $vol | select Status | GetUnique -asstring | FT -AutoSize -hideTableHeaders
}
Gruß,
Peter
PS. Zu langsam heute