Sorry for the newb question. I’m new to PowerShell.
Is there a way I can get the string of data between XYZ and the first . symbol and output it to a text file?
$files=Get-ChildItem *.pdf | SelectObject -ExpandProperty Name PS C:\Users\Owner\Documents> echo $files XYZ0534.7.02.19cc.pdf XYZ0568.7.03.19cc.pdf XYZ0569.7.03.19cc.pdf XYZ0975.7.01.19cc.pdf XYZ0988.7.02.19cc.pdf XYZ1051.7.01.19cc.pdf XYZ1094.7.02.19cc.pdf XYZ1105.7.03.19cc.pdf XYZ1460.7.02.19ccCATS only.pdf XYZ1481.7.01.19cc.pdf XYZ1505.7.03.19cc.pdf XYZ1902.7.02.19cc.pdf XYZ2225.7.03.19cc.pdf XYZ2455.7.03.19ccCATS only.pdf XYZ2539.7.01.19cc.pdf XYZ2755.7.01.19cc.pdf XYZ2798.7.02.19cc.pdf XYZ2833.7.02.19cc.pdf XYZ2910.7.01.19cc.pdf XYZ2949.7.03.19cc.pdf XYZ3018.7.01.19cc.pdf XYZ3042.7.02.19cc.pdf XYZ32001.7.03.19ccCATS only.pdf XYZ60010.7.03.19cc.pdf XYZ60013.7.02.19cc.pdf
I have the following regex that works for matching the string between XYZ and the first . symbol but not sure how to achieve my end result.
(?<=XYZ)([^.]+)