Start multiple processes
Description
This example shows how you can use the ProcessSet
composite resource to ensure multiple processes
are running.
With Ensure set to Present
and Path set to the array of C:\Windows\System32\cmd.exe
and
C:\TestPath\TestProcess.exe
, the resource starts cmd.exe
and TestProcess.exe
without any
arguments if they're not already running.
With Invoke-DscResource
The Invoke-DscResource
cmdlet doesn't support invoking composite resources. Instead, use the
WindowsProcess resource.
With a Configuration
This snippet shows how you can define a Configuration
with a ProcessSet
resource block to ensure
the cmd.exe
and TestProcess.exe
processes are running.
Configuration Start {
Import-DscResource -ModuleName 'PSDscResources'
Node localhost {
ProcessSet ExampleProcessSet {
Path = @(
'C:\Windows\System32\cmd.exe'
'C:\TestPath\TestProcess.exe'
)
Ensure = 'Present'
}
}
}
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for