diff --git a/playbook/shopfloor-setup/gea-shopfloor-cmm/scripts/Install-goCMMSettings.ps1 b/playbook/shopfloor-setup/gea-shopfloor-cmm/scripts/Install-goCMMSettings.ps1 index acabff1..e7e8a3a 100644 --- a/playbook/shopfloor-setup/gea-shopfloor-cmm/scripts/Install-goCMMSettings.ps1 +++ b/playbook/shopfloor-setup/gea-shopfloor-cmm/scripts/Install-goCMMSettings.ps1 @@ -54,9 +54,18 @@ $DefaultRewrites = @( # already-correct FQDN maps to itself). Disabled by -NoDefaultRewrite. $PartGroupHostShort = 'tsgwp00525' $PartGroupHostFqdn = 'tsgwp00525.wjs.geaerospace.net' -# \\HOST or \\HOST.any.domain (followed by the next path backslash) -> \\FQDN -$PartGroupHostRx = '(?i)\\\\' + [regex]::Escape($PartGroupHostShort) + '(?:\.[A-Za-z0-9.\-]+)?(?=\\)' -$PartGroupHostTo = '\\' + $PartGroupHostFqdn +# \\HOST or \\HOST.any.domain PLUS the \shared share segment (any case) -> +# the exact canonical \\FQDN\SHARED. The share segment case MUST be normalized +# too, not just the host: goCMM matches the registry 'Selected Part Group' +# against the ApplicationSettings.xml with a CASE-SENSITIVE +# string compare (PartGroupViewModel: Find(pg => pg.FullName == regValue)). If +# only the host were fixed, the xml kept '\shared' (lowercase, as captured) while +# the override/09-Setup form is '\SHARED' (uppercase) -> Find returns null -> +# SelectedPartGroup null -> goCMM enumerates nothing -> EMPTY parts list even +# though the bay can reach the share. Match the whole host+share span and pin +# both to '\\tsgwp00525.wjs.geaerospace.net\SHARED'. Idempotent. +$PartGroupHostRx = '(?i)\\\\' + [regex]::Escape($PartGroupHostShort) + '(?:\.[A-Za-z0-9.\-]+)?\\shared(?=\\|$)' +$PartGroupHostTo = '\\' + $PartGroupHostFqdn + '\SHARED' $ErrorActionPreference = 'Continue' $ts = Get-Date -Format 'yyyyMMdd-HHmmss' $logDir = 'C:\Logs\CMM'