How many times have you worked with Regular Expressions and forgotten what expression denoted what? Oftentimes I need to search online to figure out what basic expressions to use or end up using another method. For this reason we are introducing a new tool that makes regular expressions more accessible to the rest of us: […]
Tag: regular expression
VBScript Regular Expressions
I seem to find my self turning to regular expressions more often these days, often to help out a fellow scripter in one of the many scripting forums I keep tabs on. I thought I’d take a moment and provide a brief explanation on how to use regular expressions in VBScript. First off, for those who don’t know, a regular expression is a way of identifying or matching a string against a pattern. For example we all know that 172.16.100.200 looks like an IP address because of its pattern. The string roygbiv@rainbow.net looks like an email address, again based on the pattern. A regular expression can be used identify strings based on a pattern.
Get Network Connections
I love that part of my job is helping people out in the forums as ScriptingAnswers.com. A recent post asked about finding out what network drives were mapped on a remote computer using PowerShell. The task sounded familiar so I poked around my script pile and found an old VBScript that used WMI and the Win32_NetworkConnection class. Great. Get-WMIObject to the rescue:
Get-WMIObject win32_networkconnection -computername Desk23
You even get a nicely formatted summary. But you me, I can’t resist tinkering so I wrote a function that enhances this basic command I call Get-NetConnection