Need PowerShell Script for installer

TechUST 616 Reputation points
2024-08-27T22:46:47.37+00:00

I have two EXE installers, and I need to package them using PowerShell and deploy them through Intune. Please help me create the script

1- Canon ImageRunner Advance.exe - When we click on this EXE, a folder named 'Canon' gets created, and two folders, x86 and x64, are generated. I need to deploy the x64 version. Please suggest a PS1 script that I can use to install it silently. also during installation need languange -english

User's image

Under X64 folder

User's image

I need to package the x64 version with PowerShell for installation

2- OpenJDK.msi

Need PowerShell script for installation

I tried this but not working

# Define the path to the MSI file

$msiPath = ".\OpenJDK.msi"

# Check if the MSI file exists

if (Test-Path $msiPath) {

**# Install the MSI file**

**Start-Process msiexec.exe -ArgumentList "/i `"$msiPath`" /quiet /norestart" -Wait**

**Write-Output "Installation completed successfully."**
```**} else {**

```yaml
**Write-Output "The MSI file was not found at $msiPath."**
```**}**

Windows for business | Windows Server | User experience | PowerShell
Microsoft Security | Intune | Other
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Anonymous
    2024-08-28T02:23:06.9833333+00:00

    Hi,

    Did you run the script as administrator? I ran the command Start-Process msiexec.exe -ArgumentList "/i `"$msiPath`" /quiet /norestart" -Wait in an elevated PowerShell windows and it installed Microsoft Build of OpenJDK as expected.

    To run the Canon setup.exe silently, you have to make sure it is supported to be installed through command line. Run setup.exe /? to see if there are any install parameters.

    Best Regards,

    Ian Xue


    If the Answer is helpful, please click "Accept Answer" and upvote it.


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.