Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial module. Adds support for iOS trusted root certs #5467

Open
wants to merge 11 commits into
base: Dev
Choose a base branch
from

Conversation

dannyKBjj
Copy link
Contributor

Pull Request (PR) description

This Pull Request (PR) fixes the following issues

None

Task list

  • Added an entry to the change log under the Unreleased section of the file CHANGELOG.md.
    Entry should say what was changed and how that affects users (if applicable), and
    reference the issue being resolved (if applicable).
  • Resource parameter descriptions added/updated in the schema.mof.
  • Resource documentation added/updated in README.md.
  • Resource settings.json file contains all required permissions.
  • Examples appropriately added/updated.
  • Unit tests added/updated.
  • New/changed code adheres to DSC Community Style Guidelines.

@dannyKBjj
Copy link
Contributor Author

Will be adding Android equivalent module soon

@dannyKBjj
Copy link
Contributor Author

Failed checks, but doesn't appear to be anything to do with my resource.

image

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you save the schema file in UTF16? Could you please try with UTF8 instead? Otherwise it shows up in GH as binary file.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not on purpose, but yes it was UTF16, have resaved all files as UTF8 in both PRs

@ricmestre
Copy link
Contributor

OK let me test this on my dev tenant to check if there's any issues and I'll get back to you

$nullResult.Ensure = 'Absent'
try
{
if (-not [string]::IsNullOrWhiteSpace($id)){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still not quite right, the bracket { must be right below if aligned to the closing bracket }

{
Update-DeviceConfigurationPolicyAssignment -DeviceConfigurationPolicyId $policy.id `
-Targets $assignmentsHash `
-Repository 'deviceAppManagement/mobileAppConfigurations'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't correct, I had to figure out why the assignments were not working, this is because the correct repository to use here is 'deviceManagement/deviceConfigurations'

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I thought they were, I'll look into it.

$assignmentsHash = ConvertTo-IntunePolicyAssignment -IncludeDeviceFilter:$true -Assignments $Assignments
Update-DeviceConfigurationPolicyAssignment -DeviceConfigurationPolicyId $currentInstance.id `
-Targets $assignmentsHash `
-Repository 'deviceAppManagement/mobileAppConfigurations'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above, correct repository is 'deviceManagement/deviceConfigurations'

@ricmestre
Copy link
Contributor

@dannyKBjj Please check my latest comments and make sure you also correct them in your other PR

Write-Verbose -Message "No Intune Trusted Root Certificate Policy for iOS with Id {$id} was found"
return $nullResult
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a line here with the below, otherwise if the blueprint contains a bogus Id or from a different tenant the verbose messages will pick up the Id from the blueprint which will be incorrect.

$Id = $getValue.Id

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry I don't think I understand.. I want it to pick up the bogus ID from the blueprint don't I? That code would only execute if $getValue.Id was null?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Look at the actual placement of where I'm asking to place it, yes you first want to search the policy by its Id which if it's bogus/from another tenant you then search by Display Name, if you then find it this policy will actually have its own Id which is different from what it's in the blueprint so if you place $Id = $getValue.Id on line 113 the next verbose message will show the actual Id of this policy instead of what's in the blueprint which is wrong

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah ok. Thanks.

 $Id = $getValue.Id added on line 113 to make sure verbose message displays correct ID.
Now searching correct repository deviceManagement/deviceConfigurations for assignments.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants