I'm trying to make this script work which automates App-V 5.0 installation using PowerShell. I'm installing it on Windows Server 2012 R2 With SQL 2012. Whenever it reaches Invoke-Expression $installappv, nothing happens. I can see the setup file start for a few seconds in task manager, but nothing gets installed. Please help.
.\AppVInstall\AppVServer\appv_server_setup.exe /layout
$appvconf = Get-Content .\AppVInstall\AppVServer\AppV_Conf.ini
$appvparameters = $appvconf -join " "
$installappv = ".\AppVInstall\AppVServer\appv_server_setup.exe" + " " + $appvparameters
Invoke-Expression $installappv
This is the contents of the file ".\AppVInstall\AppVServer\AppV_Conf.ini"
/QUIET
/ACCEPTEULA
/MANAGEMENT_SERVER
/MANAGEMENT_ADMINACCOUNT="XXXX.local\XXXXX"
/MANAGEMENT_WEBSITE_NAME="Microsoft App-V Management Service"
/MANAGEMENT_WEBSITE_PORT="80"
/DB_PREDEPLOY_MANAGEMENT
/MANAGEMENT_DB_SQLINSTANCE_USE_DEFAULT
/MANAGEMENT_DB_NAME="AppVManagement"
/PUBLISHING_SERVER /PUBLISHING_MGT_SERVER="testappvsvr.XXXX.local:80";
/PUBLISHING_WEBSITE_NAME="Microsoft AppV Publishing Service"
/PUBLISHING_WEBSITE_PORT="81"
Invoke-Expression
is treating your string like 2 commands because of the semi-colon.Consider the following statements.
Example 1
Example 2
In the first example the semicolon is not escaped or encased in quotes. It is a line terminator in PowerShell so it is treating
'stuff test'
as its own commandstuff
withtest
as an argument. I don't have a cmdlet or exe calledstuff
so I get an error. I think that's what happening to you. A chunk of your parameters are not being sent toappv_server_setup.exe
.In the second example the semicolon is in single quote so the entire string is output on one line.
I don't know if it needs to be there but that semicolon has to be addressed somehow so that
Invoke-Expression
does not see it all by its lonesome.Perhaps you can wrap all the arguments in one set of quotes.