0

I need to pass a parameter in a PowerShell script coming from Zabbix, and I'm not getting sucess on that.

Here is my script (which run if a specify the port in XX).

$count_unique_ips = Get-NetTCPConnection -LocalPort XX -State
Established | group RemoteAddress -NoElement  
Write-Output $count_unique_ips.count

I need to pass any port number which coming in the XX field, but when I try pass using $1, but I can't run this command. It runs only when I set the port hardcoded.

2
  • 1
    How about $args[0]? Commented Dec 30, 2016 at 18:21
  • This did not work. We tested several variations, all without success. Commented Jan 9, 2017 at 13:54

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.