Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var proc = new Process
- {
- StartInfo = new ProcessStartInfo
- {
- FileName = PowerShellExe,
- UseShellExecute = false,
- RedirectStandardOutput = true,
- RedirectStandardError = true,
- CreateNoWindow = true,
- WorkingDirectory = workingDirectory,
- Arguments = string.Concat(string.Format(@" -File ""{0}"" ", fullPathToFile), commandLineArguments)
- },
- EnableRaisingEvents = true
- };
- <rabbitMQ messageBusURI="rabbitmq://localhost/" messageBusUserName="guest" messageBusPassword="guest" purgeOnStartup="true" timeout="00:00:30" />
- <rabbitMQ messageBusURI=rabbitmq://localhost messageBusUserName=guest messageBusPassword=guest purgeOnStartup=false timeout=00:00:30 />
- param(
- [string]$FilePath = $Args[0],
- [string]$RegEx = $Args[1],
- [string]$ReplacementValue = $Args[2]
- )
- cls
- (get-content $FilePath) | foreach-object {$_ -replace $RegEx,$ReplacementValue} | set-content $FilePath
- " -FilePath "MyService.exe.config" -RegEx "<rabbitMQ messageBusURI=[^\>]*>" -ReplacementValue "<rabbitMQ messageBusURI="rabbitmq://localhost" messageBusUserName="guest" messageBusPassword="guest" purgeOnStartup="false" timeout="00:00:30" />" "
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement