Add comprehensive documentation and update deployment paths
Documentation: - Add ShopDB-API.md with full API reference (all GET/POST endpoints) - Add detailed docs for Update-ShopfloorPCs-Remote, Invoke-RemoteMaintenance, Update-PC-CompleteAsset - Add DATA_COLLECTION_PARITY.md comparing local vs remote data collection - Add HTML versions of all documentation with styled code blocks - Document software deployment mechanism and how to add new apps - Document deprecated scripts (Invoke-RemoteAssetCollection, Install-KioskApp) Script Updates: - Update deployment source paths to network share (tsgwp00525.wjs.geaerospace.net) - InstallDashboard: \\...\scripts\Dashboard\GEAerospaceDashboardSetup.exe - InstallLobbyDisplay: \\...\scripts\LobbyDisplay\GEAerospaceLobbyDisplaySetup.exe - UpdateEMxAuthToken: \\...\scripts\eMx\eMxInfo.txt - DeployUDCWebServerConfig: \\...\scripts\UDC\udc_webserver_settings.json - Update machine network detection to include 100.0.0.* for CMM cases - Rename PC Type #9 from "Part Marker" to "Inspection" Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -622,9 +622,23 @@ function Get-PCType {
|
||||
|
||||
# ================================================================
|
||||
# PC Type Detection based on installed software
|
||||
# Priority: CMM > Wax Trace > Keyence > EAS1000 > Genspect > Heat Treat > Shopfloor
|
||||
# Priority: Dashboard > Lobby Display > CMM > Wax Trace > Keyence > EAS1000 > Genspect > Heat Treat > Shopfloor
|
||||
# ================================================================
|
||||
|
||||
# Dashboard Detection (GE Aerospace Dashboard kiosk installer) - HIGHEST PRIORITY
|
||||
$hasDashboard = $installedApps -match "^GE Aerospace Dashboard"
|
||||
if ($hasDashboard) {
|
||||
Write-Host " [OK] Dashboard software detected - Dashboard PC" -ForegroundColor Cyan
|
||||
return "Dashboard"
|
||||
}
|
||||
|
||||
# Lobby Display Detection (GE Aerospace Lobby Display kiosk installer)
|
||||
$hasLobbyDisplay = $installedApps -match "^GE Aerospace Lobby Display"
|
||||
if ($hasLobbyDisplay) {
|
||||
Write-Host " [OK] Lobby Display software detected - Lobby Display PC" -ForegroundColor Cyan
|
||||
return "Lobby Display"
|
||||
}
|
||||
|
||||
# CMM Detection: PC-DMIS, goCMM, DODA
|
||||
$hasPcDmis = $installedApps -match "PC-DMIS|PCDMIS"
|
||||
$hasGoCMM = $installedApps -match "^goCMM"
|
||||
@@ -707,23 +721,23 @@ function Get-PCType {
|
||||
return "Heat Treat"
|
||||
}
|
||||
|
||||
# Part Marker Detection: By machine number (0612, 0613, 0615, 8003) or software
|
||||
# Inspection Detection: By machine number (0612, 0613, 0615, 8003) or software
|
||||
$machineNo = Get-GEMachineNumber -Hostname $env:COMPUTERNAME
|
||||
$isPartMarkerMachine = $false
|
||||
if ($machineNo) {
|
||||
# Check if machine number matches Part Marker machines (0612, 0613, 0615, 8003)
|
||||
# Check if machine number matches Inspection machines (0612, 0613, 0615, 8003)
|
||||
if ($machineNo -match "^0?(612|613|615|8003)$" -or $machineNo -match "^M?(612|613|615|8003)$") {
|
||||
$isPartMarkerMachine = $true
|
||||
Write-Host " [OK] Part Marker machine detected (Machine #$machineNo) - Part Marker PC" -ForegroundColor Cyan
|
||||
return "Part Marker"
|
||||
Write-Host " [OK] Inspection machine detected (Machine #$machineNo) - Inspection PC" -ForegroundColor Cyan
|
||||
return "Inspection"
|
||||
}
|
||||
}
|
||||
|
||||
# Also check for Part Marker software
|
||||
# Also check for Inspection software
|
||||
$hasPartMarker = $installedApps -match "Part\s*Mark|PartMark|Telesis|MECCO|Pryor|Gravotech|SIC Marking"
|
||||
if ($hasPartMarker) {
|
||||
Write-Host " [OK] Part Marker software detected - Part Marker PC" -ForegroundColor Cyan
|
||||
return "Part Marker"
|
||||
Write-Host " [OK] Inspection software detected - Inspection PC" -ForegroundColor Cyan
|
||||
return "Inspection"
|
||||
}
|
||||
|
||||
return "Shopfloor"
|
||||
@@ -886,6 +900,137 @@ function Collect-SystemInfo {
|
||||
$systemInfo.TrackedApplications = @()
|
||||
}
|
||||
|
||||
# ================================================================
|
||||
# Collect serial port configuration (for parity with remote script)
|
||||
# ================================================================
|
||||
Write-Host " Collecting serial port configuration..." -ForegroundColor Yellow
|
||||
try {
|
||||
$comPorts = @()
|
||||
$serialPorts = Get-CimInstance -ClassName Win32_SerialPort -ErrorAction SilentlyContinue
|
||||
foreach ($port in $serialPorts) {
|
||||
$comPorts += @{
|
||||
PortName = $port.DeviceID
|
||||
Description = $port.Description
|
||||
}
|
||||
Write-Host " Found COM port: $($port.DeviceID) - $($port.Description)" -ForegroundColor Gray
|
||||
}
|
||||
$systemInfo.SerialPorts = $comPorts
|
||||
if ($comPorts.Count -eq 0) {
|
||||
Write-Host " No serial ports found" -ForegroundColor Gray
|
||||
} else {
|
||||
Write-Host " [OK] Found $($comPorts.Count) serial port(s)" -ForegroundColor Cyan
|
||||
}
|
||||
}
|
||||
catch {
|
||||
Write-Host " [WARN] Failed to collect serial ports: $($_.Exception.Message)" -ForegroundColor Yellow
|
||||
$systemInfo.SerialPorts = @()
|
||||
}
|
||||
|
||||
# ================================================================
|
||||
# Check for VNC installation (for parity with remote script)
|
||||
# ================================================================
|
||||
Write-Host " Checking for VNC installation..." -ForegroundColor Yellow
|
||||
try {
|
||||
$hasVnc = $false
|
||||
$regPaths = @(
|
||||
"HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*",
|
||||
"HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*",
|
||||
"HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*"
|
||||
)
|
||||
foreach ($path in $regPaths) {
|
||||
if (Test-Path $path) {
|
||||
$vncApps = Get-ItemProperty $path -ErrorAction SilentlyContinue |
|
||||
Where-Object { $_.DisplayName -like "*VNC Server*" -or $_.DisplayName -like "*VNC Connect*" -or $_.DisplayName -like "*RealVNC*" }
|
||||
if ($vncApps) {
|
||||
$hasVnc = $true
|
||||
Write-Host " [OK] VNC software detected in registry" -ForegroundColor Cyan
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
if (-not $hasVnc) {
|
||||
$vncService = Get-Service -Name "vncserver*" -ErrorAction SilentlyContinue
|
||||
if ($vncService) {
|
||||
$hasVnc = $true
|
||||
Write-Host " [OK] VNC service detected" -ForegroundColor Cyan
|
||||
}
|
||||
}
|
||||
if (-not $hasVnc) {
|
||||
Write-Host " No VNC installation found" -ForegroundColor Gray
|
||||
}
|
||||
$systemInfo.HasVnc = $hasVnc
|
||||
}
|
||||
catch {
|
||||
Write-Host " [WARN] Failed to check for VNC: $($_.Exception.Message)" -ForegroundColor Yellow
|
||||
$systemInfo.HasVnc = $false
|
||||
}
|
||||
|
||||
# ================================================================
|
||||
# Collect ALL installed applications including HKU (per-user) registry
|
||||
# This provides complete app list for parity with remote script
|
||||
# ================================================================
|
||||
Write-Host " Collecting complete application list (including per-user)..." -ForegroundColor Yellow
|
||||
try {
|
||||
$allApps = @()
|
||||
|
||||
# Get from HKLM (machine-wide)
|
||||
$hklmPaths = @(
|
||||
"HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*",
|
||||
"HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*"
|
||||
)
|
||||
foreach ($path in $hklmPaths) {
|
||||
if (Test-Path $path) {
|
||||
$apps = Get-ItemProperty $path -ErrorAction SilentlyContinue |
|
||||
Where-Object { $_.DisplayName -and $_.DisplayName.Trim() -ne "" }
|
||||
foreach ($app in $apps) {
|
||||
if ($app.DisplayName -notin $allApps) {
|
||||
$allApps += $app.DisplayName
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# Get from HKCU (current user)
|
||||
$hkcuPath = "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*"
|
||||
if (Test-Path $hkcuPath) {
|
||||
$apps = Get-ItemProperty $hkcuPath -ErrorAction SilentlyContinue |
|
||||
Where-Object { $_.DisplayName -and $_.DisplayName.Trim() -ne "" }
|
||||
foreach ($app in $apps) {
|
||||
if ($app.DisplayName -notin $allApps) {
|
||||
$allApps += $app.DisplayName
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# Check per-user installed apps by enumerating loaded hives in HKU
|
||||
$hkuKeys = Get-ChildItem "Registry::HKU" -ErrorAction SilentlyContinue
|
||||
foreach ($key in $hkuKeys) {
|
||||
$sid = $key.PSChildName
|
||||
# Only check real user SIDs (S-1-5-21-*), skip _Classes entries
|
||||
if ($sid -match "^S-1-5-21-" -and $sid -notmatch "_Classes$") {
|
||||
$userUninstallPath = "Registry::HKU\$sid\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*"
|
||||
if (Test-Path $userUninstallPath -ErrorAction SilentlyContinue) {
|
||||
$apps = Get-ItemProperty $userUninstallPath -ErrorAction SilentlyContinue |
|
||||
Where-Object { $_.DisplayName -and $_.DisplayName.Trim() -ne "" }
|
||||
foreach ($app in $apps) {
|
||||
if ($app.DisplayName -notin $allApps) {
|
||||
$allApps += $app.DisplayName
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$systemInfo.AllInstalledApps = ($allApps | Sort-Object) -join "|"
|
||||
$systemInfo.AllInstalledAppsCount = $allApps.Count
|
||||
Write-Host " [OK] Collected $($allApps.Count) total applications (including per-user)" -ForegroundColor Cyan
|
||||
}
|
||||
catch {
|
||||
Write-Host " [WARN] Failed to collect complete application list: $($_.Exception.Message)" -ForegroundColor Yellow
|
||||
$systemInfo.AllInstalledApps = ""
|
||||
$systemInfo.AllInstalledAppsCount = 0
|
||||
}
|
||||
|
||||
# Collect running processes (for log analysis)
|
||||
Write-Host " Running processes:" -ForegroundColor Yellow
|
||||
try {
|
||||
@@ -1210,7 +1355,7 @@ function Send-CompleteDataToDashboard {
|
||||
if ($SystemInfo.InstalledApplications -and $SystemInfo.InstalledApplications.Count -gt 0) {
|
||||
$postData.installedApplications = $SystemInfo.InstalledApplications | ConvertTo-Json -Compress
|
||||
Write-Host " Sending installed applications data:" -ForegroundColor Cyan
|
||||
|
||||
|
||||
$activeApps = $SystemInfo.InstalledApplications | Where-Object { $_.IsActive -eq $true }
|
||||
if ($activeApps.Count -gt 0) {
|
||||
foreach ($app in $activeApps) {
|
||||
@@ -1222,7 +1367,32 @@ function Send-CompleteDataToDashboard {
|
||||
} else {
|
||||
Write-Host " No installed applications to send" -ForegroundColor Gray
|
||||
}
|
||||
|
||||
|
||||
# ================================================================
|
||||
# Add VNC status (for parity with remote script)
|
||||
# ================================================================
|
||||
if ($SystemInfo.HasVnc -ne $null) {
|
||||
$postData.hasVnc = if ($SystemInfo.HasVnc) { "1" } else { "0" }
|
||||
Write-Host " VNC Status: $(if ($SystemInfo.HasVnc) { 'Installed' } else { 'Not Installed' })" -ForegroundColor $(if ($SystemInfo.HasVnc) { 'Cyan' } else { 'Gray' })
|
||||
}
|
||||
|
||||
# ================================================================
|
||||
# Add serial ports (for parity with remote script)
|
||||
# ================================================================
|
||||
if ($SystemInfo.SerialPorts -and $SystemInfo.SerialPorts.Count -gt 0) {
|
||||
$postData.serialPorts = $SystemInfo.SerialPorts | ConvertTo-Json -Compress
|
||||
Write-Host " Serial Ports: $($SystemInfo.SerialPorts.Count) port(s)" -ForegroundColor Cyan
|
||||
}
|
||||
|
||||
# ================================================================
|
||||
# Add complete installed apps list (for parity with remote script)
|
||||
# ================================================================
|
||||
if ($SystemInfo.AllInstalledApps) {
|
||||
$postData.allInstalledApps = $SystemInfo.AllInstalledApps
|
||||
$postData.allInstalledAppsCount = $SystemInfo.AllInstalledAppsCount
|
||||
Write-Host " Complete Apps List: $($SystemInfo.AllInstalledAppsCount) total applications" -ForegroundColor Cyan
|
||||
}
|
||||
|
||||
# Send to dashboard API
|
||||
$headers = @{
|
||||
'Content-Type' = 'application/x-www-form-urlencoded'
|
||||
@@ -1232,10 +1402,19 @@ function Send-CompleteDataToDashboard {
|
||||
|
||||
if ($response.success) {
|
||||
Write-Host " [OK] Complete asset data stored in database!" -ForegroundColor Green
|
||||
$data = $response.data
|
||||
Write-Host " PCID: $(if($data.pcid) { $data.pcid } else { 'Unknown' })"
|
||||
Write-Host " Updated/Created: $(if($data.operation) { $data.operation } else { 'Unknown' })"
|
||||
Write-Host " Records affected: $(if($data.recordsAffected) { $data.recordsAffected } else { 'Unknown' })"
|
||||
Write-Host " PCID: $(if($response.machineid) { $response.machineid } else { 'Unknown' })"
|
||||
Write-Host " Operation: $(if($response.operation) { $response.operation } else { 'Unknown' })"
|
||||
Write-Host " Network Interfaces: $(if($response.networkInterfacesCount -ne $null) { $response.networkInterfacesCount } else { 'Unknown' })"
|
||||
Write-Host " Comm Configs: $(if($response.commConfigsCount -ne $null) { $response.commConfigsCount } else { 'Unknown' })"
|
||||
Write-Host " DNC Config: $(if($response.dncConfigSuccess -ne $null) { $response.dncConfigSuccess } else { 'Unknown' })"
|
||||
Write-Host " Installed Apps: $(if($response.installedAppsCount -ne $null) { $response.installedAppsCount } else { 'Unknown' })"
|
||||
if ($response.relationshipCreated) {
|
||||
Write-Host " Machine Relationship: Created" -ForegroundColor Green
|
||||
} elseif ($SystemInfo.MachineNo) {
|
||||
Write-Host " Machine Relationship: FAILED (machineNo=$($SystemInfo.MachineNo))" -ForegroundColor Red
|
||||
} else {
|
||||
Write-Host " Machine Relationship: Skipped (no machine number)" -ForegroundColor Gray
|
||||
}
|
||||
return $true
|
||||
} else {
|
||||
Write-Host " [FAIL] Dashboard could not store data: $($response.error)" -ForegroundColor Red
|
||||
|
||||
Reference in New Issue
Block a user