Giter Club home page Giter Club logo

Comments (4)

zparta avatar zparta commented on September 8, 2024

Hi.

I took it upon myself to fix this issue, i dont want to commit the change but i have created an easy code replace for the finnished .ps1 file, this might not be the best way to fix this but it works.

When you generate through his generator just enter multiple groups with a comma(,) as delimiter eg. "Group1,Group2" do not put any space around the comma.

Then replace this row

$driveMappingConfig = $driveMappingConfig | Where-Object { $groupMemberships -contains $_.GroupFilter -or $_.GroupFilter -eq $null }

with this code:

$driveMappingConfigCleaned = @() foreach ($mapping in $driveMappingConfig) { if($mapping.GroupFilter -ne $null -and $mapping.GroupFilter.Contains(",")) { $Agroups = $mapping.GroupFilter.Split(",") foreach ($Agroup in $Agroups) { if ($groupMemberships -contains $Agroup) { $mapping.GroupFilter = $Agroup $driveMappingConfigCleaned += $mapping break } } } else { if ($groupMemberships -contains $mapping.GroupFilter -or $mapping.GroupFilter -eq $null) { $driveMappingConfigCleaned += $mapping } } } $driveMappingConfig = $driveMappingConfigCleaned

from intunedrivemapping.

zparta avatar zparta commented on September 8, 2024

A different approach that uses Compare-Object instead.

$driveMappingConfigCleaned = @() foreach ($mapping in $driveMappingConfig) { if($mapping.GroupFilter -ne $null -and $mapping.GroupFilter.Contains(",")) { $Agroups = $mapping.GroupFilter.Split(",") $value = Compare-Object -ReferenceObject $Agroups -DifferenceObject $groupMemberships -IncludeEqual -ExcludeDifferent -PassThru if($value.Count -gt 0) { $driveMappingConfigCleaned += $mapping } } else { if ($groupMemberships -contains $mapping.GroupFilter -or $mapping.GroupFilter -eq $null) { $driveMappingConfigCleaned += $mapping } } } $driveMappingConfig = $driveMappingConfigCleaned

from intunedrivemapping.

AndreasRogge avatar AndreasRogge commented on September 8, 2024

I also added a pull request quite a time ago. You can see my code there. But it seems like this repo won't get updated anymore.

from intunedrivemapping.

nicolonsky avatar nicolonsky commented on September 8, 2024

#27

from intunedrivemapping.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.