Add-BTAppLogo

SYNOPSIS

Override the app logo with a custom image of choice that will be displayed on the toast.

SYNTAX

1
Add-BTAppLogo -ContentBuilder <ToastContentBuilder> [[-Source] <String>] [-Crop <AdaptiveImageCrop>]
2
[-AlternateText <String>] [-IgnoreCache] [-PassThru] [<CommonParameters>]
Copied!

DESCRIPTION

The Add-BTAppLogo function specifies an image to be displayed on a toast notification as the app logo.
Prior to Windows 10 20H2 this app logo would replace the smaller icon that represents the source of a notification, but from 20H2 it is displayed in addition to the icon.

EXAMPLES

EXAMPLE 1

1
$Builder = New-BTContentBuilder
Copied!
PS C:\>Add-BTAppLogo -ContentBuilder $Builder -Source 'C:\Temp\LocalImage.png'
This example adds a local image as the app logo on the toast notification using a toast content builder object.

EXAMPLE 2

1
$Builder = New-BTContentBuilder
Copied!
PS C:\>$Builder | Add-BTAppLogo -Source '\\FS01\Images$\NetworkImage.gif'
This example adds an image from a network share as the app logo on the toast notification being constructed.

EXAMPLE 3

1
$Builder = New-BTContentBuilder
2
$Builder | Add-BTAppLogo -Source 'https://example.com/OnlineImage.jpeg'
Copied!
This example adds an image from the internet as the app logo on the toast notification being constructed.
Future invocations of this example will used a cached copy of the referenced image rather than going out to the internet again.

EXAMPLE 4

1
$Builder = New-BTContentBuilder
2
$Builder | Add-BTAppLogo -Source 'https://example.com/OnlineImage.jpeg' -IgnoreCache
Copied!
This example adds an image from the internet as the app logo on the toast notification being constructed, it downloads the image from the internet regardless of if it has been previously cached.

EXAMPLE 5

1
$Builder = New-BTContentBuilder
2
$Builder | Add-BTAppLogo -Source 'C:\Temp\LocalImage.png' -AlternateText 'Picture of burnt toast, popped out of a toaster'
Copied!
This example adds a local image as the app logo on the toast notification with supplied alt text to aid with accessibility e.g. the use of screen readers.

EXAMPLE 6

1
$Builder = New-BTContentBuilder
2
$Builder | Add-BTAppLogo -Source 'C:\Temp\LocalImage.png' -Crop Circle
Copied!
This example adds a local image as the app logo on the toast notification cropped into the shape of a circle, overriding the default square shape.

EXAMPLE 7

1
$Builder = New-BTContentBuilder
2
$Builder | Add-BTAppLogo -Source 'C:\Temp\LocalImage.png' -PassThru |
3
Add-BTText -Text 'First Line of Text' -PassThru |
4
Add-BTText -Text 'Second Line of Text'
Copied!
This example an app logo followed by three custom text elements to a toast content builder object on the pipeline by passing through a refference to the builder object.

PARAMETERS

-ContentBuilder

The toast content builder object that represents the toast notification being constructed.
1
Type: ToastContentBuilder
2
Parameter Sets: (All)
3
Aliases:
4
5
Required: True
6
Position: Named
7
Default value: None
8
Accept pipeline input: True (ByValue)
9
Accept wildcard characters: False
Copied!

-Source

The URI of the image. Can be from your local computer, network location, or the internet. Online images will be downloaded and cached in the user's TEMP directory for future use.
1
Type: String
2
Parameter Sets: (All)
3
Aliases:
4
5
Required: False
6
Position: 1
7
Default value: $Script:DefaultImage
8
Accept pipeline input: False
9
Accept wildcard characters: False
Copied!

-Crop

Specify how the image should be cropped.
1
Type: AdaptiveImageCrop
2
Parameter Sets: (All)
3
Aliases:
4
Accepted values: Default, None, Circle
5
6
Required: False
7
Position: Named
8
Default value: Default
9
Accept pipeline input: False
10
Accept wildcard characters: False
Copied!

-AlternateText

A description of the image, for users of assistive technologies.
1
Type: String
2
Parameter Sets: (All)
3
Aliases:
4
5
Required: False
6
Position: Named
7
Default value: None
8
Accept pipeline input: False
9
Accept wildcard characters: False
Copied!

-IgnoreCache

Specify that the online images should be downloaded, regardless of if they have been cached to the TEMP directory. Used when the online resource has been updated and you need to ensure that users see the latest version.
1
Type: SwitchParameter
2
Parameter Sets: (All)
3
Aliases:
4
5
Required: False
6
Position: Named
7
Default value: False
8
Accept pipeline input: False
9
Accept wildcard characters: False
Copied!

-PassThru

Returns an object that represents the item with which you're working. By default, this cmdlet doesn't generate any output.
1
Type: SwitchParameter
2
Parameter Sets: (All)
3
Aliases:
4
5
Required: False
6
Position: Named
7
Default value: False
8
Accept pipeline input: False
9
Accept wildcard characters: False
Copied!

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

Microsoft.Toolkit.Uwp.Notifications.ToastContentBuilder

You can pipe a toast content builder object to Add-BTAppLogo.

System.Uri

One image reference can be provided, this cannot be piped to Add-BTAppLogo.

OUTPUTS

None

The Add-BTAppLogo function does not provide any output by default.
You can optionally use the PassThru parameter to output the updated toast content builder object, which enables chaining functions together.

NOTES

You can reference an image from your local computer, a network location, or the internet.
Online images will be downloaded and cached in the user's TEMP directory for future use.
Animated GIFs and images with transparent background are supported.

RELATED LINKS