# encoding: ascii # api: powershell # title: Send-Popup # description: Send a popup message to a user on a remote computer. # version: 0.1 # type: function # author: Jack Neff # license: CC0 # function: Send-Popup # x-poshcode-id: 5086 # x-derived-from-id: 6379 # x-archived: 2017-03-19T19:32:26 # x-published: 2017-04-18T00:36:00 # # function Send-Popup { param ($Computername,$Message) if (Test-Connection -ComputerName $Computername -Count 1 -Quiet){ Invoke-Command -ComputerName $Computername -ScriptBlock { param ($m) msg * $m } -ArgumentList $Message Write-Host "Message sent!" } else { Write-Host "Computer not online" } }