Scripts in automation and working directories

Currently it seems like all scripts/jobs running in Automation uses the Repository Path as their working directory, which may cause various files to be created if you’re not explicit in your scripts about where to put said files. I presume this could cause a lot of junk with Git Sync.

Could we maybe get an option to specify a working directory for our scripts (potentially with parameters like the jobid), and/or have the default moved to another directory so it isn’t the Repository Path?

Product: PowerShell Universal
Version: 3.0.3
1 Like

I’ve opened an issue for that here: Working directory for scripts · Issue #1267 · ironmansoftware/issues · GitHub

1 Like

I have tried to setup a working directory in version 3.4.5 and 3.5.2 on the script settings page. When I enter the full path or anything in the Working Directory text box, I save settings and the entry is not there.

I tried with both 7.x and 5.1 as the environment
I am running the server as a service using the default local system.
This is using the built in LiteDB.
I turned on the debug logs and cannot see any errors for this issue.

Every attempted run after attempting to set the working directory continues to be the Universal Repository.

Can anyone confirm this is working or have an example of to use the Working Directory feature?

This seems to work for me, but I’d double check that it’s actually set in the scripts.ps1. I noticed it’s not saving from the UI.

1 Like

I think I was having a similar issue in various UIs, when I try to pull up something that should have a stored value, it’s blank. If I come across them while working this week, I’ll try to remember to share here and try to check the associated ps1 file.

1 Like