# Buka SSH shell ke NAS QNAP TS-932X # Usage: .\scripts\ssh-qnap.ps1 # .\scripts\ssh-qnap.ps1 -Command "df -h" param( [string]$Command = "" ) $HostAddr = "10.100.1.10" $SshPort = 22 $SshUser = "admin" $IdentityFile = "$env:USERPROFILE\.ssh\id_ed25519" $sshArgs = @( "-i", $IdentityFile, "-o", "IdentitiesOnly=yes", "-o", "BatchMode=yes", "${SshUser}@${HostAddr}", "-p", $SshPort ) if ($Command) { & ssh @sshArgs $Command } else { & ssh -i $IdentityFile -o IdentitiesOnly=yes "${SshUser}@${HostAddr}" -p $SshPort }