22 lines
1.3 KiB
PowerShell
22 lines
1.3 KiB
PowerShell
Write-Output "=== E:\wwwroot ==="
|
|
Get-ChildItem 'E:\wwwroot' -Force | Select-Object Mode, Length, Name | Format-Table -AutoSize
|
|
Write-Output "=== C:\ytd-test deep ==="
|
|
Get-ChildItem 'C:\ytd-test' -Recurse -Depth 2 | Select-Object FullName | ForEach-Object { $_.FullName }
|
|
Write-Output "=== ops scripts ==="
|
|
if (Test-Path 'C:\ytd-test\ops') {
|
|
Get-ChildItem 'C:\ytd-test\ops' | Format-Table Name, Length -AutoSize
|
|
Get-ChildItem 'C:\ytd-test\ops\*.cmd','C:\ytd-test\ops\*.ps1','C:\ytd-test\ops\*.json' -ErrorAction SilentlyContinue | ForEach-Object {
|
|
Write-Output "---- $($_.FullName) ----"
|
|
Get-Content $_.FullName -TotalCount 40
|
|
}
|
|
}
|
|
Write-Output "=== scheduled tasks ytd ==="
|
|
Get-ScheduledTask | Where-Object { $_.TaskName -match 'ytd|agent|8910|inquiry' } | Select-Object TaskName, State | Format-Table -AutoSize
|
|
Write-Output "=== nginx root snippet ==="
|
|
Select-String -Path 'C:\nginx-1.18.0\myconf\ai.conf' -Pattern 'root |proxy_pass|ytd-test|wwwroot' | ForEach-Object { $_.Line.Trim() }
|
|
Write-Output "=== pid 8910 ==="
|
|
$p = Get-NetTCPConnection -LocalPort 8910 -State Listen -EA SilentlyContinue | Select-Object -First 1 -ExpandProperty OwningProcess
|
|
if ($p) {
|
|
Get-CimInstance Win32_Process -Filter "ProcessId=$p" | Select-Object ProcessId, CommandLine, ExecutablePath | Format-List
|
|
}
|