Skip to content

Commit

Permalink
Merge pull request #31 from BNWEIN/Dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
BNWEIN authored Jan 19, 2025
2 parents dced4ca + 111f788 commit 95dbf36
Show file tree
Hide file tree
Showing 6 changed files with 348 additions and 159 deletions.
243 changes: 122 additions & 121 deletions CIPPAPIModule/CIPPAPIModule.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -8,124 +8,125 @@

@{

# Script module or binary module file associated with this manifest.
RootModule = 'CIPPAPIModule.psm1'

# Version number of this module.
ModuleVersion = '1.1.9'

# Supported PSEditions
# CompatiblePSEditions = @()

# ID used to uniquely identify this module
GUID = '7a30dce3-8696-410b-84cc-4f3ca97b4202'

# Author of this module
Author = 'Ben Weinberg - Bweinberg@prime-networks.co.uk'

# Company or vendor of this module
CompanyName = 'Prime Networks'

# Copyright statement for this module
Copyright = '(c) Ben Weinberg. All rights reserved.'

# Description of the functionality provided by this module
Description = 'Powershell Module for CIPP-API'

# Minimum version of the PowerShell engine required by this module
PowerShellVersion = '7.0'

# Name of the PowerShell host required by this module
# PowerShellHostName = ''

# Minimum version of the PowerShell host required by this module
# PowerShellHostVersion = ''

# Minimum version of Microsoft .NET Framework required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
# DotNetFrameworkVersion = ''

# Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
# ClrVersion = ''

# Processor architecture (None, X86, Amd64) required by this module
# ProcessorArchitecture = ''

# Modules that must be imported into the global environment prior to importing this module
# RequiredModules = @()

# Assemblies that must be loaded prior to importing this module
# RequiredAssemblies = @()

# Script files (.ps1) that are run in the caller's environment prior to importing this module.
# ScriptsToProcess = @()

# Type files (.ps1xml) to be loaded when importing this module
# TypesToProcess = @()

# Format files (.ps1xml) to be loaded when importing this module
# FormatsToProcess = @()

# Modules to import as nested modules of the module specified in RootModule/ModuleToProcess
# NestedModules = @()

# Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export.
FunctionsToExport = @()

# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export.
CmdletsToExport = @()

# Variables to export from this module
VariablesToExport = '*'

# Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export.
AliasesToExport = @()

# DSC resources to export from this module
# DscResourcesToExport = @()

# List of all modules packaged with this module
# ModuleList = @()

# List of all files packaged with this module
# FileList = @()

# Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell.
PrivateData = @{

PSData = @{

# Tags applied to this module. These help with module discovery in online galleries.
# Tags = @()

# A URL to the license for this module.
# LicenseUri = ''

# A URL to the main website for this project.
ProjectUri = 'https://github.com/BNWEIN/CIPPAPIModule/'

# A URL to an icon representing this module.
# IconUri = ''

# ReleaseNotes of this module
# ReleaseNotes = ''

# Prerelease string of this module
# Prerelease = ''

# Flag to indicate whether the module requires explicit user acceptance for install/update/save
# RequireLicenseAcceptance = $false

# External dependent modules of this module
# ExternalModuleDependencies = @()

} # End of PSData hashtable

} # End of PrivateData hashtable

# HelpInfo URI of this module
# HelpInfoURI = ''

# Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix.
# DefaultCommandPrefix = ''

}
# Script module or binary module file associated with this manifest.
RootModule = 'CIPPAPIModule.psm1'

# Version number of this module.
ModuleVersion = '1.2.0'

# Supported PSEditions
# CompatiblePSEditions = @()

# ID used to uniquely identify this module
GUID = '7a30dce3-8696-410b-84cc-4f3ca97b4202'

# Author of this module
Author = 'Ben Weinberg - Bweinberg@prime-networks.co.uk'

# Company or vendor of this module
CompanyName = 'Prime Networks'

# Copyright statement for this module
Copyright = '(c) Ben Weinberg. All rights reserved.'

# Description of the functionality provided by this module
Description = 'Powershell Module for CIPP-API'

# Minimum version of the PowerShell engine required by this module
PowerShellVersion = '7.0'

# Name of the PowerShell host required by this module
# PowerShellHostName = ''

# Minimum version of the PowerShell host required by this module
# PowerShellHostVersion = ''

# Minimum version of Microsoft .NET Framework required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
# DotNetFrameworkVersion = ''

# Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
# ClrVersion = ''

# Processor architecture (None, X86, Amd64) required by this module
# ProcessorArchitecture = ''

# Modules that must be imported into the global environment prior to importing this module
# RequiredModules = @()

# Assemblies that must be loaded prior to importing this module
# RequiredAssemblies = @()

# Script files (.ps1) that are run in the caller's environment prior to importing this module.
# ScriptsToProcess = @()

# Type files (.ps1xml) to be loaded when importing this module
# TypesToProcess = @()

# Format files (.ps1xml) to be loaded when importing this module
# FormatsToProcess = @()

