Skip to content

Commit

Permalink
Merge branch 'Dev' into fix4223
Browse files Browse the repository at this point in the history
  • Loading branch information
NikCharlebois authored Jan 24, 2024
2 parents 0e997ca + 2c3ab90 commit a7e092c
Show file tree
Hide file tree
Showing 23 changed files with 365 additions and 148 deletions.
21 changes: 20 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* Remove the logic path to create a new instance in favor of the update flow.
* AADConditionalAccessPolicy
* Fix issue when not all parameters are specified
FIXES [[#4202](https://github.com/microsoft/Microsoft365DSC/issues/4202)]
FIXES [[#4202](https://github.com/microsoft/Microsoft365DSC/issues/4202)]
* AADCrossTenantAccessPolicy
* Removed the ability to specify a value of Absent for the Ensure property.
* AADCrossTenantAccessPolicyCOnfigurationDefault
Expand All @@ -33,12 +33,31 @@
QueryString and Characteristic parameters.
* EXOAddressList
* Fixed an issue trying to create a new instance when DisplayName is empty.
* SCAutoSensitivityLabelRule
* Correct export indentation, which caused an issue with report conversion to JSON.
FIXES [[#4240](https://github.com/microsoft/Microsoft365DSC/issues/4240)]
* SPOSharingSettings
* Fixed an Issue where the MySiteSharingCapability could be returned as an
empty string instead of a null value from the Get method.
* TeamsAppPermissionPolicy, TeamsAppSetupPolicy, TeamsCallHoldPolicy,
TeamsIPPhonePolicy, TeamsMobilityPolicy, TeamsNetworkRoamingPolicy,
TeamsShiftsPolicy, TeamsTenantNetworkRegion, TeamsTenantNetworkSite,
TeamsTenantNetworkSubnet, TeamsTenantTrustedIPAddress, TeamsTranslationRule,
TeamsUnassignedNumberTreatment, TeamsVdiPolicy, TeamsWorkloadPolicy
* Fix condition when resource is absent
FIXES [#4227](https://github.com/microsoft/Microsoft365DSC/issues/4227)
* TeamsEventsPolicy
* Add missing attributes
FIXES [#4242](https://github.com/microsoft/Microsoft365DSC/issues/4242)
* TeamsFeedbackPolicy
* Fix condition when resource is absent
FIXES [#4223](https://github.com/microsoft/Microsoft365DSC/issues/4223)
* TeamsFilesPolicy
* Fix condition when resource is absent
FIXES [#4225](https://github.com/microsoft/Microsoft365DSC/issues/4225)
* TeamsMeetingBroadcastPolicy
* Fix deletion of resource
FIXES [#4231](https://github.com/microsoft/Microsoft365DSC/issues/4231)
* DEPENDENCIES
* Updated Microsoft.Graph dependencies to version 2.12.0.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1275,81 +1275,84 @@ function ConvertTo-SCDLPSensitiveInformationStringGroup

foreach ($SensitiveInformationHash in $InformationArray)
{
$StringContent = "MSFT_SCDLPContainsSensitiveInformation`r`n {`r`n"
$StringContent = "MSFT_SCDLPContainsSensitiveInformation {`r`n"
if ($null -ne $InformationArray.Groups)
{
$StringContent += " operator = '$($SensitiveInformationHash.operator.Replace("'", "''"))'`r`n"
$StringContent += " Groups = `r`n@("
$StringContent += " operator = '$($SensitiveInformationHash.operator.Replace("'", "''"))'`r`n"
$StringContent += " Groups = @(`r`n"
}
foreach ($group in $SensitiveInformationHash.Groups)
{
$StringContent += "MSFT_SCDLPContainsSensitiveInformationGroup`r`n {`r`n"
$StringContent += " operator = '$($group.operator.Replace("'", "''"))'`r`n"
$StringContent += " name = '$($group.name.Replace("'", "''"))'`r`n"
$StringContent += " MSFT_SCDLPContainsSensitiveInformationGroup {`r`n"
$StringContent += " operator = '$($group.operator.Replace("'", "''"))'`r`n"
$StringContent += " name = '$($group.name.Replace("'", "''"))'`r`n"
if ($null -ne $group.sensitivetypes)
{
$StringContent += ' SensitiveInformation = @('
$StringContent += " SensitiveInformation = @(`r`n"
foreach ($sit in $group.sensitivetypes)
{
$StringContent += " MSFT_SCDLPSensitiveInformation`r`n {`r`n"
$StringContent += " name = '$($sit.name.Replace("'", "''"))'`r`n"
$StringContent += " MSFT_SCDLPSensitiveInformation {`r`n"
$StringContent += " name = '$($sit.name.Replace("'", "''"))'`r`n"
if ($null -ne $sit.id)
{
$StringContent += " id = '$($sit.id)'`r`n"
$StringContent += " id = '$($sit.id)'`r`n"
}

if ($null -ne $sit.maxconfidence)
{
$StringContent += " maxconfidence = '$($sit.maxconfidence)'`r`n"
$StringContent += " maxconfidence = '$($sit.maxconfidence)'`r`n"
}

if ($null -ne $sit.minconfidence)
{
$StringContent += " minconfidence = '$($sit.minconfidence)'`r`n"
$StringContent += " minconfidence = '$($sit.minconfidence)'`r`n"
}

if ($null -ne $sit.classifiertype)
{
$StringContent += " classifiertype = '$($sit.classifiertype)'`r`n"
$StringContent += " classifiertype = '$($sit.classifiertype)'`r`n"
}

if ($null -ne $sit.mincount)
{
$StringContent += " mincount = '$($sit.mincount)'`r`n"
$StringContent += " mincount = '$($sit.mincount)'`r`n"
}

if ($null -ne $sit.maxcount)
{
$StringContent += " maxcount = '$($sit.maxcount)'`r`n"
$StringContent += " maxcount = '$($sit.maxcount)'`r`n"
}

$StringContent += " }`r`n"
$StringContent += " }`r`n"
}
$StringContent += " )}`r`n"
$StringContent += " )`r`n"
$StringContent += " }`r`n"
}
if ($null -ne $group.labels)
{
$StringContent += ' labels = @('
$StringContent += " labels = @(`r`n"
foreach ($label in $group.labels)
{
$StringContent += " MSFT_SCDLPLabel`r`n {`r`n"
$StringContent += " name = '$($label.name.Replace("'", "''"))'`r`n"
$StringContent += " MSFT_SCDLPLabel {`r`n"
$StringContent += " name = '$($label.name.Replace("'", "''"))'`r`n"
if ($null -ne $label.id)
{
$StringContent += " id = '$($label.id)'`r`n"
$StringContent += " id = '$($label.id)'`r`n"
}

if ($null -ne $label.type)
{
$StringContent += " type = '$($label.type)'`r`n"
$StringContent += " type = '$($label.type)'`r`n"
}

$StringContent += " }`r`n"
$StringContent += " }`r`n"
}
$StringContent += " )}`r`n"
$StringContent += " )`r`n"
$StringContent += " }`r`n"
}
}
$StringContent += " )}`r`n"
$StringContent += " )`r`n"
$StringContent += " }`r`n"
$result += $StringContent
}
return $result
Expand All @@ -1365,50 +1368,50 @@ function ConvertTo-SCDLPSensitiveInformationString
$InformationArray
)
$result = ''
$StringContent = "MSFT_SCDLPContainsSensitiveInformation`r`n {`r`n"
$StringContent = "MSFT_SCDLPContainsSensitiveInformation {`r`n"
$StringContent += ' SensitiveInformation = '
$StringContent += "@(`r`n"
$result += $StringContent
foreach ($SensitiveInformationHash in $InformationArray)
{

$StringContent = "MSFT_SCDLPSensitiveInformation`r`n {`r`n"
$StringContent += " name = '$($SensitiveInformationHash.name.Replace("'", "''"))'`r`n"
$StringContent = " MSFT_SCDLPSensitiveInformation`r`n {`r`n"
$StringContent += " name = '$($SensitiveInformationHash.name.Replace("'", "''"))'`r`n"

if ($null -ne $SensitiveInformationHash.id)
{
$StringContent += " id = '$($SensitiveInformationHash.id)'`r`n"
$StringContent += " id = '$($SensitiveInformationHash.id)'`r`n"
}

if ($null -ne $SensitiveInformationHash.maxconfidence)
{
$StringContent += " maxconfidence = '$($SensitiveInformationHash.maxconfidence)'`r`n"
$StringContent += " maxconfidence = '$($SensitiveInformationHash.maxconfidence)'`r`n"
}

if ($null -ne $SensitiveInformationHash.minconfidence)
{
$StringContent += " minconfidence = '$($SensitiveInformationHash.minconfidence)'`r`n"
$StringContent += " minconfidence = '$($SensitiveInformationHash.minconfidence)'`r`n"
}

if ($null -ne $SensitiveInformationHash.classifiertype)
{
$StringContent += " classifiertype = '$($SensitiveInformationHash.classifiertype)'`r`n"
$StringContent += " classifiertype = '$($SensitiveInformationHash.classifiertype)'`r`n"
}

if ($null -ne $SensitiveInformationHash.mincount)
{
$StringContent += " mincount = '$($SensitiveInformationHash.mincount)'`r`n"
$StringContent += " mincount = '$($SensitiveInformationHash.mincount)'`r`n"
}

if ($null -ne $SensitiveInformationHash.maxcount)
{
$StringContent += " maxcount = '$($SensitiveInformationHash.maxcount)'`r`n"
$StringContent += " maxcount = '$($SensitiveInformationHash.maxcount)'`r`n"
}

$StringContent += " }`r`n"
$StringContent += " }`r`n"
$result += $StringContent
}
$result += ' )'
$result += " )`r`n"
$result += " }`r`n"
return $result
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ function Get-TargetResource
[Parameter()]
[ValidateSet('Present', 'Absent')]
[System.String]
$Ensure,
$Ensure = 'Present',

[Parameter()]
[System.Management.Automation.PSCredential]
Expand Down Expand Up @@ -171,7 +171,7 @@ function Set-TargetResource
[Parameter()]
[ValidateSet('Present', 'Absent')]
[System.String]
$Ensure,
$Ensure = 'Present',

[Parameter()]
[System.Management.Automation.PSCredential]
Expand Down Expand Up @@ -311,7 +311,7 @@ function Test-TargetResource
[Parameter()]
[ValidateSet('Present', 'Absent')]
[System.String]
$Ensure,
$Ensure = 'Present',

[Parameter()]
[System.Management.Automation.PSCredential]
Expand Down Expand Up @@ -347,7 +347,7 @@ function Test-TargetResource
$CurrentValues = Get-TargetResource @PSBoundParameters
$ValuesToCheck = ([Hashtable]$PSBoundParameters).Clone()

if ($CurrentValues.Ensure -eq 'Absent')
if ($CurrentValues.Ensure -ne $PSBoundParameters.Ensure)
{
Write-Verbose -Message "Test-TargetResource returned $false"
return $false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ function Get-TargetResource
[Parameter()]
[ValidateSet('Present', 'Absent')]
[System.String]
$Ensure,
$Ensure = 'Present',

[Parameter()]
[System.Management.Automation.PSCredential]
Expand Down Expand Up @@ -153,7 +153,7 @@ function Set-TargetResource
[Parameter()]
[ValidateSet('Present', 'Absent')]
[System.String]
$Ensure,
$Ensure = 'Present',

[Parameter()]
[System.Management.Automation.PSCredential]
Expand Down Expand Up @@ -307,10 +307,11 @@ function Test-TargetResource
[Parameter()]
[System.Boolean]
$AllowSideLoading,

[Parameter()]
[ValidateSet('Present', 'Absent')]
[System.String]
$Ensure,
$Ensure = 'Present',

[Parameter()]
[System.Management.Automation.PSCredential]
Expand Down Expand Up @@ -346,7 +347,7 @@ function Test-TargetResource
$CurrentValues = Get-TargetResource @PSBoundParameters
$ValuesToCheck = ([Hashtable]$PSBoundParameters).Clone()

if ($CurrentValues.Ensure -eq 'Absent')
if ($CurrentValues.Ensure -ne $PSBoundParameters.Ensure)
{
Write-Verbose -Message "Test-TargetResource returned $false"
return $false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function Get-TargetResource
[Parameter()]
[ValidateSet('Present', 'Absent')]
[System.String]
$Ensure,
$Ensure = 'Present',

[Parameter()]
[System.Management.Automation.PSCredential]
Expand Down Expand Up @@ -108,7 +108,7 @@ function Set-TargetResource
[Parameter()]
[ValidateSet('Present', 'Absent')]
[System.String]
$Ensure,
$Ensure = 'Present',

[Parameter()]
[System.Management.Automation.PSCredential]
Expand Down Expand Up @@ -219,7 +219,7 @@ function Test-TargetResource
[Parameter()]
[ValidateSet('Present', 'Absent')]
[System.String]
$Ensure,
$Ensure = 'Present',

[Parameter()]
[System.Management.Automation.PSCredential]
Expand Down Expand Up @@ -256,7 +256,7 @@ function Test-TargetResource
$ValuesToCheck = ([Hashtable]$PSBoundParameters).Clone()
$ValuesToCheck.Remove('Identity') | Out-Null

if ($CurrentValues.Ensure -eq 'Absent')
if ($CurrentValues.Ensure -ne $PSBoundParameters.Ensure)
{
Write-Verbose -Message "Test-TargetResource returned $false"
return $false
Expand Down
Loading

0 comments on commit a7e092c

Please sign in to comment.