Skip to content

Commit

Permalink
Merge branch 'Dev' into issue-3978/fix-policy
Browse files Browse the repository at this point in the history
  • Loading branch information
NikCharlebois authored Dec 19, 2023
2 parents eb057b6 + a03d490 commit e02c529
Show file tree
Hide file tree
Showing 652 changed files with 15,226 additions and 3,303 deletions.
49 changes: 0 additions & 49 deletions .github/workflows/AzureCloud - Integration.yml

This file was deleted.

86 changes: 86 additions & 0 deletions .github/workflows/Global - Integration - INTUNE.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
name: Global - Integration - INTUNE
on: [push]

jobs:
Integration-Global-INTUNE:
# The type of runner that the job will run on
runs-on: windows-latest

# Only when run from the main repo
if: github.repository == 'microsoft/Microsoft365DSC'

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
- name: Install Microsoft365DSC
shell: powershell
run: |
winrm quickconfig -force
$source = "./Modules/Microsoft365DSC/"
$destination = "C:\Program Files\WindowsPowerShell\Modules"
Copy-Item -Path $source -Recurse -Destination $destination -Container -Force
Update-M365DSCDependencies
- name: Configure Environment
shell: powershell
run: |
Set-ExecutionPolicy Unrestricted -Force
Get-ChildItem "C:\Program Files\WindowsPowerShell\Modules" -Recurse | Unblock-File
Set-M365DSCTelemetryOption -Enabled $false
Set-Item -Path WSMan:\localhost\MaxEnvelopeSizekb -Value 99999
- name: Generate {Create} Integration Tests from Examples
shell: powershell
run: |
Import-Module './Tests/Integration/M365DSCTestEngine.psm1'
New-M365DSCIntegrationTest -Workload INTUNE -Step '1-Create'
- name: Commit {Create} Integration Tests
shell: powershell
run: |
git config --local user.email "nicharl@microsoft.com"
git config --local user.name "NikCharlebois"
git add D:/a/Microsoft365DSC/Microsoft365DSC/Tests/Integration/*
git pull
git commit -m "Updated {Create} Intune Integration Tests"
git push
$SHA = git rev-parse HEAD
echo "commitid=$SHA" >> $env:GITHUB_OUTPUT
- name: Run {Create} Integration Tests
shell: powershell
env:
INTEGRATION_USERNAME: ${{ secrets.INTEGRATION_USERNAME }}
INTEGRATION_PASSWORD: ${{ secrets.INTEGRATION_PASSWORD }}
run: |
$CredPassword = ConvertTo-SecureString $env:INTEGRATION_PASSWORD -AsPlainText -Force
$Credential = New-Object System.Management.Automation.PSCredential ($env:INTEGRATION_USERNAME, $CredPassword)
try
{
& .\Tests\Integration\Microsoft365DSC\M365DSCIntegration.INTUNE.Create.Tests.ps1 -Credential $Credential
}
catch
{
throw $_
}
try
{
$Result = Test-DSCConfiguration -Detailed -Verbose
}
catch
{
throw $_
}
if ($Result.InDesiredState -eq $false)
{
Write-Host -Message "Resources below are not in the Desired State:"
foreach ($Resource in $Result.ResourcesNotInDesiredState)
{
Write-Host $Resource.InstanceName
}
throw "Could not validate that the Tenant is in the Desired State"
}
else
{
Write-Host "All resources in the Tenant are in the Desired State"
}
4 changes: 2 additions & 2 deletions .github/workflows/PublishGitHubPages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ jobs:
if: always()
shell: pwsh
run: |
git config --local user.email "nik.charlebois@microsoft.com"
git config --local user.name "Nik Charlebois"
git config --local user.email "nicharl@microsoft.com"
git config --local user.name "NikCharlebois"
git add D:/a/Microsoft365DSC/Microsoft365DSC/docs/docs/*
git pull
git commit -m "Updated Resources and Cmdlet documentation pages"
Expand Down
29 changes: 29 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,35 @@
* Fixed import, update and test of the resource
FIXES [#3975](https://github.com/microsoft/Microsoft365DSC/issues/3975)

# 1.23.1213.1

* IntuneAntivirusPolicyWindows10SettingCatalog
* Fix issue with Set-TargetResource when retrieving a policy from displayName
FIXES [#4003](https://github.com/microsoft/Microsoft365DSC/issues/4003)
* IntuneEndpointDetectionAndResponsePolicyWindows10
* Fix issue with assignments
FIXES [#3904](https://github.com/microsoft/Microsoft365DSC/issues/3904)
* IntuneWindowsUpdateForBusinessRingUpdateProfileWindows10
* Fix parameter name in assignment cmdlet
FIXES [#4007](https://github.com/microsoft/Microsoft365DSC/issues/4007)
* DEPENDENCIES
* Updated Microsoft.Graph to version 2.11.1.
* Updated MSCloudLoginAssistant to version 1.1.3.

# 1.23.1206.1

* IntuneAntivirusPolicyWindows10SettingCatalog
* Fix condition in Test-TargetResource to check if resource was removed or not
FIXES [#3958](https://github.com/microsoft/Microsoft365DSC/issues/3958)
* IntuneWindowsUpdateForBusinessRingUpdateProfileWindows10
* Fix typo in assignment cmdlet
FIXES [#3996](https://github.com/microsoft/Microsoft365DSC/issues/3996)
* DEPENDENCIES
* Updated MSCloudLoginAssistant to version 1.1.2.
* MISC
* Fix Compare-M365DSCConfigurations to exclude resources correctly
FIXES [#4000](https://github.com/microsoft/Microsoft365DSC/issues/4000)

# 1.23.1129.1

* AADRoleSetting
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -949,6 +949,10 @@ function Export-TargetResource
[OutputType([System.String])]
param
(
[Parameter()]
[System.String]
$Filter,

[Parameter()]
[System.Management.Automation.PSCredential]
$Credential,
Expand Down Expand Up @@ -989,12 +993,14 @@ function Export-TargetResource
Add-M365DSCTelemetryEvent -Data $data
#endregion




try
{
$Script:ExportMode = $true
#region resource generator code
[array] $Script:exportedInstances = Get-MgBetaDirectoryAdministrativeUnit -All `
-ErrorAction Stop
[array] $Script:exportedInstances = Get-MgBetaDirectoryAdministrativeUnit -Filter $Filter -All:$true -ErrorAction Stop
#endregion

$i = 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ function Get-TargetResource
[OutputType([System.Collections.Hashtable])]
param
(
[Parameter(Mandatory = $true)]
[Parameter()]
[System.String]
$Identity,

Expand Down Expand Up @@ -258,7 +258,7 @@ function Set-TargetResource
[CmdletBinding()]
param
(
[Parameter(Mandatory = $true)]
[Parameter()]
[System.String]
$Identity,

Expand Down Expand Up @@ -446,7 +446,7 @@ function Test-TargetResource
[OutputType([System.Boolean])]
param
(
[Parameter(Mandatory = $true)]
[Parameter()]
[System.String]
$Identity,

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ class MSFT_IntuneAccountProtectionLocalAdministratorPasswordSolutionPolicyAssign
[ClassVersion("1.0.0.0"), FriendlyName("IntuneAccountProtectionLocalAdministratorPasswordSolutionPolicy")]
class MSFT_IntuneAccountProtectionLocalAdministratorPasswordSolutionPolicy : OMI_BaseResource
{
[Key, Description("Identity of the account protection local administrator password solution policy.")] String Identity;
[Required, Description("Display name of the account protection local administrator password solution policy.")] String DisplayName;
[Write, Description("Identity of the account protection local administrator password solution policy.")] String Identity;
[Key, Description("Display name of the account protection local administrator password solution policy.")] String DisplayName;
[Write, Description("Description of the account protection local administrator password solution policy.")] String Description;
[Write, Description("Assignments of the account protection local administrator password solution policy."), EmbeddedInstance("MSFT_IntuneAccountProtectionLocalAdministratorPasswordSolutionPolicyAssignments")] String Assignments[];
[Write, Description("Configures which directory the local admin account password is backed up to. 0 - Disabled, 1 - Azure AD, 2 - AD"), ValueMap{"0", "1", "2"}, Values{"0", "1", "2"}] UInt32 BackupDirectory;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ function Get-TargetResource
[OutputType([System.Collections.Hashtable])]
param
(
[Parameter(Mandatory = $true)]
[Parameter()]
[System.String]
$Identity,

Expand Down Expand Up @@ -192,7 +192,7 @@ function Set-TargetResource
[CmdletBinding()]
param
(
[Parameter(Mandatory = $true)]
[Parameter()]
[System.String]
$Identity,

Expand Down Expand Up @@ -338,7 +338,7 @@ function Test-TargetResource
[OutputType([System.Boolean])]
param
(
[Parameter(Mandatory = $true)]
[Parameter()]
[System.String]
$Identity,

Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ function Get-TargetResource
[OutputType([System.Collections.Hashtable])]
param
(
[Parameter(Mandatory = $true)]
[Parameter()]
[System.String]
$Identity,

Expand Down Expand Up @@ -246,7 +246,7 @@ function Set-TargetResource
[CmdletBinding()]
param
(
[Parameter(Mandatory = $true)]
[Parameter()]
[System.String]
$Identity,

Expand Down Expand Up @@ -470,7 +470,7 @@ function Test-TargetResource
[OutputType([System.Boolean])]
param
(
[Parameter(Mandatory = $true)]
[Parameter()]
[System.String]
$Identity,

Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -896,7 +896,7 @@ function Set-TargetResource
-TemplateReferenceId $templateReferenceId

Update-IntuneDeviceConfigurationPolicy `
-DeviceConfigurationPolicyId $Identity `
-DeviceConfigurationPolicyId $currentPolicy.Identity `
-Name $DisplayName `
-Description $Description `
-TemplateReferenceId $templateReferenceId `
Expand Down Expand Up @@ -1286,9 +1286,9 @@ 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 'The policy was not found'
Write-Verbose -Message "Test-TargetResource returned $false"
return $false
}
$testResult = $true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ function Test-TargetResource
Write-Verbose -Message "Current Values: $(Convert-M365DscHashtableToString -Hashtable $CurrentValues)"
Write-Verbose -Message "Target Values: $(Convert-M365DscHashtableToString -Hashtable $PSBoundParameters)"

if ($null -ne $CurrentValues.CustomSettings -and $null -ne $CustomSettings)
if ($null -ne $CurrentValues.CustomSettings -and $CurrentValues.CustomSettings.Length -gt 0 -and $null -ne $CustomSettings)
{
$value = Test-M365DSCAppConfigurationPolicyCustomSetting -Current $CurrentValues.CustomSettings -Desired $CustomSettings
if ($value -eq $false)
Expand Down
Loading

0 comments on commit e02c529

Please sign in to comment.