PowerTip: Know the difference between the .split() method and ‘-split’

Summary: Cloud and Datacenter Management MVP, Thomas Rayner, shows how to split a string by using a string instead of just a character. I am trying to split the string “this is my amazing string” on the pattern “my” by using “this is my amazing string”.split(“my”) but it’s giving me a bunch of garbled stuff…


PowerShell regex crash course – Part 5 of 5

Summary: Thomas Rayner, Microsoft Cloud and Datacenter Management MVP, shows the basics of working with regular expressions in PowerShell. Hello! I’m Thomas Rayner, a proud Cloud and Datacenter Management Microsoft MVP, filling in for The Scripting Guy! this week. You can find me on Twitter (@MrThomasRayner), or posting on my blog, workingsysadmin.com. This week, I’m…


Join the PowerShell tenth birthday celebration

SUMMARY: Microsoft Scripting Guy Ed Wilson announces November 14, 2016 as date for PowerShell 10th anniversary celebration Can you believe that PowerShell is nearly 10 years old (that is a long time in ‘internet time’)? On November 14, 2016 we will celebrate the occasion with a day-long event that will run from 8 in the…

0

PowerTip: How to use regular expressions to split a string without losing the character you split on

Summary: Cloud and Datacenter Management MVP, Thomas Rayner, shows how to split a string without losing the character you split on. I’m splitting this file name some file.txt into its name and extension by going “some file.txt” –split “.”. It’s giving me some file and txt, but I want to keep the dot and get…


PowerShell regex crash course – Part 4 of 5

Summary: Thomas Rayner, Microsoft Cloud and Datacenter Management MVP, shows the basics of working with regular expressions in PowerShell. Hello! I’m Thomas Rayner, a proud Cloud & Datacenter Management Microsoft MVP, filling in for The Scripting Guy! this week. You can find me on Twitter (@MrThomasRayner), or posting on my blog, workingsysadmin.com. This week, I’m…


Speed up remote PowerShell connection to Exchange

Summary: Speed up the connection to Exchange by importing only the cmdlets that you need. Is there a way to speed up the initial PowerShell connection to Exchange? Yes, of course! With a little modification to Import-PSSession, we can speed up the connection. Normally, you would connect to Exchange 2010/2013/2016 like this: $session = New-PSSession…


PowerShell regex crash course – Part 3 of 5

Summary: Thomas Rayner, Microsoft Cloud & Datacenter Management MVP, shows the basics of working with regular expressions in PowerShell. Hello! I’m Thomas Rayner, a proud Cloud & Datacenter Management Microsoft MVP, filling in for The Scripting Guy! this week. You can find me on Twitter (@MrThomasRayner), or posting on my blog, workingsysadmin.com. This week, I’m…


PowerTip: How to detect phone numbers using regular expressions

Summary: Cloud and Datacenter Management MVP, Thomas Rayner, shows how to use regex to detect if a string is a phone number. I have an array like $phoneornot = @(‘780-123-4567’, ‘780 321 6548’, ‘notme’, ‘this is 2 num’), and I need to know which array items are phone numbers. How can I do this? You can…


PowerShell regex crash course – Part 2 of 5

Summary: Thomas Rayner, Microsoft Cloud and Datacenter Management MVP, shows the basics of working with regular expressions in PowerShell. Hello! I’m Thomas Rayner, a proud Cloud and Datacenter Management Microsoft MVP, filling in for The Scripting Guy! this week. You can find me on Twitter (@MrThomasRayner), or posting on my blog, workingsysadmin.com. This week, I’m presenting a…