Skip to content

Commit

Permalink
Fews bugs and some improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
ykuijs committed Jan 2, 2024
1 parent 451b413 commit 4eeefbd
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 62 deletions.
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,28 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added

- Added parameter description to the example datafile generation.

### Changed

- Updated the NonNodeData\AppCredentials and Environment values to type definitions, in order to allow validation code to work consistently.

### Fixed

- Fixed RuleEvaluation filter bug that added incorrect data to the example datafile.

## [0.1.11] - 2023-11-29

### Changed

- Removed DscBuildHelpers module from ExternalModuleDependencies parameter in the module manifest

## [0.1.10] - 2023-11-28

### Changed

- Changed AAD resource name to AzureAD

## [0.1.9] - 2023-11-27
Expand Down
8 changes: 4 additions & 4 deletions source/Private/Get-AttributeString.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,11 @@ function Get-AttributeString

if ($null -eq $embeddedProperty.ValueMap)
{
$ConfigData.$($property.Name)[0].$($embeddedProperty.Name) = ('{0} | {1}' -f $embeddedProperty.DataType, $state)
$ConfigData.$($property.Name)[0].$($embeddedProperty.Name) = ('{0} | {1} | {2}' -f $embeddedProperty.DataType, $state, $embeddedProperty.Description)
}
else
{
$ConfigData.$($property.Name)[0].$($embeddedProperty.Name) = ('{0} | {1} | {2}' -f $embeddedProperty.DataType, $state, ($embeddedProperty.ValueMap -join ' / '))
$ConfigData.$($property.Name)[0].$($embeddedProperty.Name) = ('{0} | {1} | {2} | {3}' -f $embeddedProperty.DataType, $state, $embeddedProperty.Description, ($embeddedProperty.ValueMap -join ' / '))
}
}
else
Expand All @@ -98,11 +98,11 @@ function Get-AttributeString

