• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login
TRIGGERcmd
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login

Show a custom Notification

Windows
1
1
323
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M
    mllacerda
    last edited by mllacerda Aug 14, 2020, 8:14 PM Aug 14, 2020, 7:19 PM

    Just modify "TITTLE" and "NOTIFICATION" for your desired texts.

    powershell [Reflection.Assembly]::LoadWithPartialName("""System.Windows.Forms""");$obj=New-Object Windows.Forms.NotifyIcon;$obj.Icon = [drawing.icon]::ExtractAssociatedIcon($PSHOME + """\powershell.exe""");$obj.Visible = $True;$obj.ShowBalloonTip(100000, """TITLE""","""NOTIFICATION""",2)>nul
    

    The last number, before the last closing parenthesis, means the type of notification.

    1 - Information
    2 - Alert / Warning
    3 - Error

    Edit1:
    You can use Powershell functions/variables to improve your notifications.

    powershell [Reflection.Assembly]::LoadWithPartialName("""System.Windows.Forms""");$dateTime=Get-Date -Format HH:mm; $obj=New-Object Windows.Forms.NotifyIcon;$obj.Icon = [drawing.icon]::ExtractAssociatedIcon($PSHOME + """\powershell.exe""");$obj.Visible = $True;$obj.ShowBalloonTip(100000, """Hey """ + $env:UserName, """It's """ + $dateTime + """ drink some water!""",1)>nul
    
    1 Reply Last reply Reply Quote 0
    1 out of 1
    • First post
      1/1
      Last post