10 lines
539 B
PowerShell
10 lines
539 B
PowerShell
|
|
[Console]::OutputEncoding = [Text.Encoding]::UTF8
|
||
|
|
Set-ExecutionPolicy -Scope Process Bypass -Force
|
||
|
|
Import-Module Posh-SSH
|
||
|
|
$sec = ConvertTo-SecureString "0" -AsPlainText -Force
|
||
|
|
$cred = New-Object PSCredential("tonycao", $sec)
|
||
|
|
$s = New-SSHSession -ComputerName 192.168.58.7 -Credential $cred -AcceptKey -ConnectionTimeout 15
|
||
|
|
$r = Invoke-SSHCommand -SSHSession $s -Command "grep -E '\[RDM\] SET' ~/butler.log | tail -10; echo '---'; grep -E 'PID=00f0' ~/butler.log | tail -5"
|
||
|
|
Write-Host ($r.Output -join "`n")
|
||
|
|
Remove-SSHSession $s | Out-Null
|