Skip to content

Commit

Permalink
Merge branch 'Dev' into fix/graph-limited-requests
Browse files Browse the repository at this point in the history
  • Loading branch information
ykuijs authored Nov 26, 2024
2 parents b1c5f73 + ad0cbe0 commit b34833c
Show file tree
Hide file tree
Showing 16 changed files with 379 additions and 160 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/CodeCoverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ jobs:
- name: Install Modules
shell: pwsh
run: |
Install-Module ReverseDSC -Force -Scope AllUsers
Install-Module DSCParser -Force -Scope AllUsers
Install-Module PSDesiredStateConfiguration -Force -Scope AllUsers
Install-Module Pester -Force -SkipPublisherCheck -Scope AllUsers
Install-PSResource -Name ReverseDSC -Scope AllUsers -TrustRepository
Install-PSResource -Name DSCParser -Scope AllUsers -TrustRepository
Install-PSResource -Name PSDesiredStateConfiguration -Scope AllUsers -TrustRepository
Install-PSResource -Name Pester -Scope AllUsers -TrustRepository
[System.Environment]::SetEnvironmentVariable('M365DSCTelemetryEnabled', $false, [System.EnvironmentVariableTarget]::Machine);
- name: Run Quality Checks
shell: pwsh
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/Unit Tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ jobs:
- name: Install Modules
shell: pwsh
run: |
Install-Module ReverseDSC -Force -Scope AllUsers
Install-Module DSCParser -Force -Scope AllUsers
Install-Module PSDesiredStateConfiguration -Force -Scope AllUsers
Install-Module Pester -Force -SkipPublisherCheck -Scope AllUsers
Install-PSResource -Name ReverseDSC -Scope AllUsers -TrustRepository
Install-PSResource -Name DSCParser -Scope AllUsers -TrustRepository
Install-PSResource -Name PSDesiredStateConfiguration -Scope AllUsers -TrustRepository
Install-PSResource -Name Pester -Scope AllUsers -TrustRepository
[System.Environment]::SetEnvironmentVariable('M365DSCTelemetryEnabled', $false, [System.EnvironmentVariableTarget]::Machine);
- name: Run Quality Checks
shell: pwsh
Expand Down
2 changes: 1 addition & 1 deletion .vscode/GetTestCoverage.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ $minVersion = '5.5.0'

$module = Get-Module -ListAvailable | Where-Object { $_.Name -eq $moduleName -and $_.Version -ge $minVersion }

if ($module -ne $null)
if ($null -ne $module)
{
Write-Output "Module $moduleName with version greater than or equal to $minVersion found."
}
Expand Down
25 changes: 23 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,39 @@

* AAD
* Added ApplicationSecret auth method to multiple resources
* EXORecipientPermission
* Added logic to update an existing recipient's permissions.
* EXOEOPProtectionPolicyRule
* Added support for AccessTokens.
* EXOExternalInOutlook
* Added support for AccessTokens.
* EXOMailContact
* Changed how empty arrays are returned.
* EXOPlace
* Changed how empty arrays are returned.
* EXORecipientPermission
* Added logic to update an existing recipient's permissions.
* EXOTransportRule
* Changed how empty arrays are returned.
* INTUNE
* Add parameter `-All` to Graph requests to fetch all policies on Get.
* IntuneAndroidManagedStoreAppConfiguration
* Initial release.
* IntuneAppConfigurationPolicy
* Fixes an issue where assignment wasn't properly set if the
groupId was null.
FIXES [#5430](https://github.com/microsoft/Microsoft365DSC/issues/5430)
* TeamsUserPolicyAssignment
* Added support for the Global policies.
* TeamsUpgradePolicy
* DEPRECATED: Users properties. Use the TeamsUserPolicyAssignment resource
instead.
* MISC
* Removed hardcoded Graph urls and replaced by MSCloudLoginAssistant values.
* Add separate module handling for PowerShell Core.
* DEPENDENCIES
* Updated DSCParser to version 2.0.0.14.
* Updated Microsoft.Graph to version 2.25.0.
* Updated Microsoft.PowerApps.Administration.PowerShell to version 2.0.200.
* Updated MicrosoftTeams to version 6.7.0.

# 1.24.1120.1

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,10 @@ function Get-TargetResource
{
$result."ExtensionCustomAttribute$i" = $contact."ExtensionCustomAttribute$i"
}
else
{
$result."ExtensionCustomAttribute$i" = @()
}
}

