OfficeDev / O365-EDU-Tools

O365 Education tools and scripts repository
MIT License
202 stars 396 forks source link

[Bug]: Block Powershell MS Graph Module scripts duplicated with incorrect comments #123

Closed tobybaratta closed 1 year ago

tobybaratta commented 1 year ago

File Path(s)

/SDS%20Scripts/Block%20PowerShell/Block-MS_Graph_module_for_everyone_except_a_list_of_admins.ps1

What happened?

Problem: There are two sets of duplicated scripts, with the only difference between the two being the Graph ID. In the Block Powershell folder, there are 4 files - 2 of which are named the same but with module inserted into the title. The difference between the module files and the non-module files seem to be solely the Graph ID.

If these scripts are supposed to do different things, it should be made clear in the comments what they are supposed to be doing. If they're supposed to be doing the same thing, they should be deduped.

In the "admin" script, the comment on line 16 is incorrect. It says: # Assign the default app role (0-Guid) to the current user, when it is actually assigning permissions to a list of administrators.

Propose Solution:

  1. Determine if these two scripts are supposed to perform the same operations or if they should be demonstrating something different for the module versus non-module scripts.
  2. If the files are just duplicates, delete one set of the duplicates.
  3. If the files are not meant to be duplicates, either explain what the difference is in them or fix them to be different.
  4. Update the comment on line 16 of the list of admins file to not say # Assign the default app role (0-Guid) to the current user but say # Assign the default permsissions to all admins in the CSV file list or equivalent.

Relevant log output

No response

Code of Conduct

AyronJohnson commented 1 year ago

Closing due to pr #124 commit 8f1ad2dafb21706f0a314adc83fd2c7f5f56a0cd