Quantcast
Channel: THWACK: Popular Discussions - Script Lab
Viewing all articles
Browse latest Browse all 9937

Alert Execute Program Trigger Action

$
0
0

Hello everyone, I am trying to execute a powershell script as a trigger action. In my file path I have \\servername\C$\Windows\System32\WindowsPowerShell\v1.0\Powershell.exe -executionpolicy remotesigned -command C:\scripts\swpstest.ps1 -ComputerName ${N=SwisEntity;M=Caption}

 

My question is what method do I need to put into the powershell script in order to retrieve this parameter (node name)? Is it $args[0] ? Or param([string]$x) ?

 

For the path above I have also tried C:\Windows\System32\WindowsPowerShell\v1.0\Powershell.exe -executionpolicy remotesigned -command "C:\scripts\swpstest.ps1" -x "${N=SwisEntity;M=Caption}"

 

Any one know what I am doing wrong?


Viewing all articles
Browse latest Browse all 9937

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>