Skip to content

Instantly share code, notes, and snippets.

@objectx
Created November 22, 2012 14:26
Show Gist options
  • Save objectx/4131424 to your computer and use it in GitHub Desktop.
Save objectx/4131424 to your computer and use it in GitHub Desktop.
Run "vv serv" in background.
$mydir = Split-Path -parent $MyInvocation.MyCommand.Path
$work_dir = [Environment]::GetFolderPath("MyDocuments")
function start_process () {
$veracity = Join-Path $(Get-Item HKLM:\Software\Sourcegear\Veracity).GetValue("InstallPath") "vv.exe"
$processStartInfo = New-Object System.Diagnostics.ProcessStartInfo
$processStartInfo.FileName = $veracity
$processStartInfo.WorkingDirectory = $work_dir
$processStartInfo.UseShellExecute = $false
$processStartInfo.WindowStyle = "Normal"
$processStartInfo.Arguments = "serv"
#return $processStartInfo
$process = [System.Diagnostics.Process]::Start($processStartInfo)
if ($process) {
$global:veracity_pid = $process.Id
}
}
start_process
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment