almenscorner / IntuneCD

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

[BUG] Scripts: No changes foun -> Script changed #185

Closed Edocsyl closed 5 months ago

Edocsyl commented 5 months ago

Describe the bug If the "Script location" is changed, i.e. if the script is uploaded again, the following message appears in the IntuneCD log.

----------------------------------------------------------------------------------------------------
No changes found for PowerShell Script: SCRIPTNAME
Script changed, check commit history for details
----------------------------------------------------------------------------------------------------
No changes found for PowerShell Script:SCRIPTNAME
Script changed, check commit history for details
----------------------------------------------------------------------------------------------------

To Reproduce

  1. Deploy a Script via IntuneCD
  2. Modify the "Script Content" e.g. Upload the Script manually in Intune
  3. Redeploy the Script via IntuneCD

Expected behavior A clear and concise description of what you expected to happen.

Run type (please complete the following information):

Additional context When changing for example the description of the Script in Intune, the behavoir with in the Logs is correct.

almenscorner commented 5 months ago

I'm not sure I am following here, is the issue that it outputs "script changed" when there actually is no change to the script?

Edocsyl commented 5 months ago

Not the following text is added to a script change and has not to be added.

No changes found for PowerShell Script: SCRIPTNAME

almenscorner commented 5 months ago

Ah got you, that log message is for the configs in the policy in Intune such as description etc, it will always be printed when no changes are found just like the other policies, script changes outputs no message if not changed and then "Script changed, check commit history for details" if changed.

I could make the log message clearer by changing it to something like No changes found for PowerShell Script Policy: SCRIPTNAME

almenscorner commented 5 months ago

It is two separate diff comparisons when running an update on scripts, one is for the config and the other is for the actual script

Edocsyl commented 5 months ago

Ah Voilà, did not know this. Well a clarification in the log message would be great.

almenscorner commented 5 months ago

I will append "policy" to the script configs so it's clearer in the output :)

almenscorner commented 5 months ago

RC1 is now available which contains logging improvements