This is part of the Fake.Core.Process module.
CreateProcess
Module for creating and modifying CreateProcess<'TRes> instances. You can manage:
- The command (ie file to execute and arguments)
- The working directory
- The process environment
- Stream redirection and pipes
- Timeout for the process to exit
- The result and the result transformations (
map
,mapResult
)
More extensions can be found in the CreateProcess Extensions
Example
1: 2: 3: 4: |
|
Functions and values
Function or value | Description | ||||
addOnExited f c
Signature: f:('?9315 -> int -> '?9316) -> c:CreateProcess<'?9315> -> CreateProcess<'?9316>
Type parameters: '?9315, '?9316 |
Execute the given function after the process has been exited and the previous result has been calculated. |
||||
addOnFinally f c
Signature: f:(unit -> unit) -> c:CreateProcess<'?9285> -> CreateProcess<'?9285>
Type parameters: '?9285 |
Execute the given function when the process is cleaned up. |
||||
addOnSetup f c
Signature: f:(unit -> '?9282) -> c:CreateProcess<'?9283> -> CreateProcess<'?9283>
Type parameters: '?9282, '?9283 |
Execute the given function before the process is started |
||||
addOnStarted f c
Signature: f:(unit -> unit) -> c:CreateProcess<'?9287> -> CreateProcess<'?9287>
Type parameters: '?9287 |
Execute the given function right after the process is started. |
||||
appendSimpleFuncs(...)
Signature: prepareState:(unit -> '?9278) -> onStart:('?9278 -> Process -> unit) -> onResult:(Async<'?9279> -> '?9278 -> Task<RawProcessResult> -> Async<'?9280>) -> onDispose:('?9278 -> unit) -> c:CreateProcess<'?9279> -> CreateProcess<'?9280>
Type parameters: '?9278, '?9279, '?9280 |
Attaches the given functions to the current CreateProcess instance. |
||||
copyRedirectedProcessOutputsToStandardOutputs(...)
Signature: c:CreateProcess<'?9229> -> CreateProcess<'?9229>
Type parameters: '?9229 |
Copies std-out and std-err into the corresponding |
||||
disableTraceCommand(c)
Signature: c:CreateProcess<'?9233> -> CreateProcess<'?9233>
Type parameters: '?9233 |
Disable the default trace of started processes. |
||||
ensureExitCode(r)
Signature: r:CreateProcess<'?9321> -> CreateProcess<'?9321>
Type parameters: '?9321 |
Makes sure the exit code is |
||||
ensureExitCodeWithMessage msg r
Signature: msg:string -> r:CreateProcess<'?9318> -> CreateProcess<'?9318>
Type parameters: '?9318 |
throws an exception with the given message if |
||||
fromCommand(command)
Signature: command:Command -> CreateProcess<ProcessResult<unit>>
|
Create a simple Example
val ignore : value:'T -> unit
|
||||
fromRawCommand command args
Signature: command:FilePath -> args:seq<string> -> CreateProcess<ProcessResult<unit>>
|
Create a CreateProcess from the given file and arguments Example
val ignore : value:'T -> unit
|
||||
fromRawCommandLine(...)
Signature: command:FilePath -> windowsCommandLine:string -> CreateProcess<ProcessResult<unit>>
|
Create a CreateProcess from the given file and arguments Example
Using BlackFox.CommandLineSee
val ignore : value:'T -> unit
|
||||
fromRawWindowsCommandLine(...)
Signature: command:FilePath -> windowsCommandLine:string -> CreateProcess<ProcessResult<unit>>
Attributes: [<Obsolete("Use fromRawCommandLine instead.")>] |
OBSOLETEUse fromRawCommandLine instead. Create a CreateProcess from the given file and arguments |
||||
getEnvironmentMap(c)
Signature: c:CreateProcess<'?9293> -> EnvMap
Type parameters: '?9293 |
Retrieve the current environment map. |
||||
interceptStream target s
Signature: target:Stream -> s:StreamSpecification -> StreamSpecification
|
intercept the given StreamSpecification and writes the intercepted data into target. Throws if the stream is not redirected (ie is Inherit). |
||||
map f c
Signature: f:('?9303 -> '?9304) -> c:CreateProcess<'?9303> -> CreateProcess<'?9304>
Type parameters: '?9303, '?9304 |
Map the current result to a new type. |
||||
mapFilePath f c
Signature: f:(FilePath -> FilePath) -> c:CreateProcess<'?9239> -> CreateProcess<'?9239>
Type parameters: '?9239 |
Map the file-path according to the given function. |
||||
mapResult f c
Signature: f:('a -> 'b) -> c:CreateProcess<ProcessResult<'a>> -> CreateProcess<ProcessResult<'b>>
Type parameters: 'a, 'b |
Map only the result object and leave the exit code in the result type. |
||||
ofStartInfo(p)
Signature: p:ProcessStartInfo -> CreateProcess<ProcessResult<unit>>
|
Create a CreateProcess from the given |
||||
redirectOutput(c)
Signature: c:CreateProcess<'a> -> CreateProcess<ProcessResult<ProcessOutput>>
Type parameters: 'a |
Starts redirecting the output streams and collects all data at the end. |
||||
replaceFilePath newFilePath c
Signature: newFilePath:FilePath -> c:CreateProcess<'?9237> -> CreateProcess<'?9237>
Type parameters: '?9237 |
Replace the file-path |
||||
setEnvironmentVariable envKey envVar c
Signature: envKey:string -> envVar:string -> c:CreateProcess<'?9295> -> CreateProcess<'?9295>
Type parameters: '?9295 |
Set the given environment variable. |
||||
warnOnExitCode msg r
Signature: msg:string -> r:CreateProcess<unit> -> CreateProcess<unit>
|
Like |
||||
withCommand command c
Signature: command:Command -> c:CreateProcess<'?9235> -> CreateProcess<'?9235>
Type parameters: '?9235 |
Set the command to the given one. |
||||
withEnvironment env c
Signature: env:(string * string) list -> c:CreateProcess<'?9289> -> CreateProcess<'?9289>
Type parameters: '?9289 |
Sets the given environment variables |
||||
withEnvironmentMap env c
Signature: env:EnvMap -> c:CreateProcess<'?9291> -> CreateProcess<'?9291>
Type parameters: '?9291 |
Sets the given environment map. |
||||
withOutputEvents onStdOut onStdErr c
Signature: onStdOut:(string -> unit) -> onStdErr:(string -> unit) -> c:CreateProcess<'a> -> CreateProcess<'a>
Type parameters: 'a |
Calls the given functions whenever a new output-line is received. |
||||
withOutputEventsNotNull(...)
Signature: onStdOut:(string -> unit) -> onStdErr:(string -> unit) -> c:CreateProcess<'?9313> -> CreateProcess<'?9313>
Type parameters: '?9313 |
Like |
||||
withStandardError stdErr c
Signature: stdErr:StreamSpecification -> c:CreateProcess<'?9299> -> CreateProcess<'?9299>
Type parameters: '?9299 |
Set the standard error stream. |
||||
withStandardInput stdIn c
Signature: stdIn:StreamSpecification -> c:CreateProcess<'?9301> -> CreateProcess<'?9301>
Type parameters: '?9301 |
Set the standard input stream. |
||||
withStandardOutput stdOut c
Signature: stdOut:StreamSpecification -> c:CreateProcess<'?9297> -> CreateProcess<'?9297>
Type parameters: '?9297 |
Set the standard output stream. |
||||
withTimeout timeout c
Signature: timeout:TimeSpan -> c:CreateProcess<'a> -> CreateProcess<'a>
Type parameters: 'a |
Set the given timeout |
||||
withWorkingDirectory workDir c
Signature: workDir:string -> c:CreateProcess<'?9231> -> CreateProcess<'?9231>
Type parameters: '?9231 |
Set the working directory of the new process. |