1

I am running a external program on SolarWinds which calls PowerShell script and i am passing hostname as a parameter to my script .

param( $hostname )

$hostname1 ="$($hostname)"

$hostname1 |Out-File D:\hostname.txt


output in hostname.txt is

${N=SwisEntity;M=F5Device.Node.DisplayName}


how can i get the value of hostname (value of F5Device.Node.DisplayName ) ..?

  • `"_i am passing hostname as a parameter to my script_"`... Show us what you are sending as parameter – Theo May 21 '22 at 15:16
  • hi @theo .. Below is the command i put on tool when i select run a external program. C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Bypass -command "& {& "D:\Auto-Inc\VRO_PROD-script-v2.ps1" -hostname '${N=SwisEntity;M=F5Device.Node.DisplayName}' -triggertime '${N=Alerting;M=AlertTriggerTime;F=DateTime}' -ObjectURL '${N=SwisEntity;M=DetailsUrl}' -Alertdetails '${N=Alerting;M=AlertDescription}' -AcknowledgeUrl '${N=Alerting;M=AcknowledgeUrl}' -alertname '${N=Alerting;M=AlertName}' -alertdefination '${N=Alerting;M=AlertName}' }" – Tarun Gupta May 24 '22 at 09:06
  • --------D:\Auto-Inc\VRO_PROD-script-v2.ps1---------------- param( $hostname, $alertdefination, $alertname, $triggertime, $ObjectURL, $Alertdetails, $AcknowledgeUrl ) $hostname1 ="$($hostname)" $hostname1 |Out-File D:\hostname.txt – Tarun Gupta May 24 '22 at 09:10
  • @TarunGupta, did you get the chance to make it work? Please share the solution here. – Senior Systems Engineer Aug 30 '22 at 03:52

0 Answers0