Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Troubleshooting
Research
Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

How to eliminate the special character - and goto next in powershell

Avatar of Sekar Chinnakannu
Sekar ChinnakannuFlag for Singapore asked on
PowershellWindows Server 2008
4 Comments1 Solution158 ViewsLast Modified:
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
ASKER CERTIFIED SOLUTION
Avatar of Chris Dent
Chris DentFlag of United Kingdom of Great Britain and Northern Ireland imagePowerShell Developer
Commented:
This problem has been solved!
Unlock 1 Answer and 4 Comments.
See Answers