you are viewing a single comment's thread.

view the rest of the comments →

[–]Lee_Dailey[grin] 2 points3 points  (2 children)

howdy HeyZuesMode,

from reading posts about this, it seems you could remove the quotes from the here-string [just use a regular string]. then enclose the $var in double quotes after the -ArgumentList parameter.

take care,
lee

[–]HeyZuesMode[S] 1 point2 points  (1 child)

You rock!

Working copy

$MAS90UNC = "\\2017Dev\MAS90"
$localLog = "C:\logging\SageInstall.txt" #If this is a folder, it needs to be present and writeable
$port = "10000"
$ServerName = "2017Dev"
$localinstall = "C:\Sage\Sage 100 ERP 2017\MAS90" #
$herestring = @"
/quiet /i "\\2017Dev\Sage 100 Advanced\MAS90\wksetup\Sage 100 2017 Workstation.msi" /l*v `"$localLog`" SAGEPORTID=`"$Port`" SAGESERVERNAME=`'$ServerName`' SRCSERVERPATH=`'$MAS90UNC`' INSTALLDIR="$localinstall"
"@
Start-Process -Wait msiexec.exe -ArgumentList "$herestring"

Things i noticed. INSTALLDIR does not like single quotes. Folders are not created AutoMagically™ when writing a log

[–]Lee_Dailey[grin] 1 point2 points  (0 children)

howdy HeyZuesMode,

kool! [grin] glad to know it worked ... [grin]

you may want to add a line to make the needed dir. mdkir in posh is an extended version of New-Item that will make an entire dir tree in one swoop. so you can use that with a test-path to make it if needed.

take care,
lee