Skip to content

Instantly share code, notes, and snippets.

@bsj17
bsj17 / CheckHeadPhonesBattery.ps1
Last active October 18, 2022 07:19
Script that creates scheduled task which checks Jabra log and send tost notification when battery goes under threshold
function GenHostOptions () {
$Yes = New-Object System.Management.Automation.Host.ChoiceDescription '&Yes', 'Yes'
$No = New-Object System.Management.Automation.Host.ChoiceDescription '&No', 'No'
$options = [System.Management.Automation.Host.ChoiceDescription[]]($Yes, $No)
$title = 'Jabra battery notification'
$message = "Do you want to proceed creating and enabling Scheduled job?"
$result = $host.ui.PromptForChoice($title, $message, $options, 0)
switch ($result ) {
0 { $true }
{
"final_space": true,
"console_title": true,
"console_title_style": "folder",
"blocks": [
{
"type": "prompt",
"alignment": "left",
"horizontal_offset": 0,
"vertical_offset": 0,