Install batch file from powershell

Manuel Muñoz Soria 0 Reputation points
2025-08-03T11:11:43.35+00:00

Hello Community!

I'm going mad last few days, trying to run this batch file from PS, or convert it natively so it can run on PowerShell script, it is all to be installed via inTune

This is the batch file:

@echo off

certutil -addstore "TrustedPublisher" Mediaocean.cer

msiexec /i "https://moinstaller.mediaocean.com/MOInstaller/DDSShell64/DDSShell64.msi" /qn /norestart

msiexec /i "https://moinstaller.mediaocean.com/MOInstaller/MOFramework/MOFramework.msi" /qn /norestart

Any advice you can give me would be much appreciated!

Windows for business | Windows Server | User experience | PowerShell
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. MotoX80 36,536 Reputation points
    2025-08-03T12:49:02.7633333+00:00

    The only non-powershell statement is the echo. I would recommend logging a transcript file that you can then review for errors. Certutil will write to stdout so that will be logged into the transcript.

    But msiexec will not write to stdout, so you should add logging to the command line parameters.

    start-transcript -path $env:systemroot\temp\MyScript.log
    certutil -addstore "TrustedPublisher" Mediaocean.cer
    msiexec /i "https://moinstaller.mediaocean.com/MOInstaller/DDSShell64/DDSShell64.msi" /qn /norestart /lv $env:systemroot\temp\MyScript-msi-1.log
    msiexec /i "https://moinstaller.mediaocean.com/MOInstaller/MOFramework/MOFramework.msi" /qn /norestart /lv $env:systemroot\temp\MyScript-msi-2.log
    stop-transcript 
    

    Then if something doesn't work, you have the 3 log files in C:\windows\temp that you can review for errors.


Your answer

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