locked
SetHoldUntil via Powershell RRS feed

  • Question

  • Using the Microsoft.HPC PsSnapin, is there anyway (using objects after the fact or not) to hit the SetHoldUntil method of the Job? For example, if we use "$Job = New-HpcJob ....." to create the Job and "Add-HPCTask -Jobid $Job.id...." to add task(s), and then "Submit-HpcJob -Id $Job.ID...." to submit it - how can I possibly hit the SetHoldUntil method?  It does not appear to be part of the snap in, which leads to the possibility that I would need to do it via Powershell .Net New-Object.

    One thought was to use the New-HPCJob, and Add all the task, but before Submit-HpcJob, to open a new session with :

    $HPC = New-Object -TypeName Microsoft.Hpc.Scheduler.Scheduler
    $HPC.Connect($HeadNode)

    and somehow try to do $NJob = $HPC.OpenJob($Job.ID)

    and then call $NJob.SetHoldUntil( .. Now() + 1hr...)  - but I seem to be messing up the objects.

    Does anyone know if this is possible (and how?) - or do I need to write my own Powershell wrapper for this one item?

    Thursday, August 28, 2014 9:27 PM

All replies