Hey Guys,
I don’t use powershell much and i am trying to get more familiar with it. I am currently working on a script that needs to install a an agent that communicates to an internal URL. I am trying to make it a silent install and only want the user to see the start and end of the installation. I’ve tried the below variations and they don’t seem to work. Anyone have any simple script they use to do installs or tell me what i am doing wrong on the below syntax?
start-Process “\testpath\msipath\program.msi” /i /qn http://testserver
Error message - Start-Process : A positional parameter cannot be found that accepts argument ‘/qn’.
At line:1 char:1
- Start-Process "path\ …
-
+ CategoryInfo : InvalidArgument: (:) [Start-Process], ParameterBindingException + FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.PowerShell.Commands.StartProcessCommand
2nd script -
Process process = new Process();
process.StartInfo.FileName = “msiexec.exe”;
process.StartInfo.Arguments = string.Format("/qn /i “{0}” ALLUSERS=1","\testpath\msipath\program.msi"-InternalURL http://testserver);
process.Start();
process.WaitForExit();
Error message
At line:1 char:8
- Process process = new Process();
-
~
Missing statement block after ‘process’.
At line:1 char:16
- Process process = new Process();
-
~
Missing statement block after ‘process’.
At line:1 char:9
- Process process = new Process();
-
~~~~~~~
Script command clause ‘process’ has already been defined.
At line:1 char:17
- Process process = new Process();
-
~
Unexpected token ‘=’ in expression or statement.
+ CategoryInfo : ParserError: ( [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : MissingNamedStatementBlock