Skip to content

Commit

Permalink
Merge pull request #1764 from microsoft/Dev
Browse files Browse the repository at this point in the history
  • Loading branch information
NikCharlebois authored Feb 16, 2022
2 parents 08b6d69 + 7437553 commit c0ed3b6
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 31 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Change log for Microsoft365DSC

# 1.22.216.1

* DEPENDENCIES
* Updated ReverseDSC to version 2.0.0.10.
* Updated Microsoft.PowerApps.Administration.PowerShell to version 2.0.142.

# 1.22.209.1

* TeamsChannel
Expand Down
4 changes: 2 additions & 2 deletions Modules/Microsoft365DSC/Dependencies/Manifest.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
},
@{
ModuleName = "Microsoft.PowerApps.Administration.PowerShell"
RequiredVersion = "2.0.139"
RequiredVersion = "2.0.142"
},
@{
ModuleName = "MicrosoftTeams"
Expand All @@ -78,7 +78,7 @@
},
@{
ModuleName = "ReverseDSC"
RequiredVersion = "2.0.0.9"
RequiredVersion = "2.0.0.10"
}
)
}
17 changes: 5 additions & 12 deletions Modules/Microsoft365DSC/Microsoft365DSC.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
#
# Generated by: Microsoft Corporation
#
# Generated on: 2022-02-09
# Generated on: 2022-02-16

@{

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

# Version number of this module.
ModuleVersion = '1.22.209.1'
ModuleVersion = '1.22.216.1'

# Supported PSEditions
# CompatiblePSEditions = @()
Expand Down Expand Up @@ -131,16 +131,9 @@
IconUri = 'https://github.com/microsoft/Microsoft365DSC/blob/Dev/Modules/Microsoft365DSC/Dependencies/Images/Logo.png?raw=true'

# ReleaseNotes of this module
ReleaseNotes = "* TeamsChannel
* Fix to allow channels to be extracted properly when two Teams
have the same name.
FIXES #1746
* DEPENDENCIES
* Updated MicrosoftTeams to version 3.1.1;
* MISC
* Fixed an issue with the Export where the Configuration Data file
always referenced a certificate file even when none were configured.
FIXES #1724"
ReleaseNotes = "* DEPENDENCIES
* Updated ReverseDSC to version 2.0.0.10.
* Updated Microsoft.PowerApps.Administration.PowerShell to version 2.0.142."

# Flag to indicate whether the module requires explicit user acceptance for install/update
# RequireLicenseAcceptance = $false
Expand Down
47 changes: 31 additions & 16 deletions ResourceGenerator/M365DSCResourceGenerator.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,20 @@ function Get-ParameterBlockInformation
$parameterAttribute = "[Parameter()]"
}

$parameterType = Get-M365DSCDRGParameterType -Type $cmdletParameter.ParameterType.ToString()
if ($null -ne $cmdletParameter) {
$parameterType = Get-M365DSCDRGParameterType -Type $cmdletParameter.ParameterType.ToString()
}
else
{
$type = $property.Type
if ($type.Substring(0,3) -eq 'Edm') {
$type = $type.Replace('Edm','System')
}
$parameterType = Get-M365DSCDRGParameterType -Type $type
}

