Comments (3)
It is building an argument list, but it is joining them all together immediately. ( -join ' ' ) .
But the password alone is not the argument, it is SERVERPASS=PASSWORD
.. I don't know if you can get away with SERVERPASS=
PASSWORD
as two arguments.
from labtech-powershell-module.
Upon further inspection, the problem is more about escaping double quotes in MSI parameters, and not escaping them for the command line.
$ServerPassword = 'Hello"world'
"SERVERPASS=""$ServerPassword"""
SERVERPASS="Hello"world"
This makes msiexec unable to parse the command line, and if we were to be in an interactive session, pops up the help dialog.
I think the solution instead is a $ServerPassword = $ServerPassword.Replace('"','""') on the preceding line
As an aside, TIL I put entirely too much faith in Start-Process handling of -ArgumentList when it is an array.
I naively assumed it was scanning for spaces in each array item and wrapping it in double quotes if found.
This is not the case.
Start-Process -Wait msiexec -ArgumentList "/i","C:\Mimecast for Outlook 7.9.0.79 (x64).msi","/qn"
Fails in the same mode as above, however
Start-Process -Wait msiexec -ArgumentList "/i","`"C:\Mimecast for Outlook 7.9.0.79 (x64).msi`"","/qn"
Works as expected.
from labtech-powershell-module.
Related Issues (16)
- server address fails with piped address list HOT 1
- Stack Overflow Exceptions HOT 1
- Feature Request: Support For Proxy HOT 2
- Date conversion not working outside of US Date Formats - Breaks Command HOT 2
- .NET 3.5 Install Check Error Handling HOT 1
- Reset-LTService removes the location ID by mistake HOT 3
- Server Password WIth Special Chars
- Hide/Show-LTAddRemove HOT 3
- Agent_Uninstall.exe doesn't exit on Windows 7 when PSRemoting
- 64-bit OS Detection causing script to fail on ARM processors (Surface Pro X) HOT 6
- ReInstall-LTService function fails to install HOT 4
- Update Documentation to reflect use of Installer Token
- PowerShell 7 (x64) error HOT 2
- Could not create SSL/TLS secure channel HOT 5
- If LT Server Discovered by Script No Longer Exists, Fallback to Amazon AWS uninstaller fails
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from labtech-powershell-module.