-
-
Save daephx/085e4a790796942f2535d3f96007eda8 to your computer and use it in GitHub Desktop.
[New-Gitignore] Generate a new ignore file via 'gitignore.io'. #PowerShell
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.SYNOPSIS | |
Generate a new ignore file via 'gitignore.io' | |
.LINK | |
https://www.toptal.com/developers/gitignore | |
#> | |
#Requires -Version 3.0 | |
Function New-Gitignore { | |
Param( | |
[Parameter(Mandatory)] | |
[string[]]$list | |
) | |
$params = $list -join "," | |
Invoke-WebRequest -Uri "http://gitignore.io/api/$params" | |
| Select-Object -ExpandProperty content | |
| Out-File -FilePath $(Join-Path -Path $pwd -ChildPath ".gitignore") -Encoding ascii | |
If ($?) { Write-Host "Created .gitignore for the following inputs`n$params" } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment