I'm trying to write a power shell script to install a service but the service requires an extra command line paramiter passed to it. Im having trouble getting this passed over.
Here is the service installer that uses the parameter;
this.serviceInstaller.ServiceName = string.Format("My brill service {0}",this.Context.Parameters["environment"])
And I have tried passing the paramiter in two ways;
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\InstallUtil.exe "C:\foo\bar.exe /environment:tomtest"
(this gives the error "invalid directory on url")
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\InstallUtil.exe /environment:tomtest "C:\foo\bar.exe"
(this just dosent change the service name)
Any ideas? Thanks
I was very close. An equals sign =
has to be used to assign the value of the parameter (not a colon :
):
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\InstallUtil.exe /environment=tomtest "C:\foo\bar.exe"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With