Skip to content

Commit

Permalink
Bugfixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ykuijs committed Mar 26, 2024
1 parent 0c1759b commit aaacc4b
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 7 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

- Corrected typo in logging in Set-ADOEnvironment
- Improved logging in Set-ADOEnvironment
- Fixed issue in Convert-M365DSCExportToPowerShellDataFile where resources with "Profile" in the
name wasn't converted properly
- Fixed issue in Convert-M365DSCExportToPowerShellDataFile where multiple versions of
M365DSC.CompositeResources being installed caused errors

## [0.2.5] - 2024-03-19

- Added required version range for ObjectGraphTools
Expand Down
6 changes: 4 additions & 2 deletions source/Public/Convert-M365DSCExportToPowerShellDataFile.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ function Convert-M365DSCExportToPowerShellDataFile
$Obj_Export = Get-Content $Path_JsonReport | ConvertFrom-Json

# Load Example data from module M365DSC.CompositeResources
$Obj_M365DataExample = Import-PSDataFile (((Get-Module -ListAvailable M365DSC.CompositeResources).path | Split-Path) + '\M365ConfigurationDataExample.psd1')
$M365DSCCRModule = Get-Module -ListAvailable M365DSC.CompositeResources | Sort-Object -Property Version | Select-Object -Last 1
$Obj_M365DataExample = Import-PSDataFile (Join-Path -Path ($M365DSCCRModule.Path | Split-Path) -ChildPath 'M365ConfigurationDataExample.psd1')

# Group Object
$Obj_Export_Groups = $Obj_Export | Group-Object 'resourcename'
Expand All @@ -110,7 +111,8 @@ function Convert-M365DSCExportToPowerShellDataFile
-replace "^$($Workload | Convert-M365WorkLoadName )" `
-replace '(?<!y)$', '[s]*' `
-replace 'y$', '(y|ies)' `
-replace 'Policy', 'Policies'
-replace 'Policy', 'Policies' `
-replace 'Profile', 'Profiles'
) ) }
$Obj_Conversion.Composite_Resource_Name = $Composite_Resource.Name

Expand Down
12 changes: 7 additions & 5 deletions source/Public/Set-ADOEnvironment.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -312,31 +312,31 @@ function Set-ADOEnvironment

if ($settings.instructions -ne $default.Instructions)
{
Write-Log -Object ' Parameter Instructions changed, updating.'
Write-Log -Object " Parameter Instructions changed, updating. Old: $($settings.instructions), New: $($default.Instructions)"
$updateCheck = $true
}

if ($settings.requesterCannotBeApprover -ne $default.RequesterCannotBeApprover)
{
Write-Log -Object ' Parameter RequesterCannotBeApprover changed, updating.'
Write-Log -Object " Parameter RequesterCannotBeApprover changed, updating. Old: $($settings.requesterCannotBeApprover), New: $($default.RequesterCannotBeApprover)"
$updateCheck = $true
}

if ($settings.executionOrder -ne $default.ExecutionOrder)
{
Write-Log -Object ' Parameter ExecutionOrder changed, updating.'
Write-Log -Object " Parameter ExecutionOrder changed, updating. Old: $($settings.executionOrder), New: $($default.ExecutionOrder)"
$updateCheck = $true
}

if ($settings.minRequiredApprovers -ne $default.MinRequiredApprovers)
{
Write-Log -Object ' Parameter MinRequiredApprovers changed, updating.'
Write-Log -Object " Parameter MinRequiredApprovers changed, updating. Old: $($settings.minRequiredApprovers), New: $($default.MinRequiredApprovers)"
$updateCheck = $true
}

if ($checkInfo.timeout -ne $default.Timeout)
{
Write-Log -Object ' Parameter TimeOut changed, updating.'
Write-Log -Object " Parameter TimeOut changed, updating. Old: $($checkInfo.timeout), New: $($default.Timeout)"
$updateCheck = $true
}

Expand All @@ -345,11 +345,13 @@ function Set-ADOEnvironment
$approversDiff = Compare-Object -ReferenceObject $settings.approvers.id -DifferenceObject $approversDetails.$envName.Descriptor
if ($null -ne $approversDiff)
{
Write-Log -Object ' Approvers changed, updating.'
$updateCheck = $true
}
}
else
{
Write-Log -Object ' Approvers changed, updating.'
$updateCheck = $true
}

Expand Down

0 comments on commit aaacc4b

Please sign in to comment.