This commit is contained in:
2025-10-25 13:21:06 +02:00
parent eb57506d39
commit 033ffb21f5
8388 changed files with 484789 additions and 16 deletions

View File

@@ -0,0 +1,13 @@
# Define variables
$hostname = "192.168.50.200" # "your_linux_server_ip_or_hostname"
$username = "root"
$command = "/usr/bin/echo test >> /root/test" # Replace with the command you want to run
# Create a new SSH session
$session = New-PSSession $username@$hostname -SSHTransport #-HostName $hostname -UserName $username -SSHTransport
# Run the command on the remote server
Invoke-Command -Session $session -ScriptBlock { $command } # -ArgumentList $command
# Close the session
Remove-PSSession -Session $session