Start a new topic
Solved

Add-VaultJob Sample

Hi 


Is there a sample powerJob which adds new jobs using Add-VaultJob?


This is my code


 

$job = Add-VaultJob -Name "Temperzone.Export.LDV_STEP" -Parameters @{"FileId"=$($powerJobs.Job.Params["FileId"]);"EntityId"=$($powerJobs.Job.Params["EntityId"]);"EntityClassId"=$($powerJobs.Job.Params["EntityClassId"])} -Description "Export STEP file for LDV"

 


When I try to use it I get this error, so 

  

System.Management.Automation.CommandNotFoundException: The term 'Add-VaultJob' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
   at System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable input)
   at System.Management.Automation.Runspaces.Pipeline.Invoke()
   at coolOrange.PowerJobs.JobHandler.Powershell.Pipeline.Execute(String script)
2017-09-11 12:23:03,936 [14] ERROR coolOrange.PowerJobs.JobHandler.Powershell.PipelineExtension - The term 'Add-VaultJob' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
System.Management.Automation.CommandNotFoundException: The term 'Add-VaultJob' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
   at System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable input)
   at System.Management.Automation.Runspaces.Pipeline.Invoke()
   at coolOrange.PowerJobs.JobHandler.Powershell.Pipeline.Execute(String script)
   at coolOrange.PowerJobs.JobHandler.JobRunner.<>c__DisplayClass2.<RunJob>b__0(IPipeline pipeline)
   at coolOrange.PowerJobs.JobHandler.Powershell.PipelineExtension.ExecuteSecure(IPipeline pipeline, Action`1 action)


Thanks

 

Nick


Hi Nick 

This works for me: 

$job = Add-VaultJob -Name "Sample.CreatePDF" -Parameters @{"EntityId"=$($file.'MasterId');"EntityClassId"=$($file.'Entity Type ID')} -Description "Job for creating PDF" 


BR 

Rasmus

Hello Nick,
the error message means that there is no Add-VaultJob function available in your current Powershell runspace. This is probably due to an outdated powerVault version. The Add-VaultJob commandlet was added in version 18.0.10

You can grab the update from our website. It is also part of the latest powerJobs version.


The documentation can be found here: https://www.coolorange.com/wiki/doku.php?id=powervault:code_reference:commandlets:add-vaultjob


Best regards

----------------------------

Thomas Rossmeisl

Technical Support

 

Please mark your thread as solved if your question was answered


Thomas


Thanks for that information - I was running 18.0.6 


Rasmus


Thanks for the code - it worked perfectly


Nick

Login or Signup to post a comment