opensource
opensource copied to clipboard
PowerShell module
I think that it would a good idea develop a module for PowerShell
Until then...
Invoke-RestMethod -Uri https://api.sendgrid.com/v3/mail/send -Method Post -Headers @{"Authorization" = "Bearer $SENDGRID_API_KEY"; "Content-Type" = "application/json"} -Body '{"personalizations": [{"to": [{"email": "[email protected]"}]}],"from": {"email": "[email protected]"},"subject": "Sending with SendGrid is Fun","content": [{"type": "text/plain", "value": "and easy to do anywhere, even with PowerShell"}]}'
@movinalot Yes, I know that method, but my idea is create something more elaborate: If you have a module, you can install it, and use cmdlet with a friendly-name-functions linke "Get-SendGridConfiguration". Obviusly, for build the module you can use that API.
Great idea @vmsilvamolina! Would that be something that would be deployed to Nuget?
@movinalot would you mind making a PR against our docs with your example?
@thinkingserious I think it fits better on the PowerShell library https://www.powershellgallery.com/. You can install the module using the cmdlet Install-Module <moduleName>
.
About the examples... can I help with the PR over the docs?
@vmsilvamolina it'd be great if you want to help! If you'd like to make that PR for the documentation, that's totally fine. I don't think @movinalot will mind if you do that. Also, do you want to try to make that PowerShell module too? I'm not that familiar with the process there.
@vmsilvamolina @movinalot have a look at this. I implemented a very basic version here https://github.com/aroach/sendgrid-powershell
@aroach perfect! Can you add that to the SendGrid repo? Thats is a good point of start
@aroach how can I continue with this?, You have a module with a function, what is the next step? Does I work on your repo or I make a new pull request for the SendGrid organization?
@vmsilvamolina since it's a new language, I think it warrants a new repo in our Org, yeah? @thinkingserious does that seem OK to you?
@vmsilvamolina in the meantime, you're welcome to fork it and move it forward. We can transfer it to the SendGrid org when the time is right.
Hi,
I need to create a powershell script to create the API Keys in SendGrid. Does anyone know how to do that?
@maor29 have a look at this project. You should just need to tweak this file to agree with the API Keys API
https://github.com/aroach/sendgrid-powershell/blob/4918a8cce905a8489ada25a6efb3da4dd51af216/sendgrid.powershell.psm1#L71