$parameterName = $_.Name
$parameterNameFirstLetter = $_.Name.Substring(0, 1)
$parameterName = $property.Name
$parameterNameFirstLetter = $property.Name.Substring(0, 1)
$parameterNameFirstLetter = $parameterNameFirstLetter.ToUpper()
$parameterNameCamelCaseString = $parameterName.Substring(1)
$parameterName = "$($parameterNameFirstLetter)$($parameterNameCamelCaseString)"
Expand All @@ -186,7 +196,7 @@ function Get-M365DSCDRGParameterType
$parameterType = ""
switch ($Type.ToLower())
{
"system.String"
"system.string"
{
$parameterType = "System.String"
}
Expand Down Expand Up @@ -351,7 +361,7 @@ function New-M365DSCResource
$outputTypeInformationChoices = @()
for ($i = 0; $i -lt $typeInformation.Count; $i++)
{
$outputTypeInformationChoices += [System.Management.Automation.Host.ChoiceDescription]("$($commandDetails[$i].Name) &$($i+1)")
$outputTypeInformationChoices += [System.Management.Automation.Host.ChoiceDescription]("$($commandDetails[$i].Name)")
}
$outputTypeChoice = $host.UI.PromptForChoice("Output Type Selection", "Please select an output type", $outputTypeInformationChoices, 0) + 1
$outputType = $outputTypes[$outputTypeChoice - 1].OutputType
Expand All @@ -375,7 +385,7 @@ function New-M365DSCResource
$typeInformationChoices = @()
for ($i = 0; $i -lt $typeInformation.Count; $i++)
{
$typeInformationChoices += [System.Management.Automation.Host.ChoiceDescription]("$($typeInformation[$i].Name) &$($i+1)")
$typeInformationChoices += [System.Management.Automation.Host.ChoiceDescription]("$($typeInformation[$i].Name)")
}
$typeChoice = $host.UI.PromptForChoice("Additional Type Information", "Please select an addtional type", $typeInformationChoices, 0) + 1

Expand Down Expand Up @@ -403,8 +413,8 @@ function New-M365DSCResource
-Workload $Workload

$parameterString = Get-ParameterBlockStringForModule -ParameterBlockInformation $parameterInformation
$hashtableResults = New-M365HashTableMapping -Properties $typeProperties `
-UseAddtionalProperties $isAdditionalProperty `
$hashtableResults = New-M365HashTableMapping -Properties $parameterInformation `
-DefaultParameterSetProperties $defaultParameterSetProperties `
-GraphNoun $GraphModuleCmdLetNoun `
-Workload $Workload
$hashTableMapping = $hashtableResults.StringContent
Expand Down Expand Up @@ -736,8 +746,8 @@ function New-M365HashTableMapping

# Parameter help description
[Parameter()]
[System.Boolean]
$UseAddtionalProperties
[System.Object]
$DefaultParameterSetProperties
)

$newCmdlet = Get-Command "New-$GraphNoun"
Expand All @@ -749,14 +759,14 @@ function New-M365HashTableMapping
$convertToVariable = ""
foreach ($property in $properties)
{
$cmdletParameter = $DefaultParameterSetProperties | Where-Object -FilterScript { $_.Name -eq $property.Name }
if ($null -eq $cmdletParameter) {
$UseAddtionalProperties = $true
}
if ($property.Name -ne 'CreatedDateTime' -and $property.Name -ne 'LastModifiedDateTime')
{
$paramType = $newCmdlet.Parameters.$($property.Name).ParameterType.ToString()
$paramType = $property.Type
$parameterName = $property.Name
$parameterNameFirstLetter = $property.Name.Substring(0, 1)
$parameterNameFirstLetter = $parameterNameFirstLetter.ToUpper()
$parameterNameCamelCaseString = $parameterName.Substring(1)
$parameterName = "$($parameterNameFirstLetter)$($parameterNameCamelCaseString)"

if ($paramType.StartsWith("Microsoft.Graph.PowerShell.Models."))
{
Expand Down Expand Up @@ -791,7 +801,12 @@ function New-M365HashTableMapping
{
if ($UseAddtionalProperties)
{
$hashtable += " $($parameterName) = `$getValue.AdditionalProperties.$($_propertyName) `r`n"
$propertyName = $property.Name
$propertyNameFirstLetter = $property.Name.Substring(0, 1)
$propertyNameFirstLetter = $propertyNameFirstLetter.ToLower()
$propertyNameCamelCaseString = $propertyName.Substring(1)
$propertyName = "$($propertyNameFirstLetter)$($propertyNameCamelCaseString)"
$hashtable += " $($parameterName) = `$getValue.AdditionalProperties.$($propertyName) `r`n"
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/home/what-is-M365DSC.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Microsoft365DSC is an Open-Source initiative lead by Microsoft engineers and maintained by the community. It allows you to write a definition for how your Microsoft 365 tenant should be configured, automate the deployment of that configuration and ensures the monitoring of the defined configuration, notifying and acting on detected configuration drifts. It also allows you to extract a full-fidelity configuration out of any existing Microsoft 365 tenant. The tool covers all major Microsoft 365 workloads such as Exchange Online, Teams, SharePoint, OneDrive, Security and Compliance, Power Platforms, Intune and Planner.

Microsoft365DSC is build as a module for the [PowerShell Desired State Configuration](https://docs.microsoft.com/en-us/powershell/scripting/dsc/overview/overview) framework and is made available via the [PowerShell Gallery](https://www.powershellgallery.com/packages/Microsoft365DSC/).
Microsoft365DSC is build as a module for the [PowerShell Desired State Configuration](https://docs.microsoft.com/en-us/powershell/scripting/dsc/overview) framework and is made available via the [PowerShell Gallery](https://www.powershellgallery.com/packages/Microsoft365DSC/).

![Infographic](../Images/M365DSC-InfoGraphic.png){ align=center width=500 }

Expand Down

0 comments on commit c0ed3b6

Please sign in to comment.