Hallo Dukel, MurdocX,
super, danke erstmal.
Ich würde für meine Scripte den "Microsoft Weg"
https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_functions_advanced_parameters?view=powershell-6
gehen.
Allerdings hab' ich noch nicht ganz verstanden, wie ich das dann aufrufe.
Folgendes lege ich im Script an:
<#
.Parameter Arg
string - date, time, datetime, day, dayname, dayshortname, month, monthname, monthshortname, year, hour, minute, second, uptime, timezone
.Parameter warn
string - warning treshold
.Parameter crit
string - critical treshold
.EXAMPLE
/usr/lib/nagios/plugins/check_nrpe -t 50 -H <HOSTNAME.DOMAIN> -c check_win_datetime -a timezone
#>
param(
[string]$Arg = "uptime",
[string]$warn = 0,
[string]$crit = 0
)
Ich habe 3 Parameter, welche erwartet werden.
Für jeden dieser Parameter habe ich ein ".Parameter" angelegt.
Wie rufe ich nun das Script auf, um die entsprechende Zeile(n) zu bekommen.
Letztenlich will ich alle auf einmal haben.
DANKE