Implicit remoting returned in text

Ask your Windows PowerShell-related questions, including questions on cmdlet development!
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
User avatar
PS_Ross
Posts: 58
Joined: Thu Mar 01, 2018 7:46 am

Re: Implicit remoting returned in text

Post by PS_Ross » Thu Oct 31, 2019 7:29 am

Ok, thanks for the assistance. Instead of going through all this to remove a simple line of text, I will just go about it another way and have the form open the URL to the SFB chat room for the description. There was no way I could have known all this was going to be involved.

Thanks again.

jvierra
Posts: 14016
Joined: Tue May 22, 2007 9:57 am
Contact:

Re: Implicit remoting returned in text

Post by jvierra » Thu Oct 31, 2019 7:43 am

PS_Ross wrote:
Thu Oct 31, 2019 7:29 am
Ok, thanks for the assistance. Instead of going through all this to remove a simple line of text, I will just go about it another way and have the form open the URL to the SFB chat room for the description. There was no way I could have known all this was going to be involved.

Thanks again.
There is no way anyone could know. Unfortunately this is the only way to prove out a difficult bug but now you have some pointers on how to debug this kind of issue.
You could post this bug on UserVoice to see if there is any other information or a po0ssible fix on the horizon.

Skype for business has had many issues over the years. Microsoft is dumping this in favor of Teams and so they may not be interested in fixing the issue. This is aqlso a deficiency in using forms with PowerShell because the PS environment does not correctly enable multithreading so all forms are forced to run in a single thread.

I would try to run the code in a runspace and not a job. A job runs the code out-or-process which can cause other issues with some code. A runspace can run in-process which may eliminate errors in passing data.

Since you are only returning one simple object you should be able to just run the code in the form without a job. The delay should be small.

User avatar
PS_Ross
Posts: 58
Joined: Thu Mar 01, 2018 7:46 am

Re: Implicit remoting returned in text

Post by PS_Ross » Thu Oct 31, 2019 7:50 am

Your correct, the delay would be small, however, I try to keep all my processes the same when developing apps, just good practice. In this case though, your probably right, might be worth it to just have it run in the foreground and have the application freeze when it runs.

It looks like the string that gets returned is the same every time, so I wound up doing this...

Code: Select all

$Description = $results.Description -replace "Implicit remoting for https://sfbpool.domain.com/ocsPowerShell"

$textbox1.Text = $Description.Trim()
That works just fine and removes the default return garbage that I don't want.

jvierra
Posts: 14016
Joined: Tue May 22, 2007 9:57 am
Contact:

Re: Implicit remoting returned in text

Post by jvierra » Thu Oct 31, 2019 7:56 am

If you are really interested in consistency then you should read and understand this following link which covers many of the issues I have seen in your code:

The PowerShell Best Practices and Style Guide

User avatar
PS_Ross
Posts: 58
Joined: Thu Mar 01, 2018 7:46 am

Re: Implicit remoting returned in text

Post by PS_Ross » Thu Oct 31, 2019 8:35 am

Thanks, I'll give it a read.

Locked