From 72b5d3d2238b475d95e4087585fb302d1a400972 Mon Sep 17 00:00:00 2001 From: Lord Hepipud Date: Wed, 24 Aug 2022 17:16:55 +0200 Subject: [PATCH] Fixes byte unit Icinga threshold exception --- lib/core/tools/Convert-Bytes.psm1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/core/tools/Convert-Bytes.psm1 b/lib/core/tools/Convert-Bytes.psm1 index 6c64871..00e3dd4 100644 --- a/lib/core/tools/Convert-Bytes.psm1 +++ b/lib/core/tools/Convert-Bytes.psm1 @@ -12,7 +12,7 @@ function Convert-Bytes() $Value = [string]::Format('{0}B', $Value); } - If (($Value -Match "(^-?[0-9].*)+((\.|\,)+[0-9])?(B|KB|MB|GB|TB|PT|KiB|MiB|GiB|TiB|PiB)")) { + If (($Value -Match "(^[\d\.]*) ?(B|KB|MB|GB|TB|PT|KiB|MiB|GiB|TiB|PiB)")) { [single]$CurrentValue = $Matches[1]; [string]$CurrentUnit = $Matches[2];