File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,14 @@ public class SendBurntToastCommand : Cmdlet
1919 [ ValidateSet ( "Circle" , "Square" ) ]
2020 public string ? AppLogoCrop { get ; set ; }
2121
22+ [ Parameter ( Mandatory = false ) ]
23+ [ ValidateNotNullOrEmpty ]
24+ public string ? HeroImage { get ; set ; }
25+
26+ [ Parameter ( Mandatory = false ) ]
27+ [ ValidateNotNullOrEmpty ]
28+ public string ? Attribution { get ; set ; }
29+
2230 protected override void ProcessRecord ( )
2331 {
2432 WriteVerbose ( "Building toast notification..." ) ;
@@ -73,6 +81,24 @@ protected override void ProcessRecord()
7381
7482 builder . SetAppLogoOverride ( appLogoUri , appLogoCrop ) ;
7583
84+ if ( HeroImage != null )
85+ {
86+ string fullHeroImagePath = Path . GetFullPath ( HeroImage ) ;
87+
88+ if ( ! File . Exists ( fullHeroImagePath ) )
89+ {
90+ throw new FileNotFoundException ( $ "Hero Image file not found at path: { fullHeroImagePath } ") ;
91+ }
92+
93+ var heroImageUri = new Uri ( fullHeroImagePath ) ;
94+ builder . SetHeroImage ( heroImageUri ) ;
95+ }
96+
97+ if ( Attribution != null )
98+ {
99+ builder . SetAttributionText ( Attribution ) ;
100+ }
101+
76102 var appNotification = builder . BuildNotification ( ) ;
77103
78104 AppNotificationManager . Default . Show ( appNotification ) ;
You can’t perform that action at this time.
0 commit comments