PoshCode Logo PowerShell Code Repository

sssssss by mozguc 7 weeks ago (modification of post by Jack Neff view diff)
diff | embed code: <script type="text/javascript" src="http://PoshCode.org/embed/6772"></script>download | new post

Send a popup message to a user on a remote computer.

  1. function Send-Popup {
  2.  
  3.     param ($Computername,$Message)
  4.  
  5.     if (Test-Connection -ComputerName $Computername -Count 1 -Quiet){
  6.         Invoke-Command -ComputerName $Computername -ScriptBlock { param ($m) msg * $m } -ArgumentList $Message
  7.         Write-Host "Message sent!"
  8.     } else {
  9.         Write-Host "Computer not online"
  10.     }
  11.  
  12. }

Submit a correction or amendment below (
click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Syntax highlighting:


Remember me