File tree Expand file tree Collapse file tree 4 files changed +18
-6
lines changed Expand file tree Collapse file tree 4 files changed +18
-6
lines changed Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ git pull
47
47
Sample output
48
48
49
49
```` markdown
50
- # Windows Secure Auditor: 0.9.0
50
+ # Windows Secure Auditor: 0.9.1
51
51
52
52
## System Information
53
53
Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ git pull
47
47
範例輸出
48
48
49
49
```` markdown
50
- # Windows Secure Auditor: 0.9.0
50
+ # Windows Secure Auditor: 0.9.1
51
51
52
52
## 系統資訊
53
53
Original file line number Diff line number Diff line change 6
6
# RootModule = ''
7
7
8
8
# Version number of this module.
9
- ModuleVersion = ' 0.9.0 '
9
+ ModuleVersion = ' 0.9.1 '
10
10
11
11
# Supported PSEditions
12
12
# CompatiblePSEditions = @()
Original file line number Diff line number Diff line change @@ -41,15 +41,27 @@ if ($UseSmtp) {
41
41
}
42
42
43
43
# https://docs.sendgrid.com/api-reference/mail-send/mail-send
44
+ [mailaddress ]$fromMail = $From
44
45
$parameters = @ {
45
46
subject = $subject
46
47
content = @ (@ { type = ' text/plain' ; value = $body })
47
- from = @ { email = $From }
48
- personalizations = New-Object System.Collections.ArrayList
48
+ from = @ { email = $fromMail.Address }
49
+ personalizations = @ (
50
+ @ { to = @ () }
51
+ )
52
+ }
53
+
54
+ if (! [string ]::IsNullOrWhiteSpace($fromaddr.DisplayName )) {
55
+ $parameters.from.name = $fromaddr.DisplayName
49
56
}
50
57
51
58
foreach ($email in $To ) {
52
- [void ]$parameters.personalizations.Add (@ { to = @ ( @ { email = $email } ) })
59
+ [mailaddress ]$toMail = $email
60
+ $recipient = @ { email = $toMail.Address }
61
+ if (! [string ]::IsNullOrWhiteSpace($toMail.DisplayName )) {
62
+ $recipient.name = $toMail.DisplayName
63
+ }
64
+ $parameters.personalizations [0 ].to += @ ($recipient )
53
65
}
54
66
55
67
$json = $parameters | ConvertTo-Json - Depth 4 - Compress
You can’t perform that action at this time.
0 commit comments