Skip to content

Commit

Permalink
Readd missing Wi-Fi parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
U116139 authored and U116139 committed Dec 1, 2023
1 parent 82fdc44 commit eb1d3af
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 7 deletions.
4 changes: 0 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@

# 1.23.1129.1

* IntuneAntivirusPolicyWindows10SettingCatalog
* Skipped settingValueTemplateReference and settingInstanceTemplateReference for severethreats, highseveritythreats, moderateseveritythreats, lowseveritythreats as per API requirements observed in the Intune portal
FIXES [#3818](https://github.com/microsoft/Microsoft365DSC/issues/3818)
FIXES [#3955](https://github.com/microsoft/Microsoft365DSC/issues/3955)
* AADRoleSetting
* Export sorted by DisplayName for better comparison
* Enable Filter property to be used on export
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ function Get-TargetResource
[System.String]
$Description,

[Parameter()]
[System.Boolean]
$ConnectAutomatically,

[Parameter()]
[System.Boolean]
$ConnectWhenNetworkNameIsHidden,
Expand Down Expand Up @@ -120,6 +124,7 @@ function Get-TargetResource
Id = $getValue.Id
Description = $getValue.Description
DisplayName = $getValue.DisplayName
ConnectAutomatically = $getValue.AdditionalProperties.connectAutomatically
ConnectWhenNetworkNameIsHidden = $getValue.AdditionalProperties.connectWhenNetworkNameIsHidden
NetworkName = $getValue.AdditionalProperties.networkName
Ssid = $getValue.AdditionalProperties.ssid
Expand Down Expand Up @@ -181,6 +186,10 @@ function Set-TargetResource
[System.String]
$Description,

[Parameter()]
[System.Boolean]
$ConnectAutomatically,

[Parameter()]
[System.Boolean]
$ConnectWhenNetworkNameIsHidden,
Expand Down Expand Up @@ -273,7 +282,6 @@ function Set-TargetResource

$CreateParameters = ([Hashtable]$PSBoundParameters).clone()
$CreateParameters = Rename-M365DSCCimInstanceParameter -Properties $CreateParameters
$CreateParameters.Add('ConnectAutomatically', $false)

$AdditionalProperties = Get-M365DSCAdditionalProperties -Properties ($CreateParameters)
foreach ($key in $AdditionalProperties.keys)
Expand Down Expand Up @@ -394,6 +402,10 @@ function Test-TargetResource
[System.String]
$Description,

[Parameter()]
[System.Boolean]
$ConnectAutomatically,

[Parameter()]
[System.Boolean]
$ConnectWhenNetworkNameIsHidden,
Expand Down Expand Up @@ -463,7 +475,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 @@ -15,6 +15,7 @@ class MSFT_IntuneWifiConfigurationPolicyAndroidDeviceAdministratorBasic : OMI_Ba
[Write, Description("Id of the Intune Policy.")] String Id;
[Key, Description("Display name of the Intune Policy.")] String DisplayName;
[Write, Description("Description of the Intune Policy.")] String Description;
[Write, Description("Connect automatically.")] Boolean ConnectAutomatically;
[Write, Description("Connect if the network name is hidden.")] Boolean ConnectWhenNetworkNameIsHidden;
[Write, Description("Network name.")] String NetworkName;
[Write, Description("SSID.")] String Ssid;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Configuration Example
dataType = '#microsoft.graph.allDevicesAssignmentTarget'
}
)
ConnectAutomatically = $True
ConnectWhenNetworkNameIsHidden = $True
DisplayName = 'Android Device Admin Basic Wi-Fi Profile'
NetworkName = 'b71f8c63-8140-4c7e-b818-f9b4aa98b79b'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture {
$secpasswd = ConvertTo-SecureString 'test@password1' -AsPlainText -Force
$Credential = New-Object System.Management.Automation.PSCredential ('tenantadmin@mydomain.com', $secpasswd)


Mock -CommandName Confirm-M365DSCDependencies -MockWith {
}

Expand Down Expand Up @@ -57,6 +56,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture {
Context -Name 'The IntuneWifiConfigurationPolicyAndroidDeviceAdministratorBasic should exist but it DOES NOT' -Fixture {
BeforeAll {
$testParams = @{
ConnectAutomatically = $True
ConnectWhenNetworkNameIsHidden = $True
Description = 'FakeStringValue'
DisplayName = 'FakeStringValue'
Expand Down Expand Up @@ -87,6 +87,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture {
Context -Name 'The IntuneWifiConfigurationPolicyAndroidDeviceAdministratorBasic exists but it SHOULD NOT' -Fixture {
BeforeAll {
$testParams = @{
ConnectAutomatically = $True
ConnectWhenNetworkNameIsHidden = $True
Description = 'FakeStringValue'
DisplayName = 'FakeStringValue'
Expand Down Expand Up @@ -134,6 +135,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture {
Context -Name 'The IntuneWifiConfigurationPolicyAndroidDeviceAdministratorBasic Exists and Values are already in the desired state' -Fixture {
BeforeAll {
$testParams = @{
ConnectAutomatically = $True
ConnectWhenNetworkNameIsHidden = $True
Description = 'FakeStringValue'
DisplayName = 'FakeStringValue'
Expand Down Expand Up @@ -173,6 +175,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture {
Context -Name 'The IntuneWifiConfigurationPolicyAndroidDeviceAdministratorBasic exists and values are NOT in the desired state' -Fixture {
BeforeAll {
$testParams = @{
ConnectAutomatically = $True
ConnectWhenNetworkNameIsHidden = $True
Description = 'FakeStringValue'
DisplayName = 'FakeStringValue'
Expand Down

0 comments on commit eb1d3af

Please sign in to comment.