Crearos con el notepad un archivo de extensión .ps1 con el contenido: (por ejemplo, ballon.ps1
Si nunca habéis ejecutado powershell, por una única vez en la maquina, ejecutad primero:
powershell Set-ExecutionPolicy RemoteSigned
Una vez hecho esto, para lanzar el mensaje;
powershell .\ballon.ps1
NOTA: las opciones para el icono son: None, Info, Warning y Error.
Código:
[system.Reflection.Assembly]::LoadWithPartialName('System.Windows.Forms') | Out-Null
$balloon = New-Object System.Windows.Forms.NotifyIcon
$path = Get-Process -id $pid | Select-Object -ExpandProperty Path
$icon = [System.Drawing.Icon]::ExtractAssociatedIcon($path)
$balloon.Icon = $icon
$balloon.BalloonTipIcon = 'Info'
$balloon.BalloonTipText = 'Operación completa'
$balloon.BalloonTipTitle = 'Hecho'
$balloon.Visible = $true
$balloon.ShowBalloonTip(10000)
powershell Set-ExecutionPolicy RemoteSigned
Una vez hecho esto, para lanzar el mensaje;
powershell .\ballon.ps1
NOTA: las opciones para el icono son: None, Info, Warning y Error.