Write-Verbose -Message "Found Mail Contact $($Name)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,12 @@ function Get-TargetResource
}
}

$TagsValue = [Array] $place.Tags
if ($place.Tags -eq $null)
{
$TagsValue = @()
}

$result = @{
Identity = $place.Identity
AudioDeviceName = $place.AudioDeviceName
Expand All @@ -203,7 +209,7 @@ function Get-TargetResource
PostalCode = $place.PostalCode
State = $place.State
Street = $place.Street
Tags = [Array] $place.Tags
Tags = $TagsValue
VideoDeviceName = $place.VideoDeviceName
Credential = $Credential
Ensure = 'Present'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -967,6 +967,16 @@ function Get-TargetResource
TenantId = $TenantId
AccessTokens = $AccessTokens
}
$inputParams = (Get-Command 'Get-TargetResource').Parameters
foreach ($key in $inputParams.Keys)
{
$propertyInfo = $inputParams.$key
$curVar = Get-Variable -Name $key -ErrorAction SilentlyContinue
if ($propertyInfo.ParameterType.Name -eq 'String[]' -and $curVar -ne $null -and $curVar.Value -eq $null)
{
$result.$key = @()
}
}

# Formats DateTime as String
if ($null -ne $result.ActivationDate)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ function Get-TargetResource
[System.String]
$Identity,

# DEPRECATED
[Parameter()]
[System.String[]]
$Users,
Expand Down Expand Up @@ -66,22 +67,6 @@ function Get-TargetResource
$policy = Get-CsTeamsUpgradePolicy -Identity $Identity `
-ErrorAction SilentlyContinue

if ($Identity -eq 'Global')
{
[array]$users = Get-CsOnlineUser -Filter "TeamsUpgradePolicy eq null"
}
else
{
try
{
[array]$users = Get-CsOnlineUser -Filter "TeamsUpgradePolicy eq '$Identity'"
}
catch
{
[array]$users = Get-CsOnlineUser | Where-Object -Filter { $_.TeamsUpgradePolicy -eq $Identity }
}
}

if ($null -eq $policy)
{
throw "No Teams Upgrade Policy with Identity {$Identity} was found"
Expand All @@ -95,7 +80,8 @@ function Get-TargetResource
Write-Verbose -Message "Found Teams Upgrade Policy with Identity {$Identity}"
return @{
Identity = $Identity
Users = $usersList
#DEPRECATED
#Users = $usersList
MigrateMeetingsToTeams = $MigrateMeetingsToTeams
Credential = $Credential
ApplicationId = $ApplicationId
Expand Down Expand Up @@ -126,6 +112,7 @@ function Set-TargetResource
[System.String]
$Identity,

# DEPRECATED
[Parameter()]
[System.String[]]
$Users,
Expand Down Expand Up @@ -204,6 +191,7 @@ function Test-TargetResource
[System.String]
$Identity,

# DEPRECATED
[Parameter()]
[System.String[]]
$Users,
Expand Down Expand Up @@ -255,6 +243,7 @@ function Test-TargetResource
Write-Verbose -Message "Target Values: $(Convert-M365DscHashtableToString -Hashtable $PSBoundParameters)"

$ValuesToCheck = $PSBoundParameters
$ValuesToCheck.Remove("Users") | Out-Null

$TestResult = Test-M365DSCParameterState -CurrentValues $CurrentValues `
-Source $($MyInvocation.MyCommand.Source) `
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
class MSFT_TeamsUpgradePolicy : OMI_BaseResource
{
[Key, Description("Identity of the Teams Upgrade Policy.")] String Identity;
[Write, Description("List of users that will be granted the Upgrade Policy to. Use value * to apply the policy globally.")] String Users[];
[Write, Description("DEPRECATED. Use the TeamsUserPolicyAssignment resource instead.")] String Users[];
[Write, Description("Specifies whether to move existing Skype for Business meetings organized by the user to Teams. This parameter can only be true if the mode of the specified policy instance is either TeamsOnly or SfBWithTeamsCollabAndMeetings, and if the policy instance is being granted to a specific user. It not possible to trigger meeting migration when granting TeamsUpgradePolicy to the entire tenant.")] Boolean MigrateMeetingsToTeams;
[Write, Description("Credentials of the Teams Admin"), EmbeddedInstance("MSFT_Credential")] string Credential;
[Write, Description("Id of the Azure Active Directory application to authenticate with.")] String ApplicationId;
Expand Down
Loading

0 comments on commit b34833c

Please sign in to comment.