Multiline strings are always a bit tricky, especially because in PS they can come in two flavours – a single string, or many strings, one per line.
I wouldn’t use Select-String here, though, in general. It’s good for finding the line your match exists on, but actually retrieving the match is a little trickier in some cases. I like to work with the built in -match operator.
# If the string is one big block, split on newline
$Lines = $StringOutput -split '\r\n?'
$Lines | ForEach-Object {
if ($_ -match 'Commit: (.+)') {
$Matches[1]
}
}