Hello,
I need to add to our client application the capability to cancel jobs users submit to an HPC cluster on Azure.
To that end, I tried using the following PowerShell statements, which I call from the C# application:
Add-PSSnapin Microsoft.HPC
Get-HPCJob -Scheduler https://myheadnode.cloudapp.net # Used to get the job ids.
Stop-HPCJob -Scheduler https://myheadnode.cloudapp.net -id myJobId
The problem is that the Get-HPCJob and Stop-HPCJob cmdlets require a set of credentials to be provided by the user, which is not suitable for an unattended usage of those statements.
Is there a way to programmatically provide credentials to Get-HPCJob and Stop-HPCJob, as I am able to do when creating the Microsoft.HPC.Scheduler.Session object used to submit the jobs to the cluster?
Thank you.
Marc