FriendsOfMDT / PSD

PowerShell Deployment
MIT License
525 stars 83 forks source link

PSDStart.ps1 - $deployRoot incorrectly called instead of $tsenv:DeployRoot #158

Open jetski28 opened 5 months ago

jetski28 commented 5 months ago

I was having an issue with a connection to our server due to an SSL certificate being invalid as the computer time was incorrect. I thought I would implement a NTP sync before PSD started but noticed that it is built into PSDStart script but checking the logs there was no logs of the NTP sync ever executing.

At the beginning of PSDStart.ps1 I see that $deployRoot is the local deploy root directory And $tsenv:DeployRoot becomes the deploy root network location.

As I was looking (Line 600 onwards) at how the NTP Sync portion of the PSDStart script was executed I noticed the IF statements (especially on 608) is checking if $deployRoot is like https://* but the log written on Line 598 shows that $deployRoot is X:\Deploy. This variable is far from a Deploy Root URL.

My understanding would be that the NTP Sync (Line 600 to 627) IF statements should be validating based on $tsenv:DeployRoot and similar IF statements are also found between Lines 532 & 577 when testing network connections.

Or should $deployRoot = $tsenv:DeployRoot be moved outside of the ELSE statement on line 517.