Questions tagged [powershell-remoting]

The ability to create a remote connection, in an other way than using WMI, is the most important difference between PowerShell v 1.0 and 2.0.

Host applications can use a PowerShell object to run commands that use WS-Management-based Windows PowerShell remoting to create a temporary or persistent connection to the remote computer. This includes establishing an interactive session with a single remote computer.

1238 questions
7
votes
4 answers

Powershell's Invoke-Command won't take in a variable for -ComputerName parameter?

I'm pulling my hair out here, because I just can't seem to get this to work, and I can't figure out how to google this issue. I'm running Powershell 2.0. Here's my script: $computer_names = "server1,server2" Write-Output "Invoke-Command…
erictheavg
  • 350
  • 2
  • 3
  • 14
6
votes
1 answer

How to access NoteProperties on the InputObject to a remoting session

I'm having difficulty accessing PSObjects with NoteProperties defined, that are being passed through to a remote session via Invoke-Command. The reason I am constructing an object for this purpose is that I need access to two separate pieces of…
alastairs
  • 6,697
  • 8
  • 50
  • 64
6
votes
3 answers

why does a scriptblock passed as an argument in invoke-commands argumentlist fail?

function test-scriptblock { 1..10 } function caller ([scriptblock]$runthis) { & $runthis } the following works fine. caller -runthis ${function:test-scriptblock} this doesn't work invoke-command -ComputerName localhost -ScriptBlock…
klumsy
  • 4,081
  • 5
  • 32
  • 42
6
votes
1 answer

How to get an variable output from remote pssession

I have a script to get virtual harddisk info from vmm, im executing it remotely from a server, currently im unable to get the variable value outside of the pssession in the local host, could you please help me out with achieveing the same. PS…
PowerShell
  • 1,991
  • 8
  • 35
  • 57
6
votes
1 answer

Powershell script fails during remote execution but works locally

I am attempting to execute the code below. The errors are self-explanatory but only occur when run remotely. When run locally, all the code works and I can verify that they have the desired effect by pulling content from a web server that requires…
Roberto
  • 61
  • 1
  • 3
6
votes
2 answers

Enter-PSSession to remote server fails with “access is denied”

I want to use winrm remote vm, I can connect to the localhost, but I can't connect to the other remote machine, the error is "access is denied". Please help me.
Hoi Fong Iam
  • 63
  • 1
  • 1
  • 4
6
votes
3 answers

Installing Windows 10 App with powershell remoting

I've been trying to no avail to install a Windows 10 universal app with powershell remoting. I've tried all i can think of so now I'm turning to you hoping that someone can provide me with an answer or explanation as to why my approach isn't…
Magnus
  • 113
  • 1
  • 7
6
votes
3 answers

Invoke-command -ArgumentList parameter syntax

I'm trying to add multiple csv-imported lists to a remote executed PS script. It works fine when I pass only one list using the following command: Invoke-Command -filepath $createSAPSPath -ConnectionUri $uri -Credential $credential -ArgumentList…
Glenn
  • 489
  • 2
  • 7
  • 19
6
votes
3 answers

PowerShell - executing a script on a remote machine giving error

This following is not working for me - %WINDIR%\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -Noninteractive -command "& Invoke-Command -ComputerName "Spider_LT_86" -ScriptBlock { msiexec.exe /i…
Roopesh Shenoy
  • 3,389
  • 1
  • 33
  • 50
5
votes
1 answer

PowerShell remoting: Controlling what edition is being targeted (PowerShell Core or Windows PowerShell); the state of cross-platform remoting

This self-answered question, which focuses on Windows[1], addresses the following aspects: Now that there are two PowerShell editions - the legacy, Windows-only Windows PowerShell and the cross-platform PowerShell Core, both may be installed on a…
mklement0
  • 382,024
  • 64
  • 607
  • 775
5
votes
2 answers

Why do I get a "Get-WindowSize" not implemented error when using the PowerShell call Get-Service on a remote machine?

I have a Windows 10 host machine that connects to a Hyper-V Windows 10 VM hosted on the same box. I've been following along the Pluralsight PowerShell tutorial. I'm trying to get the services available on a remote computer. I can start a session on…
JohnB
  • 3,921
  • 8
  • 49
  • 99
5
votes
0 answers

How can I connect to remote systems using PowerShell inside a Nano Server Docker container, specifically build 1809?

Background I have a .NET application that I would like to install inside a Nano Server Docker container, specifically build 1809. The app is basically a REST server which will receive a REST request and depending on the contents of the JSON, invoke…
5
votes
1 answer

powershell remoting: very slow

If I ssh from a solaris Server to a US server, the ssh connection is very fast, such as delete a file can complete very soon. But why powershell remoting is so slowing, after I entered the remote session, and then remove an item, it takes more than…
Daniel Wu
  • 5,853
  • 12
  • 42
  • 93
5
votes
0 answers

Why is the OpenTimeout option not being applied to New-PSSession?

In powershell I am trying to create a remote session. It fails (and that's ok, I know why it fails) but the issue is that I am trying to set a failure timeout. I create a New-PSSessionOption and set the OpenTimeout in milliseconds, but it seems that…
user9057586
  • 133
  • 7
5
votes
1 answer

How to Invoke-Expression to call a function or script with variables?

I get the an invalid path error with this script: $buildZIP= 'starmatic' echo $buildZIP $command = ”\\XXXXXXXXXX\L$\Gopi_Prod_App\ToZipNew.ps1 $buildZIP” Invoke-Expression -Command $command This is ToZipNew.ps1: Param( [Parameter(Position=1,…
Gopi
  • 53
  • 1
  • 1
  • 5