mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2025-12-20 23:00:35 -05:00
Added error for missing argument on PerformanceCounters
This commit is contained in:
parent
8f6b7ea3e7
commit
8de71663a3
1 changed files with 9 additions and 1 deletions
|
|
@ -4,9 +4,17 @@
|
|||
#
|
||||
function Show-IcingaPerformanceCounters()
|
||||
{
|
||||
param ([string]$CounterCategory);
|
||||
param (
|
||||
[string]$CounterCategory
|
||||
);
|
||||
|
||||
[hashtable]$counters = @{};
|
||||
|
||||
if ([string]::IsNullOrEmpty($CounterCategory)) {
|
||||
$counters.Add('error', 'Please specify a counter category');
|
||||
return $counters;
|
||||
}
|
||||
|
||||
try {
|
||||
# At first create our Performance Counter object for the category we specified
|
||||
$Category = New-Object System.Diagnostics.PerformanceCounterCategory($CounterCategory);
|
||||
|
|
|
|||
Loading…
Reference in a new issue