Scripting Blog [archived]

Formerly known as the "Hey, Scripting Guy!" blog

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. (image) 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 back. ...

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 morning until 4 in the...

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. (image) 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 .txt instead...