aaronparker / intune

Scripts and tools for use with Microsoft Intune
https://stealthpuppy.com
MIT License
257 stars 52 forks source link

Scripts do not support single xml, only 2 or more work :) #8

Closed mjgr33n closed 2 years ago

mjgr33n commented 2 years ago

Not a major issue, but worth pointing out that the scripts (Invoke-Uev.ps1, Get-AzureBlobItem.ps1, Detect-Uev.ps1) don't work if the blob storage only contains one xml file, as soon as there are two or more it works perfectly, thank you for the hard work :) I assume it if the Get-AzureBlobItem function and have seen this myself at times when constructing lists, ultimately anybody useing UE-V is going to have more than one custom xml, so not a biggy but if you are testing with one xml then it will fail and some might find it hard to figure out why, so worth putting in the readme about using at least 2 files.

aaronparker commented 2 years ago

Thanks for reporting.

Get-AzureBlobItem works with a single item in the target blob container, so I'm not sure what's going on there. This line in Invoke-Uev.ps1 ensures the script only continues if it finds 1 or more XML files: https://github.com/aaronparker/intune/blob/4a113290f4dedf19d30874afb4837a67d6415378/Uev/Invoke-Uev.ps1#L267

mjgr33n commented 2 years ago

I will test some other things like just using one of your example xm files and get back to you. Maybe it was the xml files fault that I used when it only had one, it was called "Warframe.x64.xml" I wonder if it is to do with it having 2 "." in, this is the content of the file:

`<?xml version="1.0"?>

Warframe Warframe-Warframe-x64-v-2022-2 1 Matthew J. Green Warframe.x64.exe LOCALAPPDATA Warframe *.log `
aaronparker commented 2 years ago

There is some checking in the Invoke-Uev.ps1 using Regex to ensure only XML files are downloaded. Perhaps the Regex needs tweaking to account for .x64.xml

mjgr33n commented 2 years ago

So, a few red herrings, the Detect-Uev.ps1 and Invoke-Uev.ps1 are definitely working with 1 file regardless of the name, it is the Get-AzureBlobItem.ps1 on it's own that is not showing me anything, but if I paste the script contents into PowerShell and call the function Get-AzureBlobItem it then outputs the right information into the PowerShell window and correctly works regardless of it just being 1 xml or more, for some reason I must have been playing around with pasting different parts and eventually got the script to work when using multiple but not 1 and this then confused me making me think it was not detecting anything. Apologies for the confusion, will close this now.