File tree Expand file tree Collapse file tree 1 file changed +22
-7
lines changed
Expand file tree Collapse file tree 1 file changed +22
-7
lines changed Original file line number Diff line number Diff line change 1616# You should have received a copy of the GNU Affero General Public License
1717# along with this program. If not, see <https://www.gnu.org/licenses/>.
1818
19+ [CmdletBinding ()]
1920param (
20- [parameter (mandatory = $true )][string ]$body ,
21- [parameter (mandatory = $false )][string ]$title ,
22- [parameter (mandatory = $false )][string ]$detail
21+ [string ]$body ,
22+ [string ]$title ,
23+ [string ]$detail ,
24+ [switch ]$version
2325)
2426
27+ $ToastCliVersion = ' 0.0.1'
28+
2529function Show-Toast {
2630 param (
27- [parameter ( mandatory = $false )][string ]$title ,
28- [parameter ( mandatory = $false )][string ]$message ,
29- [parameter ( mandatory = $false )][string ]$detail
31+ [Parameter ( Mandatory = $false )][string ]$title ,
32+ [Parameter ( Mandatory = $false )][string ]$message ,
33+ [Parameter ( Mandatory = $false )][string ]$detail
3034 )
3135
3236 [Windows.UI.Notifications.ToastNotificationManager , Windows.UI.Notifications , ContentType = WindowsRuntime ] | Out-Null
@@ -52,4 +56,15 @@ function Show-Toast {
5256 [Windows.UI.Notifications.ToastNotificationManager ]::CreateToastNotifier($app_id ).Show($toast )
5357}
5458
55- Show-Toast - title $title - message $body - detail $detail
59+ if ($version ) {
60+ Write-Output " $ ( $MyInvocation.MyCommand.Name ) $ToastCliVersion "
61+ } else {
62+ if ($body ) {
63+ Show-Toast - title $title - message $body - detail $detail
64+ } else {
65+ Write-Error " Missing required argument: -Body. See -? for usage."
66+ exit 1
67+ }
68+ }
69+
70+ exit 0
You can’t perform that action at this time.
0 commit comments