Share via

Intune Win32 App Install Parameters as Array

Anonymous
2022-10-07T20:56:51+00:00

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

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 PS1 script is never actually executed.

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.

Microsoft 365 and Office | Install, redeem, activate | For business | Other

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

2 answers

Sort by: Most helpful
  1. Anonymous
    2022-10-10T05:28:09+00:00

    Unfortunately, I cannot provide you with the final solution.

    But you may want to try the -file parameter of powershell.exe. It partially works for us. This means that the script is executed correctly, but Intune always shows a wrong installation status in the first moment. So we have not yet solved this case conclusively either.

    powershell -executionpolicy bypass -file ".\install.ps1" -i -name "myApp" -variant "2022"
    

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2022-10-08T02:19:09+00:00

    Dear ScriptoPoco

    Good day! Thank you for posting to Microsoft Community. We are happy to help you.

    Based on your description, since our forum is focus on the general troubleshooting issue with office 365 products, such as activate, install. Regarding your query is related to PowerShell.  So please kindly understand that as engineers in here have limited experience in PowerShell, we may not be able to do the test for you and offer further support in a more efficient way. For such a developed scenario, we really hope you can get dedicated assistance to further investigate. Kindly post a thread inIntune- Microsoft Q&A as engineers and community members there are more experienced and professional with this query connected with other server environments. I sincerely hope your question can be addressed by experienced assistance.

    Thank you for your cooperation and understanding into the Microsoft Community. If you need any further assistance, please feel free to post back.

    Sincerely,

    Stacey | Microsoft Community Moderator

    Was this answer helpful?

    0 comments No comments