if ($null -eq $embeddedProperty.ValueMap)
{
$ConfigData.$($property.Name).$($embeddedProperty.Name) = ('{0} | {1}' -f $embeddedProperty.DataType, $state)
$ConfigData.$($property.Name).$($embeddedProperty.Name) = ('{0} | {1} | {2}' -f $embeddedProperty.DataType, $state, $embeddedProperty.Description)
}
else
{
$ConfigData.$($property.Name).$($embeddedProperty.Name) = ('{0} | {1} | {2}' -f $embeddedProperty.DataType, $state, ($embeddedProperty.ValueMap -join ' / '))
$ConfigData.$($property.Name).$($embeddedProperty.Name) = ('{0} | {1} | {2} | {3}' -f $embeddedProperty.DataType, $state, $embeddedProperty.Description, ($embeddedProperty.ValueMap -join ' / '))
}
}
else
Expand Down
72 changes: 14 additions & 58 deletions source/Public/New-CompositeResourceModule.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -53,67 +53,22 @@ function New-CompositeResourceModule
$configData = [Ordered]@{
AllNodes = @(
@{
NodeName = 'localhost'
CertificateFile = '.\DSCCertificate.cer'
NodeName = 'String | Required | Name of the host of which the LCM is used, normally this is localhost'
CertificateFile = 'String | Required | Relative path to the public key of the DSC credential encryption certificate, e.g. .\DSCCertificate.cer'
}
)
NonNodeData = [Ordered]@{
Environment = @{
Name = '[Name of your environment, e.g. Test]'
ShortName = '[Abbreviation of the environment name, e.g. TST]'
TenantId = '[Tenant URL, e.g. test.onmicrosoft.com]'
OrganizationName = '[Name of your organization, e.g. Test]'
Name = 'String | Required | Name of your environment, e.g. TestEnvironment'
ShortName = 'String | Required | Abbreviation of the environment name, e.g. TST'
TenantId = 'String | Required | Tenant URL, e.g. test.onmicrosoft.com'
OrganizationName = 'String | Required | Name of your organization, prefix of the tenant id, e.g. test'
}
AppCredentials = @(
@{
Workload = 'AzureAD'
ApplicationId = '878459e4-79e4-4f9a-83d6-738c32ddd5c2'
CertThumbprint = '65E427769F27CDA198231B2A7FF03940897FB687'
}
@{
Workload = 'Exchange'
ApplicationId = '878459e4-79e4-4f9a-83d6-738c32ddd5c2'
CertThumbprint = '65E427769F27CDA198231B2A7FF03940897FB687'
}
@{
Workload = 'Intune'
ApplicationId = '878459e4-79e4-4f9a-83d6-738c32ddd5c2'
CertThumbprint = '65E427769F27CDA198231B2A7FF03940897FB687'
}
@{
Workload = 'Office365'
ApplicationId = '878459e4-79e4-4f9a-83d6-738c32ddd5c2'
CertThumbprint = '65E427769F27CDA198231B2A7FF03940897FB687'
}
@{
Workload = 'OneDrive'
ApplicationId = '878459e4-79e4-4f9a-83d6-738c32ddd5c2'
CertThumbprint = '65E427769F27CDA198231B2A7FF03940897FB687'
}
@{
Workload = 'Planner'
ApplicationId = '878459e4-79e4-4f9a-83d6-738c32ddd5c2'
CertThumbprint = '65E427769F27CDA198231B2A7FF03940897FB687'
}
@{
Workload = 'PowerPlatform'
ApplicationId = '878459e4-79e4-4f9a-83d6-738c32ddd5c2'
CertThumbprint = '65E427769F27CDA198231B2A7FF03940897FB687'
}
@{
Workload = 'SecurityCompliance'
ApplicationId = '878459e4-79e4-4f9a-83d6-738c32ddd5c2'
CertThumbprint = '65E427769F27CDA198231B2A7FF03940897FB687'
}
@{
Workload = 'SharePoint'
ApplicationId = '878459e4-79e4-4f9a-83d6-738c32ddd5c2'
CertThumbprint = '65E427769F27CDA198231B2A7FF03940897FB687'
}
@{
Workload = 'Teams'
ApplicationId = '878459e4-79e4-4f9a-83d6-738c32ddd5c2'
CertThumbprint = '65E427769F27CDA198231B2A7FF03940897FB687'
Workload = 'String | Required | Name of the Workload for which this credential will be used | AzureAD / Exchange / Intune / Office365 / OneDrive / Planner / PowerPlatform / SecurityCompliance / SharePoint / Teams'
ApplicationId = 'Guid | Required | The GUID of the Entra ID Service Principal'
CertThumbprint = 'String | Required | The Certificate Thumbprint of the certificate used for authentication'
}
)
}
Expand Down Expand Up @@ -157,7 +112,7 @@ function New-CompositeResourceModule
$lastWorkload = ''

# Loop through all the Schema files found in the modules folder
foreach ($mofSchemaFile in $mofSchemaFiles)
:schemaloop foreach ($mofSchemaFile in $mofSchemaFiles)
{
# Read schema
$mofSchemas = Get-MofSchemaObject -FileName $mofSchemaFile.FullName
Expand Down Expand Up @@ -228,6 +183,7 @@ function New-CompositeResourceModule
{ $_.StartsWith('M365DSC') }
{
Write-Host ' Skipping M365DSC workload (RuleEvaluation)' -ForegroundColor 'Yellow'
continue schemaloop
}
Default
{
Expand Down Expand Up @@ -459,7 +415,7 @@ function New-CompositeResourceModule

if ($filteredProperties.Name -notcontains "Id" -and $filteredProperties.Name -notcontains "Identity")
{
$currentDataObject.UniqueId = ('{0} | {1} | {2}' -f "String", "Required", "[Unique ID to identify this specific object]")
$currentDataObject.UniqueId = ('{0} | {1} | {2}' -f "String", "Required", "Unique ID to identify this specific object")
}

# Loop through all the filtered properties and build example config data file
Expand Down Expand Up @@ -491,11 +447,11 @@ function New-CompositeResourceModule

if ($null -eq $property.ValueMap)
{
$currentDataObject.$($property.Name) = ('{0} | {1}' -f $propertyDataType, $state)
$currentDataObject.$($property.Name) = ('{0} | {1} | {2}' -f $propertyDataType, $state, $property.Description)
}
else
{
$currentDataObject.$($property.Name) = ('{0} | {1} | {2}' -f $propertyDataType, $state, ($property.ValueMap -join ' / '))
$currentDataObject.$($property.Name) = ('{0} | {1} | {2} | {3}' -f $propertyDataType, $state, $property.Description, ($property.ValueMap -join ' / '))
}
}
}
Expand Down

0 comments on commit 4eeefbd

Please sign in to comment.