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
tException
+ FullyQualifiedErrorId : Argument,abcd.ps1
Our community of experts have been thoroughly vetted for their expertise and industry experience.
The Distinguished Expert awards are presented to the top veteran and rookie experts to earn the most points in the top 50 topics.