Help with some code

Ask questions about creating Graphical User Interfaces (GUI) in PowerShell and using WinForms controls.
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 8 years and 5 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
ianstraw
Posts: 29
Last visit: Wed Oct 28, 2015 8:22 am

Help with some code

Post by ianstraw »

I have some code that is basically going out looking for serves offline, online etc.

This works, however i have some lines that need writing out to a text box to show whats happening.

This line of code works
PowerShell Code
Double-click the code block to select all.
$richtext.text = some text, some text
However this line does not work
PowerShell Code
Double-click the code block to select all.
$richtextbox1.text = $i "pingable with" $pingable.ipv4address
error is

Error: Unexpected token "is pingable with" in expression or statement.

Is there a way round this?

Thanks
User avatar
SAPIEN Support Forums
Posts: 945
Last visit: Thu Oct 22, 2015 1:10 pm

Help with some code

Post by SAPIEN Support Forums »

This is an automated post. A real person will respond soon.

Thank you for posting, ianstraw.

Did you remember to include the following?
  • 1. Product, version and build (e.g. Product: PowerShell Studio 2014, Version & Build: 4.1.71. Version and build information can be found in the product's About box accessed by clicking the blue icon with the 'i' in the upper right hand corner of the ribbon.)
    2. Specify if you are running a 32 or 64 bit version
    3. Specify your operating system and if it is 32 or 64 bit.
    4. Attach a screenshot if your issue can be seen on the screen
    5. Attach a zip file if you have multiple files (crash reports, log entries, etc.) related to your issue.
If not, please take a moment to edit your original post or reply to this one.

*** Make sure you do not post any licensing information ***
User avatar
davidc
Posts: 5913
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

Re: Help with some code

Post by davidc »

[POST MOVED BY MODERATOR]

Try the following instead:
PowerShell Code
Double-click the code block to select all.
$richtextbox1.text = "$i pingable with $($pingable.ipv4address)"
David
David
SAPIEN Technologies, Inc.
User avatar
ianstraw
Posts: 29
Last visit: Wed Oct 28, 2015 8:22 am

Re: Help with some code

Post by ianstraw »

Thats worked. thanks
This topic is 8 years and 5 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