Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

Using command output as message in msg

$
0
0

Hi.

I'm trying to use the output of a Powershell commands as the content of a message in msg.

if I do:

$TEST = 123
msg /server:mypc * "$TEST"

I get the message box saying "123"

However, when I do:

$TEST = (cmdlet|cmdlet|cmdlet)|out-string
msg /server:mypc * "$test"

It dose not work.

Is there a way sent the output of (cmdlet|cmdlet|cmdlet)|out-string with msg?

Thank you! :)





Viewing all articles
Browse latest Browse all 21975


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>