installationmdmintune

Intune Win32 App Install Parameters Array


I have some powershell who has the following: Param([Parameter(Mandatory = $true)] $TargetPaths=@()) I bundle this .ps1 into a .intunewin with content manager and upload to intune.

I now wanted to call my powershell with an install command similar to powershell -executionpolicy bypass -command .\powershell.ps1 -TargetPaths @('1','2','3'...) This works fine on my local machine... but does not pass through the intune installer, my log files are never created and after careful examination it is clear the script is never run.

Can anyone advise me on moving forward to get this to run? If I execute the script locally with the same parameters it works fine. I even re-jiggered it to work through a cmd execution instead of powershell (including the use of """ for a single double quote) and couldn't get this working.


Solution

  • While not really an answer to the question, I was able to work around the problem of passing an array by instead flattening the entire thing into a string on parameter pass and later breaking it into an array inside my code. In order to do this I removed all internal quotation marks and then assumed their location later. Not really the most elegant but the script now executes.