Retrieve Script/Job Name & Folder Path

Retrieve Script/Job Name & Folder Path

avatar

Is there a variable to pull the current script name & folder path that it resides in?
I am sending an email on completion of a job, would be nice to include that so that can assist a user who may have a question or request a rerun.

I tried $UAScript - but that did not return anything and the $UAJob did not seem to have a name property.

Product: PowerShell Universal
Version: 5.0.0 RC5 & 4.3.3


avatar

Recommended Answer

This property should include all that info.

$UAJob.ScriptFullPath




d8f121bff89ac68a2e3ce3bb1cbeac54cc27b88e

Adam Driscoll
PowerShell Expert and Developer at Devolutions

d8f121bff89ac68a2e3ce3bb1cbeac54cc27b88e.png

All Comments (3)

avatar

This property should include all that info.

$UAJob.ScriptFullPath




d8f121bff89ac68a2e3ce3bb1cbeac54cc27b88e

Adam Driscoll
PowerShell Expert and Developer at Devolutions

d8f121bff89ac68a2e3ce3bb1cbeac54cc27b88e.png

avatar

Thank you @Adam Driscoll! I overlooked it in the documentation.

avatar

No worries! I actually added this earlier this week, I think, because someone else was also curious. Here’s the whole structure.

docs.powershelluniversal.com

Adam Driscoll
PowerShell Expert and Developer at Devolutions