From 950a230dcdcf87ef002f9fc0b160826861d9251f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20B?= Date: Sat, 26 Dec 2020 10:12:19 +0100 Subject: [PATCH] Update README.md --- README.md | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 7a474c7..d91849c 100644 --- a/README.md +++ b/README.md @@ -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: - + +
@@ -28,21 +29,25 @@ Decision to enable or disable a device is based on the following logic: - + - - - - - - + - - - + + + -
Is process running Are devices enabled
false falseenableenable
false truenone
truefalsenonedisable
truetruedisable------none
\ No newline at end of file + + +As shown in the code below: + +```powershell +if($isRunning -eq $areDevicesEnabled) { + [bool]$param = -Not $isRunning + switchDevicesStatus -activateDevices $param +} +``` \ No newline at end of file