Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Asser-M365DSCBlueprint: add additional Auth Meth to Asser-M365DSCBlueprint #1792

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 53 additions & 2 deletions Modules/Microsoft365DSC/Modules/M365DSCUtil.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -1153,6 +1153,10 @@ Internal
function Get-M365DSCTenantDomain
{
param(
[Parameter()]
[System.Management.Automation.PSCredential]
$Credential,

Comment on lines +1156 to +1159
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as mentioned in #1792 (comment) this function should not handle any Credentials.

[Parameter(Mandatory = $true)]
[System.String]
$ApplicationId,
Expand Down Expand Up @@ -2115,6 +2119,24 @@ Specifies the path of the report that will be created.
.Parameter Credentials
Specifies the credentials that will be used for authentication.

.Parameter ApplicationId
Specifies the application id to be used for authentication.

.Parameter ApplicationSecret
Specifies the application secret of the application to be used for authentication.

.Parameter TenantId
Specifies the id of the tenant.

.Parameter CertificateThumbprint
Specifies the thumbprint to be used for authentication.

.Parameter CertificatePassword
Specifies the password of the PFX file which is used for authentication.

.Parameter CertificatePath
Specifies the path of the PFX file which is used for authentication.

.Parameter HeaderFilePath
Specifies that file that contains a custom header for the report.

Expand All @@ -2124,6 +2146,9 @@ Assert-M365DSCBlueprint -BluePrintUrl 'C:\DS\blueprint.m365' -OutputReportPath '
.Example
Assert-M365DSCBlueprint -BluePrintUrl 'C:\DS\blueprint.m365' -OutputReportPath 'C:\DSC\BlueprintReport.html' -Credentials $credentials -HeaderFilePath 'C:\DSC\ReportCustomHeader.html'

.Example
Assert-M365DSCBlueprint -BluePrintUrl 'C:\DS\blueprint.m365' -OutputReportPath 'C:\DSC\BlueprintReport.html' -ApplicationId $clientid -TenantId $tenantId -CertificateThumbprint $certthumbprint -HeaderFilePath 'C:\DSC\ReportCustomHeader.html'

.Functionality
Public
#>
Expand All @@ -2139,10 +2164,30 @@ function Assert-M365DSCBlueprint
[System.String]
$OutputReportPath,

[Parameter(Mandatory = $true)]
[Parameter()]
[System.Management.Automation.PSCredential]
$Credentials,

[Parameter()]
[System.String]
$ApplicationId,

[Parameter()]
[System.String]
$TenantId,

[Parameter()]
[System.String]
$CertificatePath,

[Parameter()]
[System.Management.Automation.PSCredential]
$CertificatePassword,

[Parameter()]
[System.String]
$CertificateThumbprint,

[Parameter()]
[System.String]
$HeaderFilePath
Expand Down Expand Up @@ -2208,7 +2253,13 @@ function Assert-M365DSCBlueprint
Export-M365DSCConfiguration -Components $ResourcesInBluePrint `
-Path $env:temp `
-FileName $TempExportName `
-Credential $Credentials
-Credential $Credentials `
-ApplicationId $ApplicationId `
-ApplicationSecret $ApplicationSecret `
-TenantId $TenantId `
-CertificateThumbprint $CertificateThumbprint `
-CertificatePath $CertificatePath `
-CertificatePassword $CertificatePassword

# Call the New-M365DSCDeltaReport configuration to generate the Delta Report between
# the BluePrint and the extracted resources;
Expand Down