almenscorner / IntuneCD

Tool to backup, update and document configurations in Intune
MIT License
277 stars 35 forks source link

[BUG] Square [ ] brackets causing error in 'Find change author & commit the back' #158

Closed Eagle-Admin closed 8 months ago

Eagle-Admin commented 8 months ago

Describe the bug Square brackets causes an error in the job ''Backup & commit Intune configuration' at job step 'Find change author & commit the back'.

To Reproduce Steps to reproduce the behavior:

Expected behavior [ ] in names seemingly aren't an issue in other types of policies, such as compliance.

Screenshots If applicable, add screenshots to help explain your problem.

Run type (please complete the following information):

Additional context

Get-Content: /home/vsts/work/_temp/933585a4-5583-4fdd-a98c-2210e82adf19.ps1:106
Line |
 106 |  …  (ConvertFrom-Json -InputObject (Get-Content $_.FullName -Raw)).paylo …
     |                                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | An object at the specified path /home/vsts/work/1/s/prod-backup/Device
     | Configurations/[Review] Windows _ Default Policies for
     | EDU_windows10GeneralConfiguration__00000000-0000-0000-0000-000000000000.json does not exist, or has been filtered by the -Include or -Exclude parameter.

##[error]PowerShell exited with code '1'.
almenscorner commented 8 months ago

Hi, it looks like the error is generated from the PowerShell script in the pipeline created by Ondrej and not IntuneCD itself. Is the backup working if you run it locally without any other scripts performing anything?

Eagle-Admin commented 8 months ago

You're right, I'm sorry. It's not IntuneCD but a pipeline powershell script within. I believe it's by this guy: https://github.com/ztrhgf

The issue seems to related to the 'Get-ChildItem' cmdlet, and the way wildcards are defined.

We will try to fix it ourselves.