PowerShell : Finding number of lines in a File

Requirement: In Automation using PowerShell Scripting its very often a requirement to read input from a file.  Usually the input is separated by new line in the file. Your PowerShell should read all lines from the file and process the input line by line. Say, you have list of servers in file and you want to check service status for each of the server in the file.  Solution: In PowerShell Get-Content is used for most cases to read a file and process it line by line. It just works fine in most of the cases. But if you need to […]

Read more

JSP RegEX fails with error Unexpected quantifier

JSP RegEX fails with error Unexpected quantifier This is a quick article to explain about JSP RegEX fails with error Unexpected quantifier Scenario: You have a JSP page that has been running for a long while.  All of sudden you notice its failing resulting in unexpected behavior. Upon troubleshooting you learn that the JSP page fails while create a New RegEx object. Error: When you enable Try & Catch exception in JSP you’ll get the error message “Unexpected quantifier”  as  given below: JSP Code to catch the exception: [code language=”javascript”] <html> <script type="text/javascript"> try{ var mywebsites = "*.TestSite.com|*.TestSite.com|*.TestSite.com| www.mp3.com | […]

Read more