The sequence of enzymatic reactions by which a cap structure is added to the 5' end of a nascent RNA polymerase II transcript. All RNA polymerase II transcripts receive a 7-methyl-G cap. Then for (at least) small nuclear RNAs (snRNAs) and small nucleolar RNAs (snoRNAs), the7-methyl-G cap is hypermethylated to become a 2,2,7-trimethylguanosine (TMG) cap.