I am trying to get an application to install on a remote server using powershell. Here is the script I am using:
$Username = 'administrator'
$Password = 'Password'
$pass = ConvertTo-SecureString -AsPlainText $Password -Force
$Cred = New-Object System.Management.Automation.PSCredential -ArgumentList $Username,$pass
Invoke-Command -ComputerName "IP" -ScriptBlock {Start-Process -FilePath `"C:\Windows\notepad.exe" `} -credential $Cred
I can't select a session # and you can run only session 0.