How to get the captured groups from Select-String?
Have a look at the following $a = “http://192.168.3.114:8080/compierews/” | Select-String -Pattern ‘^http://(.*):8080/(.*)/$’ $a is now a MatchInfo ($a.gettype()) it contain a Matches property. PS ps:\> $a.Matches Groups : {http://192.168.3.114:8080/compierews/, 192.168.3.114, compierews} Success : True Captures : {http://192.168.3.114:8080/compierews/} Index : 0 Length : 37 Value : http://192.168.3.114:8080/compierews/ in the groups member you’ll find what you … Read more