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.
Locked
User avatar
ianstraw
Posts: 29
Joined: Thu Apr 23, 2015 3:16 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
Joined: Wed Dec 03, 2014 2:26 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
Joined: Thu Aug 18, 2011 4:56 am

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
Joined: Thu Apr 23, 2015 3:16 am

Re: Help with some code

Post by ianstraw »

Thats worked. thanks

Locked