-
Notifications
You must be signed in to change notification settings - Fork 3
/
signature.ps1
90 lines (77 loc) · 2.79 KB
/
signature.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#set this to the location of the gam binaries
Set-Alias gam C:\gam\gam.exe
#Imports data from a csv that has coloumns listed as below. Manditory prepopulated coloums for this script to work are email first last
$salesou = Import-Csv C:\scripts\sales.csv
foreach($column in $salesou)
{
$field1 = $column.email
$field2 = $column.first
$field3 = $column.last
$field4 = $column.title
$field5 = $column.mobile
$field6 = $column.desk
$field7 = $column.link1
$field8 = $column.url1
$field9 = $column.link2
$field10 = $column.url2
$field11 = $column.link3
$field12 = $column.url3
$field13 = $column.link4
$field14 = $column.url4
$field15 = $column.link5
$field16 = $column.url5
$field17 = $column.link6
$field18 = $column.url6
$field19 = $column.link7
$field20 = $column.url7
#prepends | o: string if user has mobile and desk number
$prepend = $null;
if(![string]::IsNullOrEmpty($field6)) { $prepend = "| o: "; }
$field6 = $prepend + $column.desk
#sets the url link for the Patch Town if one exists
$url1 = $null
if(![string]::IsNullOrEmpty($field7)) {$url1 = "<a href=$field8 target='_blank'>$field7</a>"}
$url2 = $null
if(![string]::IsNullOrEmpty($field9)) {$url2 = "<a href=$field10 target='_blank'>$field9</a>"}
$url3 = $null
if(![string]::IsNullOrEmpty($field11)){$url3 = "<a href=$field12 target='_blank'>$field11</a>"}
$url4 = $null
if(![string]::IsNullOrEmpty($field13)){$url4 = "<a href=$field14 target='_blank'>$field13</a>"}
$url5 = $null
if(![string]::IsNullOrEmpty($field15)){$url5 = "<a href=$field16 target='_blank'>$field15</a>"}
$url6 = $null
if(![string]::IsNullOrEmpty($field17)){$url6 = "<a href=$field18 target='_blank'>$field17</a>"}
$url7 = $null
if(![string]::IsNullOrEmpty($field19)){$url7 = "<a href=$field20 target='_blank'>$field19</a>"}
#prepends | charecter to Patch Town url variable if not null
$prepend = $null;
if(![string]::IsNullOrEmpty($field7)) { $prepend = "| "; }
$link1 = $prepend + $url1
$prepend = $null;
if(![string]::IsNullOrEmpty($field9)) { $prepend = "| "; }
$link2 = $prepend + $url2
$prepend = $null;
if(![string]::IsNullOrEmpty($field11)) { $prepend = "| "; }
$link3 = $prepend + $url3
$prepend = $null;
if(![string]::IsNullOrEmpty($field13)) { $prepend = "| "; }
$link4 = $prepend + $url4
$prepend = $null;
if(![string]::IsNullOrEmpty($field15)) { $prepend = "| "; }
$link5 = $prepend + $url5
$prepend = $null;
if(![string]::IsNullOrEmpty($field17)) { $prepend = "| "; }
$link6 = $prepend + $url6
$prepend = $null;
if(![string]::IsNullOrEmpty($field19)) { $prepend = "| "; }
$link7 = $prepend + $url7
$html = @"
$field2 $field3<br>
$field4<br>
c: $field5 $field6<br>
<img src="insert image here" height="32px;" width="105px;"><br>
Company tag line<br>
$link1 $link2 $link3 $link4 $link5 $link6 $link7<br>
"@
gam user $field1 signature "$html"
}