►
From YouTube: Toast Notifications: Windows Alerts on Steroids with Stephen Valdinger November 8th 2018
Description
We will be discussing Toast Notifications in Windows 10. Yes, you read that right!!! Those pop-up alerts that appear in the lower right-hand corner of your PC will be our topic of discussion this month!!!
The toast notification tool is Microsoft's way of alerting you to important information in real time. Stephen Valdinger will be showing you ways to use the rich alerting capabilities of the Toast Notification system to keep you up to date and notify on things that you may have not thought about before!
He'll be showcasing different ways to produce notifications using the BurntToast PowerShell module by Josh King, as well as how to accomplish things with pure .Net classes.
A
So
Mike
said
my
name
is
Steven
valanor
I'm,
an
IT
user
support
analyst
based
in
Ohio
at
Kent,
State
University
I've
been
doing
IT
for
about
twelve
years
now,
PowerShell
for
about
three,
and
if
you
talk
to
anybody
that
that
knows
me
personally,
they
will
tell
you
that
I
am
seriously
addicted
to
this
I
love.
Talking,
PowerShell
and
teaching
people
about
power
show
I,
love,
learning
new
things,
so
I'm
really
excited
to
show
off
toast
notifications
in
Windows
10,
for
you
guys,
and
hopefully
you
guys
can
glean
some
interesting
tidbits.
A
Maybe
some
new
ideas
to
to
use
in
your
environments
and
leverage
toast
notifications
to
you
know
help
you
guys
alert
end-users
alert
yourselves,
just
there's
just
all
kinds
of
stuff
that
you
can
do
with
these
things.
So
we'll
step
through
this,
and
hopefully
you
enjoy
it
I'm
going
to
move
this
out
of
my
way.
All
right,
you
can
see
on
the
screen
here,
they're
more
than
just
annoying
pop-ups
that
you
see
in
the
bottom
right
hand
corner
of
your
screen.
A
Mostly
when
you
get
email
things
like
that,
you
can
add
them
to
your
monitoring
platforms.
You
can
use
them
to
set
reminders
instead
of
your
calendar.
You
can
abuse
the
power,
show
engine
with
them
and
you
can
stop
babysitting
things
if
you've
got
long-running
code
or
tacit,
you
sit
around
and
wait
on
them
to
finish
automate
that
stuff
guys
just
walk
away
from
it
and
get
a
toast
notification
when
that
long-running
script
ends.
Things
like
that
enough,
rambling
about
slides
and
things
like
that.
Let's,
let's
dive
into
some
code,
real
quick.
A
The
first
thing
I
want
to
talk
about
to
you
guys
this
evening
is
abusing
the
PowerShell
engine.
I
use
the
term
abusing
lightly.
The
stuff
is
baked
into
PowerShell
v5,
and
that
is
engine
events.
If
you
look
on
the
Microsoft
documentation,
there's
a
couple
of
different
ones,
there's
engine
engine
events
that
you
can
use
for
the
actual
engine
itself
for
WMI
and
also
for
custom
events,
that
you
create
an
example
of
using
engine
events
for
the
engine
itself.
A
As
you
can
see
here,
we're
going
to
do
something
when
PowerShell
dot,
exe
exits,
there's
also
an
on
idle
engine
event
that
you
can
act
upon.
I,
don't
really
see
the
use
for
toast
notifications
on
idle.
You
will
get
a
lot
of
them
every
time
that
PowerShell
pauses
to
switch
between
steps
in
code
or
just
sits
there
that
on
idle
event,
is
firing,
and
that
can
lead
to
a
whole
lot
of
toast
notifications
this
year,
using
it
in
that
manner.
A
In
a
second
I
just
want
to
fire
this
off
real
quick,
but
in
order
to
get
the
toast
notifications
to
actually
work,
make
sure
that
you
would
explicitly
import
module
burnt,
toast
prior
to
running
your
register
engine
event
code,
and
if
we
copy
this
out
and
bring
it
over
to
a
console
and
run
it
you'll
see
that
it
is
created
a
PowerShell
exit
event
and
if
you
type
exit
you
will
get
a
toast
notification
down
here.
In
the
bottom
right
hand,
corner
does
power,
show
exit
whatever
you're
doing
is
done
in
power.
Show
is
exited.
A
A
However,
you
want,
you
can
just
make
it
simple:
hey
this
exited,
it's
done.
If
you're
creating
directories
or
files,
you
can
have
counts
with
successful
creations,
you
can
collect
the
errors
and
toast
on
hey
I
created
X
number
successfully,
but
these
seven
failed
different
things
like
that
I've
mentioned
burnt
toast
a
couple
of
times
now.
A
The
previous
meetup
that
we
had
for
this
group
was
from
Josh
King,
which
he
just
happens
to
be
the
author
of
the
burnt
toast
module
a
couple
months
ago,
I
was
really
looking
for
a
way
to
alert
my
tier
1,
guys
that
printers
on
our
campus
we're
running
low
on
toner
and
they
are
notorious
for
not
having
their
email
open
or
their
ticketing
system
open.
While
that
is
largely
a
management
issue,
I
wanted
something
a
little
more
in
their
face.
A
That
says:
hey
this
needs
taken
care
of
so
I
started
googling
around
trying
to
figure
out
I
could
use
PowerShell
to
do
a
toast
notification
and
I
stumbled
upon
the
burnt
toast
module,
which
pretty
much
does
everything
I
wanted
it
to
do,
and
I
didn't
have
to
lift
the
finger
to
write
any
code.
Aside
from
the
code,
I
actually
needed
to
write
to
toast
on
what
I
wanted
to
toast
on.
A
So,
if
you
haven't
checked
it
out,
I
can
I'll
put
a
link
to
his
module
to
his
github
at
the
end
of
this
presentation,
it's
out
there
and
github
right
now.
You
can
download
it
it's
on
the
PowerShell
gallery
as
well.
So
if
you're
running
powershell
v5,
you
can
just
install
module,
burnt,
toast
download
that
and
kick
the
tires
on
it.
There's
all
kinds
of
great
Commandments
inside
of
there
that
you
can
use
and
actually
I,
can
just
show
you
all
the
different
kind
of
stuff
that
you
can.
You
can
do.
A
So
this
is
all
the
stuff
that
he's
got
baked
into
this
thing.
You
can
do
context
menus
progress
bars.
You
can
change
the
icons
that
it's
using.
You
can
change
the
sound
that's
being
presented
by
default
uses
the
default
windows
notification
sound.
But
if
you
want
something
a
little
bit
more
in-your-face
like
when
a
toner
goes
low
on
campus,
for
example,
it
bladers
are
really
loud
alarm,
annoying
sound
at
them,
which
is
really
embarrassing
in
the
room
that
they
sit
in.
A
So
that's
how
you
get
the
burnt,
toast
module
and
now,
while
I
will
show
you
how
to
do
some,
even
cooler
things
with
it.
I
mentioned
that
engine
events,
you
can
do
custom
things
with
it.
Custom
events
can
be
created
by
using
register
engine
event
with
the
source
identifier
and
then
creating
an
action
that
happens
whenever
that
source
of
identifier
gets
reference
later,
so
we'll
go
ahead
and
we'll
register
this
new
engine
event
with
the
source.
A
Identifier
of
test
and
my
action
I'm
going
to
create
a
toast
with
a
new
header
called
engine
event
test,
and
the
text
will
be
event
message
data
you
will
notice
that
I
haven't
defined
event
anywhere.
Event
is
a
automatic
variable
of
register
engine
event
and
message.
Data
is
a
property
of
that
variable
and
also
it
creates
it
rights
to
the
screen.
Output
of
the
event
object
that
it
creates
so
I'm,
just
passing
it
to
null
here
too,
to
minimize
that
output
for
us
so
we'll
run
that.
A
A
And
then
you
will
use
the
message
data
to
write
whatever
you
want
in
the
toast
notification.
So
if
we
run
that
bit
of
code,
you'll
get
engine
event
test
which
I
defined
up
here
in
the
header
and
then
the
message,
data
which
I
defined
in
the
actual
event
itself.
So
if
you've
got
code,
that
does
several
different
things
or
you
want
a
toast
notification
for
specific
steps.
So
you
know
where
it's
at
in
the
process.
You
can
use
the
engine
itself
to
to
let
you
know
when
those
things
are
happening.
A
The
next
really
cool
thing
you
can
do
is
bolt
post
notifications
to
your
monitoring
platforms.
I'm
sure.
A
lot
of
you
have
something
like
an
elk
stack
or
not
use,
or
in
this
example
I'm
going
to
use
graph
on
ax,
but
toast
notifications
can
include
buttons
and
buttons
can
perform
actions
right
now,
they're
limited
to
opening
files
and
URLs,
but
with
a
little
bit
of
work,
I
believe
that
you
can
also
run
custom
code
against
them.
A
And
then
I
define
my
button
with
my
properties:
I
create
my
header
again,
giving
it
a
default
ID
of
1
and
a
title
of
serger
service
degradation,
alert
and
then
again,
I'm
splatting,
some
properties
to
keep
code
smell
down
here.
I
give
it
my
button,
my
text,
my
header
and
then
I'm
changing
the
logo
here
to
the
Griffons
logo.
So
if
I
run
all
of
this
code
together.
A
A
A
So
with
this
I
define
a
couple
of
parameters.
I
have
my
title,
my
text
and
also
a
time
for
when
I
want
the
reminder
to
happen
seconds
minutes
or
hours
and
in
my
process
block
I'm,
actually
starting
a
job
so
that,
if
I'm
in
a
PowerShell
console
but
I
want
this
to
stay
out
of
my
way,
it'll
run
in
the
background
as
a
job.
So
I
can
continue
to
use
my
console
I'm
using
a
diagnostic
stopwatch.
A
And
here
I'm
just
converting
my
hours
into
seconds
and
then
I
add
them
all
together
to
get
my
total
seconds
so
that
I
can
use
the
stopwatch
elapsed,
total
seconds
property
to
fire
off
the
toast.
Once
the
total
seconds
reaches
the
specified
time
that
I
have
when
I
fired
off
the
command
again,
I
wait
for
it
to
elapse.
I
stop
my
stopwatch,
I
create
my
header
again
and
then
I
create
a
new
toast.
B
A
There
we
go
after
10
seconds:
I
got
a
toast
notification
that
says:
I
need
to
get
eggs
on
the
way
up.
This
could
be
anything
if
you
need
your
morning,
coffee
reminder
whatever
that's,
you
can
use
it
that,
for
whatever
you
want,
but
reminders
are
a
great
great
thing
to
use
toast
notifications,
for
that
you
might
thought
of
it.
Might
not
a
lot
of
hey.
A
B
I
just
wanted
to
say:
I
sent
a
message
out
on
the
chat.
Maybe
not
everybody
sees
it
if
anybody's
got
some
questions
for
Steven
now
would
be
the
time
to
get
him
in
here.
I
wanted
to
ask
you,
you
mentioned
the
toast
alerts.
Just
you
could
have
buttons
and
you
we
went
to
that
grifone
a
thing.
The
link
that
you
did,
that
was
an
HTTP
link
that
he
pulled
that
from
yep.
So
what
about?
B
A
Okay,
so
let
me
let
me
open
that
code
up
if
my
there
we
go.
A
Grip
blocks
executed
in
a
different
scope
than
the
rest
of
your
code.
It's
kind
of
like
it's
similar
to
using
invoke
command.
The
remote
computer
doesn't
know
anything
about
your
remote
variables
or
your
local
variables
on
the
remote
side,
unless
you
send
it
to
them
with
like
a
using
statement
or
an
argument
list,
same
concept
applies
here.
Start
job
is
actually
a
different
run
space
and
a
different
scope.
A
So
it
has
no
idea
what
those
variables
are,
unless
you
explicitly
tell
it
to
to
use,
use
them
with
a
using
statement,
or
you
can
build
a
parabola
in
side
and
pass
it
like
PS
bound
parameters
or,
however,
you
want
to
do
it
using
has
been
in
power
shell
since
v3,
and
it's
the
simplest
way
to
define
remote
variables.
So
that's
why
I'm
using
it.
A
A
A
To
finish
up
so
this
script
can
run
locally
or
take
a
computer
name,
and
if
you
take
a
computer
name,
it
creates
a
session
to
that
remote
computer
and
then
it
will
go
out
and
grab
the
BitLocker
encryption
percentage
value
off
of
get
the
BitLocker
volume
and
then,
after
it
reaches
a
hundred
percent,
you
will
get
a
toast
notification
that
hey
the
BitLocker
encryption
is
completed
and
then,
in
the
end
block
here,
I'm
just
cleaning
up
the
session.
If
I,
if
I
had
one
since
there's.
A
Yeah,
my
SSC
is
already
a
hundred
percent
encrypted,
so
it
fired
off
right
away
that
encryption
is
complete,
but
it's
pretty
useful.
If
you
know
you've
read
somebody's
computer
and
it
needs
to
be
BitLocker
and
encrypted,
and
you
don't
have
the
up
to
45
minutes
to
wait
depending
on
how
big
the
volume
is
inside
of
it.
You
can
just
kick
this
off
to
tell
what
computer
reach
out
and
talk
to
and
then
it'll,
let
you
know
via
toast
notification
when
that
encryption
process
is
finished,
this
does
have
to
use
PowerShell
remoting.
A
A
If
something
falls
below
my
required
minimum
I
alert
at
five
percent,
so
here
I'm,
just
creating
an
object
of
all
the
different
toners
that
you
could
probably
have
in
one
of
your
devices,
black
cyan,
magenta
and
yellow
for
a
color
device.
I'm
going
to
go
ahead
and
pull
out
those
colors
and
loop
through
on
the
note
properties,
and
if
the
value
is
less
than
10%
I
will
create
a
toast
notification.
A
A
A
A
This
one's
alright,
this
one
was
goofy
I
had
the
idea.
The
other
day
when
I
was
looking
at
an
old
script,
I
wrote
that
was
using
T
object
to
send
output
to
a
log
file
and
output
to
the
screen.
At
the
same
time,
I'm
like
man,
why
am
I
not
outputting
a
toast
notification
and
writing
to
the
event
log,
like
a
sane
person,
would
do
so.
I
wrote
this
quick
and
dirty
function
called
new
toasty
output.
That
just
does
just
that.
A
A
A
We
check
and
see
if
the
source
already
exists
if
the
first
time
you
run
this
code,
if
the
source
doesn't
exist,
it's
going
to
create
it,
but
on
subsequent
runs,
if
you
use
the
same
source,
it's
already
going
to
be
there.
So,
instead
of
throwing
red
everywhere,
we
just
say
hey.
Let's
suppress
that
and
just
write
directly
to
the
event.
Log
I
write
to
the
application
log
explicitly
in
this
code
with
the
source
that
I
specify
as
a
parameter.
A
It's
good
to
write
stuff
to
the
event
log,
especially
you
know,
if
you're,
if
you
set
up
subscriptions
and
forwarders
for
your
events,
so
that
everything
that
your
PowerShell
code
is
doing
is
being
dumped
to
a
centralized
server.
So
you
have
one
single
pane
of
glass
to
look
at
all
your
logs.
Only
one
endpoint
that
you
have
to
connect
to
a
monitoring
server.
Things
like
that.
A
It's
really
good
to
write
to
the
event
log
for
all
of
your
logging
needs,
and
this
descript
does
that
pretty
well
and
then
also,
if
you
need
to
you
know,
you
don't
want
to
check
the
event
log
every
time
the
script
runs,
but
you
need
to
know
it's
done.
You
get
a
toast
notification
as
well,
so
it
kind
of
takes
the
hunting
find
out
of
those
operations.
A
A
You
know
to
get
those
things
approved
before
you
can
use
them
in
your
environments.
You
can
do
it
with
peer
net.
You
need
a
couple
of
things.
You
need
a
title.
You
need
your
message
of
course,
and
then
you
can
use
your
logo
as
well
I'm
setting
it
to
the
default
burnt,
toast
logo
that
ships
with
Josh's
burnt
toast
module
here.
That
way,
we
at
least
see
something
in
the
screen,
but
if
you
specify
your
own
logo
with
the
parameter,
it
will
override
so
you'll
get
whatever
you.
Whatever
you
want
to
see.
A
A
A
So
if
you
need
a
more
complex
net
example
that
has
all
of
that
real
fancy
stuff
that
you
can
do
with
toasts
like
progress
bars
or
buttons,
there
are
templates
available
on
the
Microsoft
dock
site
that
you
can
copy
and
put
inside
of
here
and
change
as
appropriate.
But
inside
of
this
particular
template
I'm
using
the
title
is
one
of
the
text
blocks.
The
message
is
another
text
block
and
if
you
wanted
a
third
line,
toast
notifications
do
support
a
third
line
of
text.
A
So
if
you
do
need
a
little
bit
more
information
to
be
sent
along
the
way
you
can
use,
you
can
use
three
lines,
but
in
this
example,
we'll
just
we'll
just
use
two
in
1803
of
Windows
10.
They
changed
the
way.
Toast
notifications,
fire
you're,
now
required
to
use
an
app
ID
and
by
default
this
one
is
in
the
registry.
I,
don't
have
the
location
handy
at
the
moment
and
Josh
has
a
really
good
blog.
This
is
actually
mostly
his
I
was
talking
to
him
on
slack
a
little
while
ago
as
prepping.
A
For
this
talk,
I'm,
like
hey
I've,
got
this
idea
for
not
know
dotnet
Tosun.
He
likes
me
like
a
bunch
of
his
blog
articles
and
a
talk
that
he
did
was
a
bunch
of
code
and
he's
like
there.
You
go
so
shamelessly
took
most
of
that
code
from
him.
Then
wrapped
it
up
in
a
nice.
Nice
function
too,
to
show
off
to
you
guys,
but
you
do
need
an
app
ID
in
order
to
make
this
work
and
then
at
the
end
we
can
just
call
my
function
here.
A
We'll
give
it
my
title
and
my
message
this
Manas
and
I
have
red
text.
Why
do
I
have
red.
A
B
So
so,
first
off
Steven,
thank
you
that
was
I
love
that
that
was
awesome.
I
I
have
questions.
You
know
we
don't
have
to
limit
it
to
the
chat.
If
you
guys
want
to
open
up
mics,
and
we
can
just
not
all
step
on
each
other,
no
reason
why
we
can't
all
just
chat.
There
was
a
question
in
the
chat
going
back
a
little
bit.
One
want
someone
to
know
what
is
tea,
toast
I
think
you
had
that
money
hah
there.
Let.
A
B
A
A
So,
as
you
can
see
here,
we
have
a
source
property.
That
source
is
just
where
the
the
event
came
from
it's
the
same
thing
I
just
named
it
t
out
and
or
T
toast.
In
this
example,
you
know
if
you're,
if
you're
running
a
script,
and
it's
doing
a
particular
thing
name,
it
appropriately
name
your
source
appropriately,
it
can
be
whatever
you
want.
That's
just
what
I
came
up
with
in
this
demo.
B
Okay,
so
I
just
want
to
make
sure
I
understood,
so
you
had
gone
through
examples
earlier
and
you
had
pop-up
notifications
and
I
was
thinking
an
example.
So,
basically,
if
I
have
a,
if
I
have
a
box
that
we
use
for
scheduled
tasks,
you
know
a
central
central
box.
All
I
necessarily
need
to
do
is
install
Brent,
toast
module
on
there.
Yep
maybe
come
up
with
a
boilerplate
block.
The
text
block
the
code
that
I
basically
adds
at
the
end
of
any
one
of
my
scripts
that
that
run.
B
A
It's
that
simple
you're
going
to
want
if
you're
running
the
code
from
like
a
central
box
where
all
your
scheduled
tasks
are,
and
you
want
to
notify
on
a
different
machine
you're
going
to
want
to
use
PowerShell
remoting
for
that
a
and
B
you're
going
to
want
the
burnt
toast,
not
the
burnt
toast
module
installed
on
the
remote
endpoint,
so
that
you're
running
all
your
burnt.
Toast
notification
calls
on
the
remote
side
and
not
on
the
central
server
itself.
A
B
A
A
So
what
import?
What
importing
a
PS
session
does
when
you
have
a
module
imported
on
the
remote
side?
Is
it
creates
a
shortcut
to
that
module
in
your
modules,
folder,
with
just
pointers
back
to
the
remote
side?
And
you
don't
have
to
use
the
prefix,
but
a
prefix
is
really
handy
to
let
you
know
that
hey
this
is
Ramona
running
somewhere
else.
Actually,
I
don't
have
this
locally,
so
yeah
you
could.
B
A
Never
tested
that.
That's
not
something
I
really
have
to
worry
about
in
my
environment,
just
because
my
machine
is
always
logged
on
and
my
helpdesk
machines
always
have
somebody
at
them.
So
it's
not
really
something
that's
crossed
my
mind.
I
would
imagine
that,
yes,
they
would
get
queued
some
way,
but
I
have
to
do
some
digging
and
then
come
up
with
a
real
good
answer,
but.
B
B
So
guys
we
are,
and
then
at
10
minutes
early
here
that
by
no
means
means
that
we
have
to
end
like
I
said
if
you
guys
won't
open
up
mics
and
ask
your
own
questions
you're
more
than
welcome
to
do
that.
If
you
have
something
you
want
to
throw
in
the
chat,
we'd
be
happy
to
pass
it
along
too,
and
if
you
just
want
to
BS
about
something
not
related
to
this
talk,
we
can
do
that
too.
But
we're
kind
of
finishing
up
here
but
I
want
you
guys
to
feel
welcome
to
chime.
B
A
B
A
B
A
B
Implement
that
is
that
just
they
just
literally
run
the
script,
and
it
just
keeps
them
so
I'll
window
yeah.
A
A
So
this
runs
is
a
scheduled
tasks
that
run
at
the
top
of
every
hour
on
my
print
server,
and
basically
this
is
how
it
does
it
I
fee
it
a
CSV
of
my
information
and
my
SNMP
string
and
then
the
threshold
that
I
want
posts
notified
on
and
then
the
computers
are,
the
the
computers
that
I
want
the
toast
notifications
to
to
go
to
I'm
using
this
particular
demo.
Script
uses
SNMP
a
Exe,
but
I
rewrote
the
production
script
that
I
have
to
use
the
Ola
PRN
dot,
o
le
SNMP
class.
A
B
B
On
this
on
this
call
with
us
we're
working
on
this
together,
we
would
love
anybody,
who's
willing
to
participate
in
that
project
and
help
develop
some
more
health
checks
for
Active
Directory
I
have
a
repo
out
on
github
we'd,
be
happy
to
share
that
information
with
you
one
of
the
reasons
I
mentioned.
This
is
Greg,
has
written
some
scripts
recently
that
write
events
to
the
event
log.
So
if
anybody
needs
some
examples
of
how
that
work,
even
if
you
don't
participate
at
all,
you
can
just
browse
our
code.
B
Look
some
of
our
scripts
and
see
how
we
wrote
event
bugs
to
the
event
wrote
event.
Notifications
to
the
event.
Pond
also
want
to
remind
everybody
that
if
you
appreciate
this
stuff,
if
you
haven't
already
get
on
on
Meetup,
but
also
join
Stephan
myself
and
the
others,
we
have
we're
on
the
PowerShell
slack
channel,
we
have
a
Raleigh
sub,
join
us
in
there.
We
talk
about
this
stuff
all
month
long
and
it
doesn't
have
to
end
tonight.
You
know
Stephen.
Believe
me,
Stephen
and
I
have
chatted
up
quite
a
bit.
B
The
last
few
weeks
he's
definitely
willing
to
help
people.
If
you
got
questions
problems,
things
like
that
so
hit
us
up
on
slack,
as
I
mentioned
the
repos.
This
was
recorded
we're
going
to
get
that
out
onto
YouTube,
eventually
in
just
a
few
days
and
we're
going
to
have
Stephen
for
a
copy
of
his
slides
and
his
demo
code
and
we'll
get
that
out
in
our
RTP
son
repository
I'm.