-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathOperations-Projects.psm1
More file actions
45 lines (39 loc) · 1.05 KB
/
Operations-Projects.psm1
File metadata and controls
45 lines (39 loc) · 1.05 KB
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
function Get-TestRailProject
{
param
(
[Parameter(Mandatory=$true, ValueFromPipelineByPropertyName=$true)]
[Alias('project_id')]
[int]
$ProjectId
)
PROCESS
{
$Uri = "get_project/$ProjectId"
$Parameters = [System.Web.HttpUtility]::ParseQueryString([String]::Empty)
Request-TestRailUri -Uri $Uri -Parameters $Parameters
}
}
function Get-TestRailProjects
{
param
(
[Parameter(Mandatory=$false)]
[bool]
$IsCompleted
)
$Uri = "get_projects"
$Parameters = [System.Web.HttpUtility]::ParseQueryString([String]::Empty)
if ( $PSBoundParameters.ContainsKey("IsCompleted") )
{
if ( $IsCompleted -eq $true )
{
Add-UriParameters -Parameters $Parameters -Hash @{ is_completed = 1 }
}
else
{
Add-UriParameters -Parameters $Parameters -Hash @{ is_completed = 0 }
}
}
Request-TestRailUri -Uri $Uri -Parameters $Parameters
}