How can I display information message-box on multiple lines?

I would like to be able to display information from comments in a message of several lines.  I managed to get all the information I need, but I can not format out on several lines. I tried vbNewLine in single quotes, but it still just displays vbNewLine in the box.

Here's what I have so far (stitched together from code others I found):

Function Show-Inputbox {
Param([string]$message=$(Throw "You must enter a prompt message"),
[string]$title="Input",
[string]$default
)

[http://reflection.assembly|http://reflection.assembly]::loadwithpartialname("microsoft.visualbasic") | Out-Null
[http://microsoft.visualbasic.interaction|http://microsoft.visualbasic.interaction]::InputBox($message,$title,$default)

}

$strVM = Show-Inputbox -message "What is the name if the machine?" -title "Guest Info" -default machine_name
$vm = Get-VM -Name $strVM

if ($vm.PowerState -eq "PoweredOn") {
$event = Get-VIEvent -Entity $vm | where-object {$_.fullFormattedMessage -like "Task: Power on Virtual Machine"}
$VM.Name
$VM.PowerState
(Get-VMGuest -VM $VM).IPAddress[0]
$event[0].username
}

$strMessageText = $VM.Name+$VM.PowerState+(Get-VMGuest -VM $VM).IPAddress[0]+$event[0].username

$a = new-object -comobject wscript.shell
$b = $a.popup($strMessageText,0,"Guest Info",1) 


Does anyone have any ideas on how to do that? Or other ways to display information (in a non-effrayant way for users)?

In addition, no clue as to how to optimize the code of thise would be apppreciated, it takes time to run.

PowerShell is a line break ' (backtick + n) n.

You can do it like this

$strMessageText = $VM.Name + "`n" + $VM.PowerState + "`n" + (Get-VMGuest -VM $VM).IPAddress[0] + "`n" + $event[0].username

Tags: VMware

Similar Questions

  • How can I avoid my message box to send these messages which are invadeing?

    All these messages are poping up upward in the message box, now I can't send my message, because now I'm over my limit of message, but none of the messages are not from me.

    If you use Hotmail, your probably got account compromised.  Ask here and they can rectify things: http://answers.microsoft.com/en-us/windowslive

    Steve

  • How can I add a Message box if the calculations do not match?

    I develop a form where the user entered a amount field Amt, then distributes that amount to up to six 'finance' fields (Budget1, Budget2, Budget3...), that determine the money will come from. I've created a field of verification screen only (AmtVerif) that allows the user to see if the divided funds add up to the total shown on Amt.

    I want to AmtVerif to:

    1 Add amounts in Budget 1-6 fields (that I managed to do by using FormCalc)

    2 match the total with the value given on Amt

    3 pop-up - a error message that says: 'You went out of the total', or 'Please check the assignment of funds' total case do not match.

    I tried to use 'if' with FormCalc expressions in post them and the events of output, and even if they appear to be correct, they do not show the error message. What I am doing wrong? Help, please!

    Debora

    Please see the attached pdf file. script placed on each output field amount only when all the entries.

  • How can I display the printable two than non-printable ascii characters from a device and display it in a text box?

    Hello

    My send UUT to my computer via serial port of printable and non-printable ascii characters. The question is:

    (1) how to display all characters in a text box.

    (2) how can I display all these characters in hexadecimal format and display it in a text box?

    Thank you.

    Robert

    Text boxes can actually receive channels with printable and non-printable characters: nonprinting characters will be represented with a small square. For example, consider this code:

    tank has [512], msg [512];

    Create a string with embedded unprintable characters

    sprintf (one, "Hello: %c %c %c %c % c: World!", 1, 2, 3, 4, 5);

    Pass the string to the text box "such what."

    ResetTextBox (bH [1], b1_n, a);

    Format a hexadecimal representation of the string and add it to the text box

    FMT (msg, '\n%*d[zb1r16w2p0j1]', strlen (a), a);
    SetCtrlVal (Bosnia and Herzegovina [1], b1_n, msg);

    The result is as follows: the first line is the string passed "such what", what follows is the hexadecimal representation.

  • How can I display an error message on the listening port close popup without closing the popup.

    Hi Experts,

    JDeveloper 12.1.3.0.0

    How can I display an error message on the listening port close popup without closing the popup.

    Thank you

    Roy

    As its name suggests, close listener of popup is called when popup is closed so you can not do this.

    If you want to display the popup message, use your own buttons instead of the ok/cancel default buttons and close the popup programmatically.

    Dario

  • How can I enter information in a box?

    How can I put information in a box in an Adobe form?

    As this has been posted in Acrobat.com services forum - what are you trying to fill the form?  Pat's comments apply to the use of Adobe Reader XI (which is free) on the desk to fill out the form.  Get.adobe.com/Reader/

    If the form input areas are not "to fill", you can't click to add text, you can try the "Completed and signed" application in the services of Acrobat.com http://cloud.acrobat.com/fillsign that allows you to complete and sign the majority of the forms if they have some boxes to fill or not.

    Thank you

    Josh

  • How can I send voice messages in Spanish

    How can I send voice messages in Spanish

    Hello

    On your Apple Watch, after tapping on answer, press firmly on the screen, and then tap on choose language to a different language for your reply (including the dictation).

    The default language for a conversation in Messages is on the same language as the active keyboard on your iPhone (in Messages) for this particular conversation. When you change the language of the keyboard for this conversation on your iPhone, it also changes on your Apple Watch.

    To change the language for a chat on your iPhone (and also on your watch):

    • Lock your iPhone (press the Sleep / Wake button briefly).
    • Open the conversation with this contact on your watch and press on answer.
    • On your iPhone, press the Sleep / Wake button briefly to display the lock screen.
    • The lower left corner of the lock screen, drag upward on the Messages icon (where transfer icons appear).
    • This will open this conversation in Messages on your iPhone.
    • Press the symbol of the globe by the SPACEBAR on the keyboard of the iPhone and choose your preferred language.
      • To add international keyboards, on your iPhone, first go to: settings > general > keyboard > keyboards > add new keyboard.
    • Start typing a response on your iPhone (one or more characters), then delete (implements the choice of language of keyboard for this conversation).
    • On your watch, in the Messages application, exit the screen to answer.
    • Start a new response when this conversation - the new language will be used for dictation and short answers in this conversation.

    More information:

    Use Dictation on your Apple Watch - Apple Support

  • How can I get the messages appear when sent even if my phone is locked. I only get messages across when I activate the phone

    How can I get the messages appear when sent even if my phone is locked. I only get messages across when I activate the phone

    Settings > Notifications > Messages > display on the lock screen

  • I perform a search, results, find the message I was looking for. How can I find this message in my folder structure and subfolder (relatively) complex?

    Hello
    I use structured system subfolder to keep my organized emails (hundreds and hundreds of folders).
    When I do a search, get the list of results and in this list, I found the email I was after, HOW can I find the message? In other words, how can I open the folder that contains this particular email?
    Thank you in advance for your time and effort.

    Right click on a folder, search for Messages, and then click 'Search subfolders', then enter the selection criteria, search, search for a result in the lower pane, then 'open folder '. The message is opened in the Message pane and the containing folder is highlighted in the folders pane.

    It isn't a global search and location does not show the full folder path, but it is another option. Note that the location column can also be displayed in the message search window.

  • How can I clear the message thatI is not the latest version?

    Upgrade to v.6.0.1 but always opens in http://www.mozilla.org/en-US/firefox/4.0.1/firstrun/.

    How can I clear the message that this is not the latest version?

    I uninstalled and reinstalled from new download but the message remains displayed. Problem is that on a user account on my laptop - the other is up-to-date with no error message.

    See the following for a few suggestions:

  • How can I display the time of the data stored in a file using labview?

    How can I display the time of the data stored in a file using labview?

    Hi Matt,

    I think that we will need a little more information as to how you capture the data, what data you capture, etc.

    If you capture a waveform, is to extract the time data waveform which includes the t0 and dt values, so you can understand the time stamp of a specific data point as in the image below.

  • How can I create a text box

    How can I create a text box? Canany body help me create a text box? I need examples of code for the creation of the text box.

    Thanks and regads: -.

    Jitendra.Balla

    Take a look at this example.

    http://NA.BlackBerry.com/eng/devjournals/resources/journals/jul_2005/creating_textbox_field.jsp

    Also check this thread.

    http://supportforums.BlackBerry.com/Rim/Board/message?board.ID=java_dev&message.ID=41759&query.ID=23...

    Concerning

    Bika

  • How can I fix error message authentication on incredimail cannot recive email

    How can I fix error message authentication on incredimail cannot recive email

    Hi David,

    1. is the issue limited to IncrediMail?

    2. What is your default browser?

    3. what email contact are you not to receive emails from?

    4. have you made a recent software or hardware changes to the system?

    If you are facing the issue only with IncrediMail, you can get in touch with IncrediMail Support for assistance.

    For more information, see the article:

    How can I correct an error send/receive?

    Hope the helps of information. Let us know if you need help with Windows related issues. We will be happy to help you.

  • Lowered target Version 9.0 or later form and now the validation messages are appearing, even when the Show Messages dialog box is set to "do not display any message boxes at all."

    Hi all:

    I went a form target version of "10.0 and higher" to "9.0 or more ' and now I get messages from automatic validation of Adobe to appear, even when the Validation of the form of the document is set on"don't show all the message boxes at all."

    Any thoughts?  I have listed some other form to 9.0 and higher and the same setting form Validation works "do not want to display all message boxes".

    The only thing I can think is the decommissioning of 10.0 to 9.0 or more did something?

    Thanks in advance,

    Brian

    without knowing what the errors are, it is difficult to say what the problem is. Forms are usually not popups unless you use FormCalc. Then, the software is displayed a FormCalc error.

  • How can I display a checkbox list items

    Hi all

    How can I include a check box next to the list of items in a drop-down list box list box.

    Here's the requirement I need to display

    sample.PNG

    I need to do above the requirement. I need to display the checkboxes next to each item.

    I can show the list of questions but cannot display the boxes.

    Can anyone help me regarding this.

    Thanks in advance

    Rambeau

    Hope this can help u

    Kind regards

    Kapil Arora

Maybe you are looking for