Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
MadTiger2409 committed Dec 26, 2020
1 parent 6fcb423 commit 950a230
Showing 1 changed file with 17 additions and 12 deletions.
29 changes: 17 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ Script takes two parameters - name of the process to react to and time interval
Every X seconds script pulls a list of running processes and checks if there is any with name provided by user. It also checks of devices are enabled.

Decision to enable or disable a device is based on the following logic:
<table style="text-align:center;">

<table>
<tr>
<th>Is process running</th>
<th>Are devices enabled</th>
Expand All @@ -28,21 +29,25 @@ Decision to enable or disable a device is based on the following logic:
<tr>
<td>false</td>
<td>false</td>
<td style="color:green;">enable</td>
<td>enable</td>
</tr>
<tr>
<td>false</td>
<td>true</td>
<td>none</td>
</tr>
<tr>
<td>true</td>
<td>false</td>
<td>none</td>
<td>disable</td>
</tr>
<tr>
<td>true</td>
<td>true</td>
<td style="color:red;">disable</td>
<td>---</td>
<td>---</td>
<td>none</td>
</tr>
</table>
</table>

As shown in the code below:

```powershell
if($isRunning -eq $areDevicesEnabled) {
[bool]$param = -Not $isRunning
switchDevicesStatus -activateDevices $param
}
```

0 comments on commit 950a230

Please sign in to comment.