locked
openbox and put content in $variable RRS feed

  • Question

  • Im having trouble when doing this :

    $checkservice = Get-Service -Name dot3svc

    $text = "Current status is :" $checkservice.Status

    I want to put the string $text in a textbox after this,

    Wednesday, December 20, 2017 9:59 AM

All replies

  • Try this

    $text = "Current status is : $($checkservice.Status)"
    

    • Proposed as answer by jrv Thursday, December 21, 2017 8:08 AM
    Wednesday, December 20, 2017 10:13 AM
  • Hi,

    Based on my research, you can also have a try with "+". Also, does "openbox" mean display a Pop-Up Window? If yes, you may refer to the following script, hope it is helpful to you:
    $checkservice = Get-Service -Name dot3svc
    $text = "Current status is : " + $checkservice.Status
    
    $wshell = New-Object -ComObject Wscript.Shell
    $wshell.Popup($text,0,"",0x1)

    If you need further help, please feel free to let us know.

    Best Regards,
    Albert

    Please remember to mark the replies as an answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Thursday, December 21, 2017 6:15 AM
  • Hi,

    Just checking in to see if the information provided was helpful.

    Please let us know if you would like further assistance.

    Best Regards,
    Albert

    Please remember to mark the replies as an answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Monday, December 25, 2017 12:09 PM
  • Hi,

    I am checking how the issue is going, if you still have any questions, please feel free to contact us.

    If you resolved it using our solution, please "mark it as answer" to help other community members find the helpful reply quickly.
    If you resolve it using your own solution, please share your experience and solution here. It will be very beneficial for other community members who have similar questions.
    If no, please reply and tell us the current situation in order to provide further help.

    Appreciate for your feedback.

    Best Regards,
    Albert

    Please remember to mark the replies as an answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Wednesday, December 27, 2017 7:46 AM