I have a GUI with a read-only textbox that I drag files to and a function then runs with the file. This works on my machine for files in local download folders, all file extensions, outlook email attachments, etc. I have no issues.
A colleague has begun using it and he is unable to successfully drag email attachments from outlook into the box. The arg is empty. It all works on my machine, but not his. I had one other person test, and they had the same issue.
$filebox.Add_DragEnter({
if ($_.Data.GetDataPresent([Windows.Forms.DataFormats]::FileDrop)) {
$_.Effect = [Windows.Forms.DragDropEffects]::Copy
}
})
$filebox.Add_DragDrop({
foreach ($file in $_.Data.GetData([Windows.Forms.DataFormats]::FileDrop)) {
create_dir $file # Function doesn't even trigger here with outlook email attachments because no arg
}
})
We are all pulling from a shared inbox. Nothing is hard-coded to identify the user, or define a set path, it should just grab the path of the arg dropped in the box, right? I'm just confused how the drag/drop is working for some files but not email attachments, and then also working fully on my machine.
I would consider myself a pretty novice coder, and first time ever messing with Powershell. (I do not have access to anything else in this situation. No ability to compile c#, powershell is it.). Maybe I'm missing something fundemental here. Anyone have any thoughts on this?