Product, version and build: PowerShell Studio 2018 v5.5.149
32 or 64 bit version of product: 64
Operating system: windows 10 and 7
32 or 64 bit OS: 64
In the 2016 version of PowerShell Studio the following code worked.
Invoke-command -ComputerName $SomeMachine -ScriptBlock {
$Output1 = "Remote control of $SomeMachine"
& "\\Server\Share\CmRcViewer.exe" $SomeMachine
$richtextbox_Output.AppendText($output)
}
This calls a Remote Control EXE which in turn allows you to do remote assistance with another user. Yet this exact same code does not work in our current version of PowerShell Studio. And if I run this code within PowerShell ISE it works fine. Did something change in this newer version?
Invoke-Command Problems
Forum rules
DO NOT POST LICENSE NUMBERS, ACTIVATION KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
DO NOT POST LICENSE NUMBERS, ACTIVATION KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Re: Invoke-Command Problems
What error messages if any are appearing when you run this code? and if there are error messages being displayed can you please screen shot and post them?
Re: Invoke-Command Problems
Hi, nothing gets displayed. I've even tried to add code like this:
$Message1 = " We are now calling the remote assistance .EXE"
$richtextbox_Output.AppendText($Message1)
& "\\server\share\CmRcViewer.exe" $SomeMachine
and I never see it echo out to the RichTextBox. so once it is inside the Invoke-Command { } loop nothing seems to happen.
$Message1 = " We are now calling the remote assistance .EXE"
$richtextbox_Output.AppendText($Message1)
& "\\server\share\CmRcViewer.exe" $SomeMachine
and I never see it echo out to the RichTextBox. so once it is inside the Invoke-Command { } loop nothing seems to happen.
Re: Invoke-Command Problems
ok, this worked.
$PC = $PCNameBox.Text
$command = "server\share\CmRcViewer.exe"
$argument = $PC
Start-Process $command $argument
$PC = $PCNameBox.Text
$command = "server\share\CmRcViewer.exe"
$argument = $PC
Start-Process $command $argument
Re: Invoke-Command Problems
Great! You can also try
to see if this will work for you
Code: Select all
$x=[pscustomobject]@{Stuff=111}
invoke-command {$x.Stuff = 333} -Computer ws702