MSEndpointMgr / IntuneWin32App

Provides a set of functions to manage all aspects of Win32 apps in Microsoft Intune.
MIT License
345 stars 88 forks source link

azcopy option not working when Add-IntuneWin32App executed in a job #64

Closed TheQuiz03 closed 1 year ago

TheQuiz03 commented 1 year ago

When executing Add-IntuneWin32App in script that uses multi-threaded jobs, The UseAzCopy parameter doesn't work properly. In the verbose output, the last line would be: VERBOSE: Using AzCopy.exe method for file transfer

After a bit of troubleshooting i was able to resolve the issue by replacing -NoNewWindow with -WindowStyle Hidden in line 75 of the \Private\Invoke-AzureCopyUtility.ps1 file

Before: $TransferOperation = Start-Process -FilePath $AzCopyPath -ArgumentList "cp "$($FilePath)" "$($StorageUri)" --output-type "json"" -PassThru -NoNewWindow -ErrorAction "Stop"

After: $TransferOperation = Start-Process -FilePath $AzCopyPath -ArgumentList "cp "$($FilePath)" "$($StorageUri)" --output-type "json"" -PassThru -WindowStyle Hidden -ErrorAction "Stop"

NickolajA commented 1 year ago

Thank you for reporting this, that was not part of any tests that I've originally made. Will fix this in the next release to be named 1.4.0.

NickolajA commented 1 year ago

As testing this, changing to -WindowStyle Hidden removes the actual output. I'll add support for this in the form of a parameter switch for Add-IntuneWin32App, as I assume some people, like myself, would like to see the output from the copy operation.

TheQuiz03 commented 1 year ago

Working as expected in 1.4.0(RC) with the AzCopyWindowStyle parameter.

NickolajA commented 1 year ago

Great, thanks for validating! This will be included in the final release then.