Implicit remoting returned in text

Ask your 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.
This topic is 4 years and 4 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
User avatar
Shelltastic
Posts: 65
Last visit: Mon Feb 19, 2024 11:31 am

Re: Implicit remoting returned in text

Post by Shelltastic »

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: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: Implicit remoting returned in text

Post by jvierra »

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
Shelltastic
Posts: 65
Last visit: Mon Feb 19, 2024 11:31 am

Re: Implicit remoting returned in text

Post by Shelltastic »

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: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: Implicit remoting returned in text

Post by jvierra »

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
Shelltastic
Posts: 65
Last visit: Mon Feb 19, 2024 11:31 am

Re: Implicit remoting returned in text

Post by Shelltastic »

Thanks, I'll give it a read.
This topic is 4 years and 4 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked