Syntax errors in script. Please fix before saving

Product: PowerShell Universal
Version: 4.2.21

I generally favor editing my scripts outside of PSU and directly on the filesystem / in VSCode. At least it’s the way I’m working right now until I get a full git deployment setup (currently just pushing back to git manually outside PSU).

Anyway, I noticed that if I modify my script files, and then navigate in the UI to the code, it doesnt update, it’s showing the old version, no matter how many times I refresh. This is problem number 1. There’s no quick way to refresh/reimport the script file, so I generally just copy paste the latest version out of vs code, back into PSU and hit save again, so I don’t end up with the old version overwriting, which I’ve had before.
Also, so that if I come to scheduling the script, it runs the correct version.

Anyway, the last time I tried to do just this, I’m hit with:

image

However there’s no syntax errors in my script, I’m able to run it just fine in vscode, PSU thinks there’s 269.
I even tried deleting all my code and just putting in a basic hello world but then it goes crazy saying I’ve got 4494 syntax errors!

Is there any way of turning this off as I don’t want to have to delete the script and re-add it each time.

Okay… so network issues strike again, something is going on with my F5 load balancer here. I realized if I try this direct on the local server url it’s fine.
Running through the LB upsets the monaco editor I think, I’ll do a bit more troubleshooting to find out whats happening.

So, your load balancer is messing up and inserting invisible junk into the files that PSU is detecting?

With my network setup I’ve had all manner of problems lately. Theres a squid proxy between the server and all outbound connections and an F5 gateway + LB infront of PSU exposing it to internally whitelisted users.

I’m honestly not sure what’s goin on in this case, but it’s 100% related to my F5/squid setup. I can replicate this consistently on the script code page by copy pasting the same code into the editor. On the F5 url it throws syntax errors that don’t exist, while on the internal url it’s fine.

Just doing a quick Google search, and came across this post on Reddit for what sounds like a very similar issue.

Interesting & thanks!
It’s odd. Right now I can manage it, I’m happy to go internally to the /admin path.
Just currently running a live access review campaign through PSU too so can’t do much in the way of troubleshooting either, although I’ll be finishing that in a week or two and then will have plenty of time to go back to basics and do full load testing and try to figure out all the different issues I’ve been having.
I’ve been getting a lot of errors, and other issues when people try to load pages (individual components havent loaded or have thrown errors being ‘unable to render’) - right now we’re managing that by asking users to refresh which generally sorts it.
We thankfully have very good support with F5 so I can also hit them up when I’m in a better place to run through some testing with the config and I’ll keep any threads here updated if I ever get to the bottom of it.

1 Like

No problem. Maybe it’ll help point you all in the right direction.

Good. I don’t have any F5 devices to work with at the moment, so I can’t do any simulating.