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