Skip to content

Commit 71fca13

Browse files
author
BNWEIN
authored
Merge pull request BNWEIN#66 from BNWEIN/Dev
Dev
2 parents 9b2344c + 32bcc46 commit 71fca13

12 files changed

Lines changed: 225 additions & 3 deletions

File tree

CIPPAPIModule/CIPPAPIModule.psd1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
RootModule = 'CIPPAPIModule.psm1'
1313

1414
# Version number of this module.
15-
ModuleVersion = '1.2.7'
15+
ModuleVersion = '1.2.8'
1616

1717
# Supported PSEditions
1818
# CompatiblePSEditions = @()
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<#
2+
.SYNOPSIS
3+
Gets tenant groups from the CIPP API.
4+
5+
.DESCRIPTION
6+
The Get-CIPPTenantGroups function retrieves a list of tenant groups from the CIPP API. It can optionally filter by a specific group ID.
7+
8+
.PARAMETER GroupID
9+
Optional. The ID of the group to filter by.
10+
11+
.EXAMPLE
12+
Get-CIPPTenantGroups
13+
Returns all tenant groups.
14+
15+
.EXAMPLE
16+
Get-CIPPTenantGroups -GroupID "12345678-1234-1234-1234-1234567890AB"
17+
Returns the tenant group with the specified ID.
18+
19+
#>
20+
function Get-CIPPTenantGroups {
21+
[CmdletBinding()]
22+
Param(
23+
[Parameter(Mandatory = $false)]
24+
[string]$GroupID
25+
)
26+
27+
Write-Verbose 'Retrieving tenant groups'
28+
$endpoint = '/api/ListTenantGroups'
29+
$params = @{}
30+
31+
if ($GroupID) {
32+
Write-Verbose "Filtering by group ID: $GroupID"
33+
$params['groupId'] = $GroupID
34+
}
35+
36+
Invoke-CIPPRestMethod -Endpoint $endpoint -Params $params
37+
}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<#
2+
.SYNOPSIS
3+
Searches for applications in a package repository.
4+
5+
.DESCRIPTION
6+
The Get-CIPPAppsRepository function searches for applications in a specified package repository (defaults to chocolatey.org).
7+
It returns detailed information about found packages including package name, author, version, and description.
8+
9+
.PARAMETER Search
10+
Specifies the search term to find packages. This parameter is mandatory.
11+
12+
.PARAMETER Repository
13+
Specifies the repository URL to search in. If not specified, defaults to 'https://chocolatey.org/api/v2'.
14+
15+
.EXAMPLE
16+
Get-CIPPAppsRepository -Search 'chrome'
17+
Returns a list of packages matching 'chrome' from the default Chocolatey repository.
18+
19+
.EXAMPLE
20+
Get-CIPPAppsRepository -Search 'firefox' -Repository 'https://custom.repository/api/v2'
21+
Returns a list of packages matching 'firefox' from the specified custom repository.
22+
23+
.NOTES
24+
Having this function doesn't really make sense, but hey it's here now.
25+
#>
26+
27+
function Get-CIPPAppsRepository {
28+
[CmdletBinding()]
29+
param (
30+
[Parameter(Mandatory = $true)]
31+
[string]$Search,
32+
33+
[Parameter(Mandatory = $false)]
34+
[string]$Repository = 'https://chocolatey.org/api/v2'
35+
)
36+
37+
$endpoint = '/api/ListAppsRepository'
38+
$body = @{
39+
Search = $Search
40+
Repository = $Repository
41+
}
42+
43+
Invoke-CIPPRestMethod -Endpoint $endpoint -Method POST -Body $body
44+
}

CIPPAPIModule/public/Endpoint/Reports/Get-CIPPDevices.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ function Get-CIPPDevices {
3131
)
3232

