E
E
Evgeny Kotov2020-10-02 15:27:51
PowerShell
Evgeny Kotov, 2020-10-02 15:27:51

How to correctly check for matching strings?

Good afternoon. A very gentle help to match the condition.
Essence in sleduyushchsays: Is the Machine with Acronis, it is necessary to monitor Backup.

The idea is as follows. By running "acrocmd list plans" we get the table.
5f7716f6a5810988628061.png

The question itself: How to correctly use the data to compose the condition

if Name & State & Status & Enabled = DC idle ok true : Action ....

Since I myself used PowerShell at a primitive level, I would like to see a live example
for further completion

Thank you in advance

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Evgeny Kotov, 2020-10-07
@eskotov

Made a crutch

acrocmd list plans >> C:\Temp\plans.txt
if (Select-String -path C:\Temp\plans.txt -pattern "DC            idle    error")
{
 write-host "nok dc"
}

At the moment I'm reading the Manual and trying to remake

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question