30 lines
1.4 KiB
PowerShell
30 lines
1.4 KiB
PowerShell
|
|
$tsproj = 'C:\Users\tonycao\work\twincat3-auto-cli\TwinCAT_EL6695_Secondary\TwinCAT_EL6695_Secondary.tsproj'
|
||
|
|
|
||
|
|
try {
|
||
|
|
[xml]$doc = Get-Content -LiteralPath $tsproj -Encoding UTF8
|
||
|
|
Write-Host 'XML parse OK' -ForegroundColor Green
|
||
|
|
|
||
|
|
$pdo1608 = $doc.SelectNodes('//Pdo[@Index="#x1608"]')
|
||
|
|
$pdo1A08 = $doc.SelectNodes('//Pdo[@Index="#x1a08"]')
|
||
|
|
|
||
|
|
Write-Host "0x1608 nodes: $($pdo1608.Count)"
|
||
|
|
foreach ($pdo in $pdo1608) { Write-Host " entries: $($pdo.Entry.Count)" }
|
||
|
|
Write-Host "0x1A08 nodes: $($pdo1A08.Count)"
|
||
|
|
foreach ($pdo in $pdo1A08) { Write-Host " entries: $($pdo.Entry.Count)" }
|
||
|
|
|
||
|
|
# Check device AmsNetId
|
||
|
|
$devs = $doc.SelectNodes('//Device[@AmsNetId]')
|
||
|
|
Write-Host "Devices with AmsNetId: $($devs.Count)"
|
||
|
|
foreach ($d in $devs) { Write-Host " $($d.Name) AmsNetId=$($d.AmsNetId)" }
|
||
|
|
|
||
|
|
} catch {
|
||
|
|
Write-Host "XML parse FAILED: $_" -ForegroundColor Red
|
||
|
|
}
|
||
|
|
|
||
|
|
# Check for lock files / backups
|
||
|
|
$dir = Split-Path $tsproj -Parent
|
||
|
|
Write-Host "`nLock/backup files in project dir:" -ForegroundColor Cyan
|
||
|
|
Get-ChildItem -Path $dir -Filter '*.tsproj.*' -ErrorAction SilentlyContinue | Select-Object Name, LastWriteTime, Length
|
||
|
|
Get-ChildItem -Path $dir -Filter '*.sln.*' -ErrorAction SilentlyContinue | Select-Object Name, LastWriteTime, Length
|
||
|
|
Get-ChildItem -Path $dir -Filter '*.user' -ErrorAction SilentlyContinue | Select-Object Name, LastWriteTime, Length
|