-
This commit is contained in:
13
Proxmox/stopFileserver.ps1
Normal file
13
Proxmox/stopFileserver.ps1
Normal 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
|
||||
Reference in New Issue
Block a user