Can someone help me convert the command line below to a powershell script?
setup.exe /silent ISFeatureInstall=Licensing,PlantDesign,PID,Isometric,Isogen,Piping,PCFExport,PDM,PDMUpdate INSTALLDIR=“C:\Program Files (x86)\Cad-Partner” SMAPLANGUAGE=2 SMAPUNITS=2 SMAPCONFIGFOLDER=“C:\Smap3D_PlantDesign” PIDDATAFOLDER=“C:\Smap3D P&ID” SERVERNAME=“Server01” LICENSINGPORT=16001 INSTALLTOOLBARS=“true” ISDEFAULTDATAINSTALL=“true” INSTALLSTANDARDPARTS=“true” /LOG:C:\Windows\Temp\Install_CAD.log
Olaf
2
Have you tried running it as is? You may have to wrap properties with a space in two sets of quotes.
INSTALLDIR='"C:\Program Files (x86)\Cad-Partner"' PIDDATAFOLDER='"C:\Smap3D P&ID"'
Oh cool. There’s a “stop parsing symbol” --% introduced in PS 3. It even changes the syntax colors. Command line arguments for msiexec break on PowerShell if they contain space - Stack Overflow I wish every powershell detail was listed in one place lol.
./setup.exe --% INSTALLDIR="C:\Program Files (x86)\Cad-Partner" PIDDATAFOLDER="C:\Smap3D P&ID"
echo hi | find --% "hi"
[pre]Start-Process “setup.exe” -ArgumentList ‘/silent ISFeatureInstall=Licensing,PlantDesign,PID,Isometric,Isogen,Piping,PCFExport,PDM,PDMUpdate INSTALLDIR=“C:\Program Files (x86)\Cad-Partner” SMAPLANGUAGE=2 SMAPUNITS=2 SMAPCONFIGFOLDER=“C:\Smap3D_PlantDesign” PIDDATAFOLDER=“C:\Smap3D P&ID” SERVERNAME=“Server01” LICENSINGPORT=16001 INSTALLTOOLBARS=“true” ISDEFAULTDATAINSTALL=“true” INSTALLSTANDARDPARTS=“true” /LOG:C:\Windows\Temp\Install_CAD.log’[/pre]
ta11ow
5
Personally, I like to break up arguments:
Start-Process -FilePath "setup.exe" -NoNewWindow -Wait -ArgumentList @(
'/silent ISFeatureInstall=Licensing,PlantDesign,PID,Isometric,Isogen,Piping,PCFExport,PDM,PDMUpdate'
'INSTALLDIR="C:\Program Files (x86)\Cad-Partner"'
'SMAPLANGUAGE=2'
'SMAPUNITS=2'
'SMAPCONFIGFOLDER="C:\Smap3D_PlantDesign"'
'PIDDATAFOLDER="C:\Smap3D P&ID"'
'SERVERNAME="Server01"'
'LICENSINGPORT=16001'
'INSTALLTOOLBARS="true"'
'ISDEFAULTDATAINSTALL="true"'
'INSTALLSTANDARDPARTS="true"'
'/LOG:C:\Windows\Temp\Install_CAD.log'
)
Interesting. I didn’t know you could do that.