Ad Widget

Collapse

Calling Powershell script function passing parameters

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • a.nat
    Junior Member
    • Feb 2020
    • 1

    #1

    Calling Powershell script function passing parameters

    Good Morning, Guys.

    I have a very simple question that a I can't make it work.
    Inside zabbix-agent.conf I created a reference to a script I wrote that has this function. This function waits for a parameter. So I would like to know how do I call it.

    Here is the line I am using:

    UserParameter=script.backup.vlf[*],powershell -NoProfile -ExecutionPolicy Bypass -File C:\Zabbix\Scripts\SQL-Coleta-Info-VLF.ps1 "$1" "$2"

    The first parameter should be the function and the other one the parameter itself. Is that right?
Working...