The product code below was from here Start-Process -FilePath msiexec.exe -ArgumentList X6BD53F08-57BA-4CF1-94B0-F08151E41383, qn, norestart -Wait Are there any glaringobvious omissionsmistakes on my part Thanks, Ronan.Press question mark to learn the rest of the keyboard shortcuts Log in sign up User account menu 8 Question About Scripting Msiexec.Exe Commands.For example, in batch file im able to do this following: msiexec.exe i NameOfInstaller.msi quiet and life is perfectly good.
Powershell Start Process Msiexec Full Path InNow little by little im learning to adapt to PS, and in these adaptations ive come to find that this works start-process msiexec.exe -wait -argumentlist i FullPathToInstallerNameOfInstaller.msi quiet I have two questions: Is this the best way to do this, or can someone else advise me on a better way 2)Is there anyway to not have to type out the full path in -argumentlist I know that outside of that im able to put.
Powershell Start Process Msiexec Code Below WasPowershell has built in variables for determining the script root. PSScriptRoot for v3 and split-path -parent MyInvocation.MyCommand.Definition for v2.) I would fully qualify misexec with the environment variable since it cost nothing, and just in case the OS is installed to another Drive than C:, its got you covered. Report Save level 2 3 years ago pretty much the definitive guide right here. As the path variable holds the system32, the executable should be found. And id your running on a 64-bits, you got a SysWow64msiexec.exe to. Report Save level 2 3 years ago I avoid x86 processes like the plague where possible. Even if powershell is called by a 32-bit process, i flip it right back by invoking x64 powershell.exe. PSHOME -like syswow64). Powershell Start Process Msiexec 64 Bits Can CaseAlways flipping to powershell 64 bits can case problens with 32 bits applications. Just keep that in mind. Report Save level 1 3 years ago edited 3 years ago This is what I use to install MSIs, you will need to give it the proper path to the location of the MSI itself. Pretty good stuff. Report Save level 1 3 years ago Uh, why not run exactly the same command you use in batch, in PS Should work. Report Save level 2 Original Poster 3 years ago Yeah.I was optimistic of that at first too:( 1 share Report Save level 2 Original Poster 3 years ago Im sorry I meant to specify. I deploy this script as an sccm application and I needed a way for it to wait until this command line finished before moving on. Thus my attempt to make it start and wait. Report Save level 2 Original Poster 3 years ago I have been advised in the past to simply pipe it to an out-null cmdlet, but I was concerned that would give false return codes. Report Save Continue this thread View entire discussion ( 13 comments) More posts from the PowerShell community Continue browsing in rPowerShell rPowerShell PowerShell is a cross-platform (Windows, Linux, and macOS) automation tool and configuration framework optimized for dealing with structured data (e.g. JSON, CSV, XML, etc.), REST APIs, and object models. PowerShell includes a command-line shell, object-oriented scripting language, and a set of tools for executing scriptscmdlets and managing modules. Members 659 Online Created Nov 1, 2008 Join help Reddit App Reddit coins Reddit premium Reddit gifts about careers press advertise blog Terms Content policy Privacy policy Mod policy Reddit Inc 2020. All rights reserved Back to top.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |