Hi, Dear.
i Have a powershell file (.ps1) i already added but i can not running on prtg because what is my parameters i dont know.
This is a PS1 file Code;
function signtest ($vkn, $port=4444, $server="SERVER_IP_ADRESS") { $client = New-Object System.Net.Sockets.TcpClient $server, $port $stream = $client.GetStream() $writer = New-Object System.IO.StreamWriter $stream $writer.AutoFlush = $TRUE $writer.WriteLine("This_is_windows_service " + $vkn)
$reader = New-Object System.IO.StreamReader $stream $line = $reader.ReadLine()
If($line.equals("OK")){ write-host $line -fore cyan } Else { write-host $line -fore red }
$reader.Dispose() $writer.Dispose() $stream.Dispose() }
signtest("our_code_is_here")
Add comment