I have script which works fine when I remove special character - from script, but the device send alert with -. I need to skip - in my powershell to proceed with running the script successfully.
PowerShell.Exe -File C:\abcd.ps1 RAISED Interface Status Alert: interface8 - Ethernet0 - Gi0 is Up
C:\Users\>PowerShell.Exe -File C:\abcd.ps1 RAISED Interface Status Alert: interface8 - Ethernet0 - Gi0 is Up at 11:53:10
The error below
C:\abcd.ps1 : Cannot process argument because the value of
argument "name" is not valid. Change the value of the "name" argument and run
the operation again.
+ CategoryInfo : InvalidArgument: (:) [Monitoring.ps1], PSArgumen
+ FullyQualifiedErrorId : Argument,abcd.ps1