Skip to content

Instantly share code, notes, and snippets.

@kozo
kozo / powershellとputtyで複数のサーバにログイン
Last active December 22, 2015 06:49
powershellとputtyで複数のサーバにログイン
$user = "Login User Name"
$exePath = "putty exe Path"
$inputFilePath = "Server List Text FilePath"
$sr = New-Object System.IO.StreamReader($inputFilePath, [Text.Encoding]::GetEncoding("Shift_Jis"))
while (($line = $sr.ReadLine()) -ne $null)
{
$arg = "-ssh " + $line + " -l " + $user
Start-Process $exePath -ArgumentList $arg
}