Get a .gitignore file for Visual Studio fast with gitignore.io and Powershell

I often use the wonderful service at https://www.gitignore.io to grab a .gitignore file suitable for Visual Studio use. Unfortunately, the file has unix line endings – so I’ve boiled the operation down to a single line of Powershell that sorts that out in one go:

(curl https://www.gitignore.io/api/visualstudio).Content
  -split "`n" -join "`r`n" | set-content .gitignore

One thought on “Get a .gitignore file for Visual Studio fast with gitignore.io and Powershell

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>