22 lines
1.1 KiB
PowerShell
22 lines
1.1 KiB
PowerShell
# 只读:找 C:\ytd-test 硬编码路径与相关任务
|
|
$ErrorActionPreference = "Continue"
|
|
Write-Output "=== grep ytd-test under tree ==="
|
|
Get-ChildItem 'C:\ytd-test' -Recurse -File -ErrorAction SilentlyContinue |
|
|
Where-Object { $_.Extension -match '\.(cmd|ps1|json|env|bat|txt|md)$' -or $_.Name -eq '.env' } |
|
|
ForEach-Object {
|
|
$hits = Select-String -Path $_.FullName -Pattern 'C:\\ytd-test|C:/ytd-test' -SimpleMatch:$false -ErrorAction SilentlyContinue
|
|
if ($hits) {
|
|
Write-Output $_.FullName
|
|
$hits | ForEach-Object { " L$($_.LineNumber): $($_.Line.Trim())" }
|
|
}
|
|
}
|
|
Write-Output "=== task actions ==="
|
|
foreach ($n in @('WinAgentKeepAlive','SpaceAgentTask','YTD-Inquiry-Agent','YTD-WeCom-Callback')) {
|
|
$t = Get-ScheduledTask -TaskName $n -ErrorAction SilentlyContinue
|
|
if (-not $t) { continue }
|
|
Write-Output "---- $n state=$($t.State) ----"
|
|
$t.Actions | ForEach-Object { "Exec=$($_.Execute) Args=$($_.Arguments) Work=$($_.WorkingDirectory)" }
|
|
}
|
|
Write-Output "=== E wwwroot empty? ==="
|
|
(Get-ChildItem 'E:\wwwroot' -Force | Measure-Object).Count
|