1,267 questions
1 vote
1 answer
134 views
How do I programmatically launch an application on a remote machine with PowerShell?
The following code will launch notepad.exe which can be seen in the processes. But it does not launch the notepad on the screen. $wmi = [WMIClass]"\\REMOTE_MACHINE_NAME\root\cimv2:Win32_Process&...
1 vote
0 answers
91 views
How to setup a Remote PowerShell using WSManConnectionInfo in C# using Certificate Authentication?
I am trying to create a Remote PowerShell (RPS) that will form connection between machines to execute RPS Commands. I have this following example setup "HostPC with C# console application (that ...
0 votes
2 answers
199 views
How can I use Invoke-Command with WSMan in PowerShell 7 if "Powershell.7" endpoint does not exist?
I'm trying to run a remote command using Invoke-Command over WSMan in PowerShell on my local machine. Here’s my test script: $server = 'localhost' Invoke-Command -Authentication Negotiate -...
2 votes
1 answer
89 views
How to setup a remote Powershell communication between devices using c# with Kerberos/Certificate?
I have this setup, I have a HostPC which will connect with say two remote PCs in order to run PowerShell commands. So, I will be using WSManConnectionInfo for this with HTTPS. I am just stuck around ...
1 vote
0 answers
52 views
Can't start a remote elevated PSSession to a stand alone host
We're developing a Windows application environment on EC2s. There is a Bastion host that will be used for configuration tasks using PSSessions to run scripts on remote machines. This was built in an ...
1 vote
1 answer
109 views
In PowerShell, I cannot transfer System.Data.DataTable using the invoke-command to the remote host
Here is a script in which I am trying to pass a variable of type System.Data.DataTable via invoke-command to the remote host: function Test1 { param ( [System.Data.DataTable] $...
1 vote
1 answer
64 views
I'm catching errors, why does output look like it isn't
Here's my PowerShell 5.1 script to get service status on all machines. I'm giving each server 5 seconds to respond before moving on. However, it still looks like I'm getting the uncaught messages in ...
0 votes
0 answers
65 views
How to redirect command output to different remoting session terminal into Windows Powershell (Terminal)
Normally I do it into an ssh session from Windows 10 Pro to my android/termux device ( that I am sure could be any linux Distro ) in the next way. ssh to my devive (android/termux) like traditional ...
0 votes
0 answers
65 views
RunAsVirtualAccount for Register-PSSessionConfiguration
I am trying to create a remote session that allows me to execute windows updates and based on the other threads, creating a virtual session with -RunAasVirtualAccount is the way to go. I have ...
0 votes
1 answer
146 views
Java ProcessBuilder execute PowerShell Script as Admin
I have a Java application which is started with non admin rights. From my Java application I want to start different PowerShell scripts. The PowerShell scrips have input and output parameter. Inside ...
0 votes
0 answers
80 views
Run a command in a specific Command Prompt window using its Process ID
Is there a way to run a command in a specific Command Prompt window using its Process ID? $command = "C:\Windows\system32\cmd.exe" $ID = (Start-Process -FilePath $Command -PassThru).Id ...
1 vote
1 answer
138 views
When capturing the return value of Invoke-Command I don't see the output of the commands
In a PowerShell script, I have something like this: $Session = New-PSSession -ComputerName "WSEM00G2NZ" -Credential $credObject Invoke-Command -Session $Session -Scriptblock { python ...
0 votes
1 answer
327 views
Azure Release Pipeline - Execute a PowerShell script from a remote server
I need to create a release pipeline for coping two .dll files and remotely execute a PowerShell script. What I did, Wrote a bash script to download the .dll file and PowerShell script file from ...
-1 votes
1 answer
247 views
Run Powershell scripts from Linux machine
I have some PowerShell scripts, which remotely collect some info form Windows machines via WMI and then return result in JSON format. Now, for these goal i have windows machine, which has all my ...
1 vote
2 answers
118 views
Error calling Get-ChildItem from Invoke-Command
In this scenario, there two servers. We'll call them ServerA and ServerB. There is also network share: \\share-ip-address\hidden_share$. I am using the following Powershell command to get the most ...