-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathNew-UserGroupEntry.ps1
52 lines (45 loc) · 1.95 KB
/
New-UserGroupEntry.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
#requires -version 5.0
<#
Create a new JSON entry for a PowerShell User Group
You can pipe this command to Out-File or Set-Content to create the
json file.
#>
[cmdletbinding()]
Param(
[Parameter(Mandatory, HelpMessage = "Enter the name of the user group", ValueFromPipelineByPropertyName)]
[ValidateNotNullOrEmpty()]
[alias("Group Name")]
[String]$Name,
[Parameter(Mandatory, HelpMessage = "Enter the location of the user group", ValueFromPipelineByPropertyName)]
[ValidateNotNullOrEmpty()]
[String]$Location,
[Parameter(Mandatory, HelpMessage = "Enter the owner(s) of the user group. Markdown is allowed.", ValueFromPipelineByPropertyName)]
[ValidateNotNullOrEmpty()]
[String[]]$Owner,
[Parameter(HelpMessage = "Enter the email address(s) for the user group. Markdown is allowed", ValueFromPipelineByPropertyName)]
[string[]]$Email,
[Parameter(HelpMessage = "Enter the URL(s) for the user group. Markdown is allowed", ValueFromPipelineByPropertyName)]
[alias("websiteURL")]
[string[]]$URL,
[Parameter(HelpMessage = "Enter the Twitter account(s) for the user group. Markdown is allowed", ValueFromPipelineByPropertyName)]
[string[]]$Twitter,
[Parameter(HelpMessage = "Enter the Country for the user group.", ValueFromPipelineByPropertyName)]
[string]$Country = "USA",
[Parameter(HelpMessage = "Enter the postal code abbreviation for your state if in the USA.", ValueFromPipelineByPropertyName)]
[string]$State = "",
[Parameter(HelpMessage = "Enter url to an icon file or graphic for your group. It may be resized.", ValueFromPipelineByPropertyName)]
[string]$IconUrl = ""
)
Process {
[pscustomobject]@{
Name = $Name
Owner = $owner
Location = $Location
WebsiteURL = $Url
Twitter = $Twitter
Email = $email
Country = $Country
State = $state
Icon = $IconUrl
} | Convertto-Json
}