Skip to content

Add method to add certificate to existing app registration for Email-App. #4

@DrIOSX

Description

@DrIOSX

New Params

[CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = 'High', DefaultParameterSetName = 'CreateNewApp')]
    param(
        # REGION: New App param set
        [Parameter(
            ParameterSetName = 'CreateNewApp',
            Mandatory        = $true,
            HelpMessage      = 'The prefix used to initialize the Graph Email App. 2-4 characters letters and numbers only.'
        )]
        [ValidatePattern('^[A-Z0-9]{2,4}$')]
        [string]
        $AppPrefix,

        [Parameter(
            ParameterSetName = 'CreateNewApp',
            Mandatory        = $true,
            HelpMessage      = 'The username of the authorized sender.'
        )]
        [ValidatePattern('^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$')]
        [string]
        $AuthorizedSenderUserName,

        [Parameter(
            ParameterSetName = 'CreateNewApp',
            Mandatory        = $true,
            HelpMessage      = 'The Mail Enabled Sending Group.'
        )]
        [ValidatePattern('^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$')]
        [string]
        $MailEnabledSendingGroup,

        # REGION: Existing App param set
        [Parameter(
            ParameterSetName = 'UseExistingApp',
            Mandatory        = $true,
            HelpMessage      = 'The AppId of the existing App Registration to which you want to attach a certificate.'
        )]
        [ValidatePattern('^[0-9a-fA-F-]{36}$')]  # or just a string
        [string]
        $ExistingAppId,

        # REGION: Shared parameters
        [Parameter(
            Mandatory   = $false,
            HelpMessage = 'The thumbprint of the certificate to be retrieved or created.'
        )]
        [ValidatePattern('^[A-Fa-f0-9]{40}$')]
        [string]
        $CertThumbprint,

        [Parameter(
            Mandatory   = $false,
            HelpMessage = 'Key export policy for the certificate.'
        )]
        [ValidateSet('Exportable', 'NonExportable')]
        [string]
        $KeyExportPolicy = 'NonExportable',

        [Parameter(
            Mandatory   = $false,
            HelpMessage = 'If specified, use a custom vault name. Otherwise, use the default.'
        )]
        [string]
        $VaultName = 'GraphEmailAppLocalStore',

        [Parameter(
            Mandatory   = $false,
            HelpMessage = 'If specified, overwrite the vault secret if it already exists.'
        )]
        [switch]
        $OverwriteVaultSecret,

        [Parameter(
            Mandatory   = $false,
            HelpMessage = 'Return the parameter splat for use in other functions.'
        )]
        [switch]
        $ReturnParamSplat
    )

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions