How do I use the meslo font for visual studio code

None of these answers were working for me because I was using MesloLGS NF for my iTerm2. What I did was took the exact value that was being displayed in iTerm2 -> Preferences -> Profiles -> Text under the font section,

iTerm2 Settings

and typed that into my settings.json under terminal.integrated.fontfamily.

VS Code Settings

Copy from here:

"terminal.integrated.fontFamily": "MesloLGS NF",

I have seen that the name I was using is not the correct name: Here is the correct name here "Meslo LG M DZ for Powerline"

    "terminal.integrated.fontFamily": "Meslo LG M DZ for Powerline"

This one worked fine