Your code, as posted, DOES include a space between 'HLKM_' and '$_'
{ rename-item $_ "HKLM_ $_" }
If this IS just a typo, you could use the following code, which trims any spaces from $_
prior to inserting it into the string to replace the {0}
token.
{ rename-item $_ ( "HKLM_{0}" -f $_.Trim() ) }