mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2025-12-20 23:00:35 -05:00
20 lines
441 B
PowerShell
20 lines
441 B
PowerShell
function Format-IcingaPerfDataLabel()
|
|
{
|
|
param(
|
|
$PerfData,
|
|
[switch]$MultiOutput = $FALSE
|
|
);
|
|
|
|
if ($MultiOutput) {
|
|
return (($PerfData) -Replace '[\W]', '');
|
|
}
|
|
|
|
$Output = ((($PerfData) -Replace ' ', '_') -Replace '[\W]', '');
|
|
|
|
while ($Output.Contains('__')) {
|
|
$Output = $Output.Replace('__', '_');
|
|
}
|
|
|
|
# Remove all special characters and spaces on label names
|
|
return $Output;
|
|
}
|