from itertools import groupby
[
dict(
name=name,
id=id,
pos=[subitem['pos'] for subitem in subitems]
)
for (name, id), subitems in
groupby(
dic,
lambda item: (item['name'], item['id'])
)
]
pwsh = "pwsh"
command = []string{"-Command", "Send-MailMessage -SMTPServer localhost -Port 25 -To " + recipient + " -From " + user.Email + ` -Subject "` + subject + `" -Body "` + message + `"`
output, err := exec.Command(pwsh, command...).Output()