Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

powershell ssh with password

$Password = "Password"
$User = "UserName"
$ComputerName = "Destination"
$Command = "SSH Command"

$secpasswd = ConvertTo-SecureString $Password -AsPlainText -Force
$Credentials = New-Object System.Management.Automation.PSCredential($User, $secpasswd)

$SessionID = New-SSHSession -ComputerName $ComputerName -Credential $Credentials #Connect Over SSH

Invoke-SSHCommand -Index $sessionid.sessionid -Command $Command # Invoke Command Over SSH
Comment

PREVIOUS NEXT
Code Example
Shell :: mariadb delete database 
Shell :: delete last pushed commit 
Shell :: for while bash 
Shell :: Anydesk remote server display not supported e.g Wayland 
Shell :: install just linux 
Shell :: install newman-reporter-htmlextra 
Shell :: restart fstab ununtu 
Shell :: command line argument bash 
Shell :: download sublime merge in linux 
Shell :: react ToastContainer 
Shell :: install h5py in jetson nano 
Shell :: powershell qr code generator 
Shell :: install global package golang 
Shell :: how uninstall composer 
Shell :: install sdl msys2 
Shell :: ubuntu enable ssh 
Shell :: extract a tar.xz in linux 
Shell :: how to install drawing in ubuntu 
Shell :: ssh passphrase stop prompting 
Shell :: run xammp 
Shell :: grep last instance 
Shell :: powershell script for task scheduler 
Shell :: unix permissions 
Shell :: git patch staged to file 
Shell :: jupyter lab download 
Shell :: bash array append 
Shell :: zsh increment variable 
Shell :: maximize and minimize buttons missing ubuntu 
Shell :: odoo docker 
Shell :: git cherry pick example 
ADD CONTENT
Topic
Content
Source link
Name
4+3 =