dsccommunity / xDhcpServer

This module contains DSC resources for deployment and configuration of Microsoft DHCP Server.
MIT License
26 stars 33 forks source link

parallelism using ps7 #71

Closed rismoney closed 2 years ago

rismoney commented 3 years ago

Is it possible to create dhcp reservations using this, in a parallel based approach? If I have 1000s of reservations, I don't want the CRUD operations to be individually handled, but rather threaded.

Any advice on this would be great!

gaelcolas commented 3 years ago

Not natively, no. If you want to do this multithreaded, you'd have to either:

rismoney commented 3 years ago

Custom resource? I don't think that's a good idea. If anything, we should make the existing one better.

So for the latter approach, you're saying I would potentially be able to something like-

foreach ($reservation in $reservation_list) -parallel {
$test-result = Invoke-DscResource -Name xDhcpServerReservation, -method Test -Property
@{
  key1=$reservation.key1
}
if (!($test-result))
  {  # call set }
}
gaelcolas commented 3 years ago

If you do not manage a single resource but a list, you manage a set of reservations... So it would be a different DSC resource, not updating the existing one. Hopefully it would share some of the code/functions though. Yes, that's the theory for PS7, but I haven't tested that for this resource...

johlju commented 2 years ago

Closing this as the resource cannot support this, but instead the tool using the resource.