microsoft / shell-intune-samples

Sample shell scripts for Intune admins.
MIT License
684 stars 222 forks source link

Added safety & efficiency when checking latest version #67

Closed garrows closed 1 year ago

garrows commented 2 years ago

Previously if the curl failed, $lastmodified is set to a blank string. Later on, it'll unnecessarily try to install an update because the versions mismatch. See screenshot for an example log of this happening.

image

Additionally, now $lastmodified is cached so when fetchLastModifiedDate update is called, it'll always be the same version and not have a risk of failure.