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

    Show a custom Notification

    Windows
    1
    1
    316
    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

      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
      • First post
        Last post