3333
Write-Verbose "Getting Devices for customer: $CustomerTenantID"
34-
$endpoint = '/api/listdevices'
34+
$endpoint = '/api/ListDevices'
3535
$params = @{
3636
tenantFilter = $CustomerTenantID
3737
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<#
2+
.SYNOPSIS
3+
Gets application approval templates from the CIPP API.
4+
5+
.DESCRIPTION
6+
The Get-CIPPAppApprovalTemplates function retrieves a list of application approval templates from the CIPP API.
7+
8+
.EXAMPLE
9+
Get-CIPPAppApprovalTemplates
10+
Returns all application approval templates.
11+
12+
#>
13+
function Get-CIPPAppApprovalTemplates {
14+
[CmdletBinding()]
15+
Param()
16+
17+
Write-Verbose 'Retrieving application approval templates'
18+
$endpoint = '/api/ListAppApprovalTemplates'
19+
20+
Invoke-CIPPRestMethod -Endpoint $endpoint -Method GET
21+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<#
2+
.SYNOPSIS
3+
Retrieves custom variables for a specified tenant from the CIPP system.
4+
5+
.DESCRIPTION
6+
The Get-CIPPCustomVariables function retrieves all custom variables associated with a specific
7+
tenant in CIPP
8+
9+
.PARAMETER CustomerTenantID
10+
The GUID of the tenant for which to retrieve custom variables. This parameter is mandatory.
11+
12+
.OUTPUTS
13+
Returns a collection of custom variables from the CIPP system for the specified tenant.
14+
15+
.EXAMPLE
16+
PS> Get-CIPPCustomVariables -CustomerTenantID "12345678-1234-1234-1234-1234567890ab"
17+
Retrieves all custom variables for the specified tenant.
18+
19+
.NOTES
20+
This function requires appropriate permissions to access the CIPP API.
21+
#>
22+
function Get-CIPPCustomVariables {
23+
[CmdletBinding()]
24+
Param(
25+
[Parameter(Mandatory = $true)]
26+
[guid]$CustomerTenantID
27+
)
28+
29+
Write-Verbose "Getting org $CustomerTenantID"
30+
$endpoint = '/api/ExecCippReplacemap'
31+
$params = @{
32+
tenantId = $CustomerTenantID
33+
Action = 'List'
34+
}
35+
Invoke-CIPPRestMethod -Endpoint $endpoint -Params $params
36+
}

CIPPAPIModule/public/Tenant/Administration/Tenant/Get-CIPPTenants.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ function Get-CIPPTenants {
3131
)
3232

3333
Write-Verbose 'Getting Tenants'
34-
$endpoint = '/api/listtenants'
34+
$endpoint = '/api/ListTenants'
3535
$params = @{
3636
tenantFilter = $CustomerTenantID
3737
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Get-CIPPAppApprovalTemplates
2+
## SYNOPSIS
3+
Gets application approval templates from the CIPP API.
4+
## DESCRIPTION
5+
The Get-CIPPAppApprovalTemplates function retrieves a list of application approval templates from the CIPP API.
6+
# PARAMETERS
7+
8+
#### EXAMPLE 1
9+
```powershell
10+
PS > Get-CIPPAppApprovalTemplates
11+
```
12+

Docs/Get-CIPPAppsRepository.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Get-CIPPAppsRepository
2+
## SYNOPSIS
3+
Searches for applications in a package repository.
4+
## DESCRIPTION
5+
The Get-CIPPAppsRepository function searches for applications in a specified package repository (defaults to chocolatey.org).
6+
It returns detailed information about found packages including package name, author, version, and description.
7+
# PARAMETERS
8+
9+
## **-Search**
10+
> ![Foo](https://img.shields.io/badge/Type-String-Blue?) ![Foo](https://img.shields.io/badge/Mandatory-TRUE-Red?) \
11+
Specifies the search term to find packages. This parameter is mandatory.
12+
13+
## **-Repository**
14+
> ![Foo](https://img.shields.io/badge/Type-String-Blue?) ![Foo](https://img.shields.io/badge/Mandatory-FALSE-Green?) ![Foo](https://img.shields.io/badge/DefaultValue-https://chocolatey.org/api/v2-Blue?color=5547a8)\
15+
Specifies the repository URL to search in. If not specified, defaults to 'https://chocolatey.org/api/v2'.
16+
17+
#### EXAMPLE 1
18+
```powershell
19+
PS > Get-CIPPAppsRepository -Search 'chrome'
20+
```
21+
#### EXAMPLE 2
22+
```powershell
23+
PS > Get-CIPPAppsRepository -Search 'firefox' -Repository 'https://custom.repository/api/v2'
24+
```
25+

Docs/Get-CIPPCustomVariables.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Get-CIPPCustomVariables
2+
## SYNOPSIS
3+
Retrieves custom variables for a specified tenant from the CIPP system.
4+
## DESCRIPTION
5+
The Get-CIPPCustomVariables function retrieves all custom variables associated with a specific
6+
tenant in CIPP
7+
# PARAMETERS
8+
9+
## **-CustomerTenantID**
10+
> ![Foo](https://img.shields.io/badge/Type-Guid-Blue?) ![Foo](https://img.shields.io/badge/Mandatory-TRUE-Red?) \
11+
The GUID of the tenant for which to retrieve custom variables. This parameter is mandatory.
12+
13+
#### EXAMPLE 1
14+
```powershell
15+
PS>Get-CIPPCustomVariables -CustomerTenantID "12345678-1234-1234-1234-1234567890ab"
16+
```
17+

0 commit comments

Comments
 (0)