PSD icon indicating copy to clipboard operation
PSD copied to clipboard

PSDeployRoots variable not defined in PSDStart.ps1

Open Articulus22 opened this issue 10 months ago • 7 comments

I just set up a new deployment server using ver 0.2.3.0 and came across an issue where network access validation fails. It appears the PSDeployRoots variable is empty/missing.

Image

Looking at the log, I can see the properties from .ini get picked up by Get-PSDSettings

<![LOG[Get-PSDSettings: Changing property UserDomain to MDTPS01W, was Empty]LOG]!><time="... <![LOG[Get-PSDSettings: Changing property UserID to MDTDeploy, was Empty]LOG]!><time="... <![LOG[ Message containing password has been suppressed ]LOG]!><time="... <![LOG[Get-PSDSettings: Changing property PSDDeployRoots PSDDeployRoots to "https://mdtps01w/psdeploy", was Empty]LOG]!><time="... <![LOG[Invoke-PSDRule: Processing rule Default]LOG]!><time="... <![LOG[Get-PSDSettings: Changing property PSDDebug to NO, was Empty]LOG]!><time="... <![LOG[Get-PSDSettings: Changing property SkipBDDWelcome to NO, was Empty]LOG]!><time="... <![LOG[Get-PSDSettings: Changing property PSDPrestartPosition to VerticalRight, was Empty]LOG]!><time="... <![LOG[Get-PSDSettings: Changing property PSDPrestartMode PSDPrestartMode to PrestartMenu, was Empty]LOG]!><time="...

But during validation, the property is missing:

<![LOG[PSDStart.ps1: We have at least one network adapter with an IP address, continuing...]LOG]!><time="... <![LOG[PSDStart.ps1: Looking for PSDeployRoots in the usual places...]LOG]!><time="... <![LOG[PSDStart.ps1: Validating network access to ]LOG]!><time="... <![LOG[PSDStart.ps1: Since we are deploying from network, we should be able to access the deploymentshare, but we can't, please check your network.]LOG]!><<time="...

I tested ver 0.2.3.0 in multiple environments (domain, workgroup, sandboxed) with the same results.

Ver 0.2.2.9 appears to function as intended.

Articulus22 avatar Mar 13 '25 20:03 Articulus22

I'm having similar issues. I read in one of PowerShellCrack's responses on another issue thread to switch back to DeployRoot rather than PSDDeployRoots. This worked for me, but I am still having a ton of issues getting PSD to load a bunch of my customsettings variables so take this as a grain of salt.

evanpelton avatar Mar 14 '25 13:03 evanpelton

The log does stated is changed PSDDeployRoot to the url from empty, but not seeing anything in the log that stands out.

Are you using the provided .ini files? My advice is: Don't use ones from other PSD or MDT. Just add the rules you want. Start simple and don't try to highly customize it.

PowerShellCrack avatar Mar 14 '25 17:03 PowerShellCrack

I did use the included .ini files with only the necessary properties changed for connectivity. I even set up a test server in a workgroup and sandboxed environment to ensure there were no security policies that could affect the server. Script execution was set to Unrestricted. Received the same results which prompted me to open up this issue.

When I tested v0.2.2.9 with the same .ini files, this is what the logs look like with successful validation:

<![LOG[PSDStart.ps1: We have at least one network adapter with an IP address, continuing...]LOG]!><time="... <![LOG[PSDStart.ps1: Looking for PSDeployRoots in the usual places...]LOG]!><time="... <![LOG[PSDStart.ps1: Property PSDeployRoots exists.]LOG]!><time="... <![LOG[PSDStart.ps1: Testing PSDDeployRoots value: https://mdtps01w/psdeploy]LOG]!><time="... <![LOG[PSDStart.ps1: Validating network access to https://mdtps01w/psdeploy]LOG]!><time="... <![LOG[PSDStart.ps1: New deploy root is X:\Deploy.]LOG]!><time="... <![LOG[Get-PSDConnection: PowerShell variable global:psddsDeployRoot is now = https://mdtps01w/psdeploy]LOG]!><time="... <![LOG[Get-PSDConnection: PowerShell variable global:psddsDeployUser is now = MDTPS01W\MDT_BA]LOG]!><time="... <![LOG[<Message containing password has been suppressed>]LOG]!><time="... <![LOG[Get-PSDContentWeb: Retrieving directory listing of https://mdtps01w/psdeploy/Control via WebDAV.]LOG]!><time="... <![LOG[Get-PSDContentWeb: Attempt 1 of 3]LOG]!><time="... <![LOG[Get-PSDContentWeb: Directory listing retrieved with 24 items.]LOG]!><time="...

In v0.2.2.9, the script defines the PSDeployRoots property, tests/validates access and then proceeds to connect using the provided credentials in the .ini.

Articulus22 avatar Mar 16 '25 14:03 Articulus22

i just posted this. can you follow it and see if it works: https://github.com/FriendsOfMDT/PSD/issues/224

PowerShellCrack avatar Mar 16 '25 18:03 PowerShellCrack

Appreciate your help, thanks!

Re-downloading the zip file and starting from scratch worked and I think I may have found the issue that caused my deployments to fail repeatedly.

After the initial failure, I wiped out the deployment share and re-ran the install script from the extracted files. Every subsequent attempt to get it working kept failing. Once I used the -Verbose parameter, an exception was thrown about not being able to find the path to ZTIGather.xml.

Took a closer look at Install-PSD.ps1 and found that ZTIGather.xml is moved rather than copied which caused subsequent attempts to fail.

Install-PSD.ps1 411 # Copy ZTIGather.XML to correct folder 412 Write-PSDInstallLog -Message "Adding ZTIGather.XML to correct folder" 413 Move-Item -Path "$PSScriptRoot\Scripts\ZTIGather.xml" -Destination "$psDeploymentFolder\Tools\Modules\PSDGather" -Force

Articulus22 avatar Mar 18 '25 23:03 Articulus22

I'm glad you found the issue though and was able to resolve it.

Awesome catch! This may be a bug we need to look into.

@GeoSimos can we post this as bug and maybe we can easily change it to copy instead of move.

PowerShellCrack avatar Mar 19 '25 00:03 PowerShellCrack

I am also having same issue on latest version; it works fine on previous version. but on latest one it is not taking value from the bootstrap file. it takes default value.

vrajesh99 avatar Apr 21 '25 13:04 vrajesh99