I’ve found a roundabout solution to this question because it was also plaguing me. The thing is that it only works if you are running the project from Orchestrator
If you assign your variable to environment.currentdirectory when running off of the Orchestrator, the directory it creates "looks like this:
C: \ Users \ username \ .nuget \ packages \ projectname \ projectversion \ lib \ net45
If you want the process name just use split(environment.CurrentDirectory,"\ ")(5)
If you want the package version just use split(environment.CurrentDirectory,"\ ")(6)
Hope this helps!
(sorry, I am not sure why, but I am having some formatting issues when I try to post this response, the backslashes in the quotes of those split statements shouldn’t have a space after them)