Issue with oneWay Git Sync

Hi all,

I’m setting up PowerShell Universal with OneWay Git Sync (Bitbucket Server / Data Center) and I wanted to clarify expected behaviour around script registration.

Current understanding

From what I can see:

  • Git sync pulls all files into the PSU instance

  • But scripts only appear in the UI if they are explicitly registered in scripts.ps1

  • New .ps1 files added in Git do not automatically get registered as PSU scripts

Question

Is this correct, or is there any hidden behaviour where:

  • scripts.ps1 is auto-generated or auto-populated in OneWay mode?

  • PSU can optionally scan a folder and auto-register scripts without manual entries?

Version 4.3.2

This is correct behavior. When you use the GUI to create a script it modifies the scripts.ps1 file to add that new entry with the path to file, metadata etc.
If you create it outside the GUI you’ll need to modify that file yourself, then refresh the PSU Config (this can be done in the files menu screen).

You could potentially automate that process, for example, have a scheduled script running every x mins that checks for new files in a dir that do not exist in the scripts.ps1, then auto add them and runt he sync-PSUConfiguration command. Though it might be a bit of faff to get that setup properly.

My setup is that in my dev environment we create scripts using the GUI, that gets pushed back to git with two way, on a merge request to our main branch, everything gets pulled into prod and synced.