# Modules to import as nested modules of the module specified in RootModule/ModuleToProcess
# NestedModules = @()

# Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export.
FunctionsToExport = @()

# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export.
CmdletsToExport = @()

# Variables to export from this module
VariablesToExport = '*'

# Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export.
AliasesToExport = @()

# DSC resources to export from this module
# DscResourcesToExport = @()

# List of all modules packaged with this module
# ModuleList = @()

# List of all files packaged with this module
# FileList = @()

# Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell.
PrivateData = @{

PSData = @{

# Tags applied to this module. These help with module discovery in online galleries.
# Tags = @()

# A URL to the license for this module.
# LicenseUri = ''

# A URL to the main website for this project.
ProjectUri = 'https://github.com/BNWEIN/CIPPAPIModule/'

# A URL to an icon representing this module.
# IconUri = ''

# ReleaseNotes of this module
# ReleaseNotes = ''

# Prerelease string of this module
# Prerelease = ''

# Flag to indicate whether the module requires explicit user acceptance for install/update/save
# RequireLicenseAcceptance = $false

# External dependent modules of this module
# ExternalModuleDependencies = @()

} # End of PSData hashtable

} # End of PrivateData hashtable

# HelpInfo URI of this module
# HelpInfoURI = ''

# Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix.
# DefaultCommandPrefix = ''

}

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Creates a GDAP (Granular Delegated Admin Privileges) invite.
.DESCRIPTION
The Get-CIPPGDAPInvite function sends a request to create a GDAP invite using the specified GDAP roles.
The New-CIPPGDAPInvite function sends a request to create a GDAP invite using the specified GDAP roles.
You can either provide a custom set of roles using the `-GDAPRoles` parameter or include all existing roles by using the `-UseAllExistingRoles` switch.
.PARAMETER GDAPRoles
Expand All @@ -17,12 +17,12 @@ An array of GDAP roles to be included in the invite. Each role is represented as
A switch parameter that, when specified, includes all existing roles in the GDAP invite. This is mutually exclusive with `-GDAPRoles`.
.EXAMPLE
PS C:\> Get-CIPPGDAPInvite -GDAPRoles @(@{GroupName="M365 GDAP Cloud Device Administrator";GroupId="fa03defa-27c4-4639-8e50-14cbb746a78d";RoleName="Cloud Device Administrator";roleDefinitionId="7698a772-787b-4ac8-901f-60d6b08affd2"},@{GroupName="M365 GDAP Intune Administrator";GroupId="3d1c917f-8d1e-4a1e-a61c-df3263a0d1bc";RoleName="Intune Administrator";roleDefinitionId="3a2c62db-5318-420d-8d74-23affee5d9d5"})
PS C:\> New-CIPPGDAPInvite -GDAPRoles @(@{GroupName="M365 GDAP Cloud Device Administrator";GroupId="fa03defa-27c4-4639-8e50-14cbb746a78d";RoleName="Cloud Device Administrator";roleDefinitionId="7698a772-787b-4ac8-901f-60d6b08affd2"},@{GroupName="M365 GDAP Intune Administrator";GroupId="3d1c917f-8d1e-4a1e-a61c-df3263a0d1bc";RoleName="Intune Administrator";roleDefinitionId="3a2c62db-5318-420d-8d74-23affee5d9d5"})
This example creates a GDAP invite with the roles "Cloud Device Administrator" and "Intune Administrator."
.EXAMPLE
PS C:\> Get-CIPPGDAPInvite -UseAllExistingRoles
PS C:\> New-CIPPGDAPInvite -UseAllExistingRoles
This example creates a GDAP invite including all existing roles retrieved by the `Get-CIPPGDAPRoles` function.
Expand All @@ -32,7 +32,7 @@ This example creates a GDAP invite including all existing roles retrieved by the
- Ensure the GDAP roles are valid and correctly formatted before calling this function.
#>

function Get-CIPPGDAPInvite {
function New-CIPPGDAPInvite {
[CmdletBinding()]
Param(
[Parameter(Mandatory = $false)]
Expand All @@ -59,8 +59,8 @@ function Get-CIPPGDAPInvite {
$endpoint = '/api/ExecGDAPInvite'

$Body = @{
gdapRoles = $GDAPRoles
roleMappings = $GDAPRoles
}

Invoke-CIPPRestMethod -Endpoint $endpoint -Body $Body
Invoke-CIPPRestMethod -Endpoint $endpoint -Body $Body -Method Post
}
2 changes: 1 addition & 1 deletion CIPPAPIModule/public/Tenant/Tools/Get-CIPPGraphRequest.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ function Get-CIPPGraphRequest {
}

$optionalParams = @{
'$count' = $count
'$count' = if ($count -eq $true) { 'true' } else { $null }
'$select' = $Select
'NoPagination' = if ($DisablePagination) { 'true' } else { 'false' }
'$top' = $Top
Expand Down
Loading

0 comments on commit 95dbf36

Please sign in to comment.