1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
New-SSHSession -ComputerName 192.168.1.162 -Credential (Get-Credential) #analizar.txt: #uptime #dmesg #vmstat #mpstat -P ALL #pidstat #iostat -xz #free -m #sar -n DEV #sar -n TCP,ETCP #ps gc analizar.txt | %{ $_ $resultado=Invoke-SSHCommand -Index 0 $_ "---------------------------------------------------------------" | Out-File resultado.txt -Append $resultado.Output | Out-File resultado.txt -Append Start-Sleep -Seconds 5 } |