{"id":4471,"date":"2015-07-24T11:16:19","date_gmt":"2015-07-24T15:16:19","guid":{"rendered":"http:\/\/jdhitsolutions.com\/blog\/?p=4471"},"modified":"2015-07-24T11:24:35","modified_gmt":"2015-07-24T15:24:35","slug":"friday-fun-tickle-me-powershell","status":"publish","type":"post","link":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4471\/friday-fun-tickle-me-powershell\/","title":{"rendered":"Friday Fun: Tickle Me PowerShell!"},"content":{"rendered":"<p>I work at home for myself which means I have to act as my own assistant, reminding me of important events and tasks. And sometimes I need a little help. So why not use PowerShell? In the past I've used and written about using a background job to wait until a certain number of minutes have passed and then display a popup message using the MSG.EXE command line utility. The drawback to my previous approach is that if I close my PowerShell session I lose the background job. For reminders in the next 10-30 minutes perhaps that's ok. But for longer term reminders, I need a better solution.<\/p>\n<p>I don't know why I didn't go this route from the beginning, but I can accomplish the same result using a PowerShell scheduled job. A PowerShell scheduled job runs via the task scheduler which means it persists outside of PowerShell. All I really need are three things:<\/p>\n<ol>\n<li>The time to kick off the task<\/li>\n<li>The command to run<\/li>\n<li>A registered scheduled job object<\/li>\n<\/ol>\n<p>The time to kick off is the Job Trigger. Here's how I can create a trigger for 30 minutes from now. My reminder only needs to run once.<\/p>\n<pre><code>$trigger = New-Jobtrigger -Once -at (Get-Date).AddMinutes(30)<\/code><\/pre>\n<p>The command will be the MSG.EXE command.<\/p>\n<pre><code>$cmd = \"msg.exe $env:username Important phone call in 5 minutes\"<\/code><\/pre>\n<p>This needs to be in the form of a script block.<\/p>\n<pre class=\"lang:ps decode:true \">$sb = {\r\nParam($cmd,$jobname)\r\nInvoke-Expression $cmd\r\n#forcibly remove the scheduledjob\r\nGet-ScheduledJob -Name $jobname | Unregister-ScheduledJob -Force\r\n}<\/pre>\n<p>In my scriptblock I'm also going to delete the scheduled job. Finally I need to register it.<\/p>\n<pre><code>$jobname = \"phone call\"\r\nRegister-ScheduledJob -ScriptBlock $sb -Name $jobName -MaxResultCount 1 -Trigger $Trigger -ArgumentList $cmd,$jobname\r\n<\/code><\/pre>\n<p>When the time arrives I get a popup message on my screen.<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2015\/07\/072415_1516_FridayFunTi1.png\" alt=\"sample popup reminder\" \/><br \/>\n<span style=\"color: #44546a; font-size: 9pt;\"><em>sample popup reminder<\/em><\/span><\/p>\n<p>You can configure how long the message will be displayed before it is automatically dismissed. That's the essential part of the process. Here is the complete script to define the function, including an optional alias.<\/p>\n<pre class=\"lang:ps decode:true \">#requires -version 4.0\r\n#requires -module PSScheduledJob\r\n\r\nFunction New-ScheduledReminderJob {\r\n\r\n&lt;#\r\n.Synopsis\r\nCreate a scheduled reminder background job.\r\n.Description\r\nThis command uses the MSG.EXE command line tool to send a reminder message to the currently logged on user, presumably yourself. The intention is to set ad-hoc popup reminders for the current user. The message will automatically dismiss after 1 minute unless you use the Wait parameter.\r\n\r\nYou can schedule the reminder for a certain number of minutes set the reminder to run at a specific date and time. The default is to schedule a reminder in 1 minute.\r\n\r\nThe function creates a scheduled background job so that you can close your PowerShell session without losing the job as well as persisting during reboots. The scheduled job will be removed upon completion. \r\n\r\n.Parameter Message\r\nThe text to display in the popup.\r\n.Parameter Time\r\nThe date and time to display the popup. If you enter just a time, it will default to the current day. See examples. \r\nThis parameter has aliases of date and dt. \r\n.Parameter JobName\r\nA name to assign to the job. If you don't specify a name, the function will use the name Reminder-N where N is an incrementing counter starting at 1. This parameter has an alias of Name.\r\n.Parameter Minutes\r\nThe number of minutes to wait before displaying the popup message.\r\n.Parameter Wait\r\nThe number of minutes to display the message before it automatically is dismissed. The default is 1 minute.\r\n.Example\r\nPS C:\\&gt; new-scheduledreminderjob \"Switch over laundry\" -minutes 40 -name SwitchLaundry\r\n\r\nId         Name            JobTriggers     Command                                  Enabled   \r\n--         ----            -----------     -------                                  -------   \r\n1          SwitchLaundry   1               ...                                      True\r\n\r\nThis command creates a new job that will display a message in 40 minutes\r\n.Example\r\nPS C:\\&gt; new-scheduledreminderjob \"Go home\" -time \"5:00PM\" -wait 2 | out-null\r\n\r\nCreate a reminder to be displayed at 5:00PM today for 2 minutes but don't display the job result.\r\n\r\n.Notes\r\nLast Updated: July 24, 2015\r\nVersion     : 2.2\r\nAuthor      : Jeff Hicks (@JeffHicks)\r\n              http:\/\/jdhitsolutions.com\/blog\r\n\r\nLearn more about PowerShell:\r\n<blockquote class=\"wp-embedded-content\" data-secret=\"sZNNFSvbsv\"><a href=\"https:\/\/jdhitsolutions.com\/blog\/essential-powershell-resources\/\">Essential PowerShell Learning Resources<\/a><\/blockquote><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" title=\"&#8220;Essential PowerShell Learning Resources&#8221; &#8212; The Lonely Administrator\" src=\"https:\/\/jdhitsolutions.com\/blog\/essential-powershell-resources\/embed\/#?secret=CskqpMlzUw#?secret=sZNNFSvbsv\" data-secret=\"sZNNFSvbsv\" width=\"600\" height=\"338\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe>\r\n\r\n  ****************************************************************\r\n  * DO NOT USE IN A PRODUCTION ENVIRONMENT UNTIL YOU HAVE TESTED *\r\n  * THOROUGHLY IN A LAB ENVIRONMENT. USE AT YOUR OWN RISK.  IF   *\r\n  * YOU DO NOT UNDERSTAND WHAT THIS SCRIPT DOES OR HOW IT WORKS, *\r\n  * DO NOT USE IT OUTSIDE OF A SECURE, TEST SETTING.             *\r\n  ****************************************************************\r\n\r\n.Link\r\nmsg.exe\r\nRegister-ScheduledJob\r\n.Inputs\r\nNone\r\n.Outputs\r\nScheduledJob\r\n#&gt;\r\n\r\n[cmdletbinding(DefaultParameterSetName=\"Minutes\",SupportsShouldProcess)]\r\nParam(\r\n[Parameter(Position=0,Mandatory,HelpMessage=\"Enter the alert message text\")]\r\n[string]$Message,\r\n[Parameter(ParameterSetName=\"Time\")]\r\n[ValidateNotNullorEmpty()]\r\n[Alias(\"date\",\"dt\")]\r\n[datetime]$Time,\r\n[Parameter(ParameterSetName=\"Minutes\")]\r\n[ValidateNotNullorEmpty()]\r\n[int]$Minutes = 1,\r\n[Alias(\"Name\")]\r\n[string]$JobName,\r\n[int]$Wait = 1\r\n)\r\n\r\nBegin {\r\n    Write-Verbose -Message \"[Starting] $($MyInvocation.Mycommand)\"  \r\n   \r\n} #begin\r\n\r\nProcess {\r\n Write-Verbose -Message \"[Trace] Parameter set = $($PSCmdlet.ParameterSetName)\"\r\n    If ($PSCmdlet.ParameterSetName -eq 'Minutes') {\r\n     #calculate the scheduled job time from the number of minutes\r\n     [datetime]$Time= (Get-Date).AddMinutes($minutes)\r\n    }\r\n\r\n    #create the scheduled job trigger\r\n    $Trigger = New-JobTrigger -At $Time -Once\r\n    Write-Verbose \"[Trace] Reminder Time = $Time\"\r\n\r\n    if (-Not $JobName) {\r\n        #get last job ID to build the jobname\r\n        #ignore any errors if job not found\r\n        Write-Verbose \"[Status] Checking for previous Reminder scheduled jobs\"\r\n        $lastjob = Get-ScheduledJob -Name \"Reminder*\" -ErrorAction SilentlyContinue | sort ID | select -last 1\r\n    \r\n        if ($lastjob) {\r\n            #define a regular expression\r\n            [regex]$rx =\"\\d+$\"\r\n            #extract the counter number\r\n            [string]$counter = ([int]$rx.Match($lastJob.name).Value +1)\r\n        }\r\n        else {\r\n            [string]$counter = 1\r\n        }\r\n        #define the job name\r\n        $jobName = \"Reminder-$Counter\"\r\n    } #if no job name specified\r\n\r\n    Write-Verbose -Message \"[Trace] Jobname = $jobname\"\r\n    \r\n    #define the msg.exe expression   \r\n    [int]$WaitTime = $Wait * 60\r\n    Write-Verbose \"[Trace] Display Wait time = $WaitTime seconds\"\r\n    Write-Verbose \"[Status] Defining expression\"\r\n    [string]$cmd = \"msg.exe $env:username \/Time:$WaitTime $Message\"\r\n    \r\n    Write-Verbose \"[Trace] Command to execute = $cmd\"\r\n    \r\n    #the scriptblock to run\r\n    $sb = {\r\n    Param($cmd,$jobname)\r\n    Invoke-Expression $cmd\r\n    #forcibly remove the scheduledjob\r\n    Get-ScheduledJob -Name $jobname | Unregister-ScheduledJob -Force\r\n    }\r\n\r\n    Write-Verbose \"[Trace] Scriptblock = $($sb | Out-String)\"\r\n\r\n    #add some options to support laptop users\r\n    Write-Verbose \"[Status] Creating scheduled job options\"\r\n    $options = New-ScheduledJobOption -ContinueIfGoingOnBattery -WakeToRun\r\n\r\n    #create the scheduled job\r\n    Write-Verbose \"[Status] Registering the scheduled reminder job\"\r\n    Register-ScheduledJob -ScriptBlock $sb -Name $jobName -MaxResultCount 1 -Trigger $Trigger -ArgumentList $cmd,$jobname\r\n \r\n} #process\r\n\r\nEnd {\r\n    Write-Verbose -Message \"[Status] Ending $($MyInvocation.Mycommand)\"\r\n} #end\r\n\r\n} #end function\r\n\r\n#add an alias\r\nSet-Alias -Name Tickle -Value New-ScheduledReminderJob\r\n<\/pre>\n<p>Now I can easily set reminders for myself, even something tomorrow, next week or next month. I can use the scheduled job cmdlets to manage my reminders. I wrote this with the assumption that you are setting popup reminders for yourself.<\/p>\n<p>Let me know what you think.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I work at home for myself which means I have to act as my own assistant, reminding me of important events and tasks. And sometimes I need a little help. So why not use PowerShell? In the past I&#8217;ve used and written about using a background job to wait until a certain number of minutes&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"New Friday Fun! Tickle Me #PowerShell","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[271,4],"tags":[568,534,383,540],"class_list":["post-4471","post","type-post","status-publish","format-standard","hentry","category-friday-fun","category-powershell","tag-friday-fun","tag-powershell","tag-scheduled-job","tag-scripting"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Friday Fun: Tickle Me PowerShell! &#8226; The Lonely Administrator<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/jdhitsolutions.com\/blog\/powershell\/4471\/friday-fun-tickle-me-powershell\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Friday Fun: Tickle Me PowerShell! &#8226; The Lonely Administrator\" \/>\n<meta property=\"og:description\" content=\"I work at home for myself which means I have to act as my own assistant, reminding me of important events and tasks. And sometimes I need a little help. So why not use PowerShell? In the past I&#039;ve used and written about using a background job to wait until a certain number of minutes...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/jdhitsolutions.com\/blog\/powershell\/4471\/friday-fun-tickle-me-powershell\/\" \/>\n<meta property=\"og:site_name\" content=\"The Lonely Administrator\" \/>\n<meta property=\"article:published_time\" content=\"2015-07-24T15:16:19+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2015-07-24T15:24:35+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2015\/07\/072415_1516_FridayFunTi1.png\" \/>\n<meta name=\"author\" content=\"Jeffery Hicks\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@JeffHicks\" \/>\n<meta name=\"twitter:site\" content=\"@JeffHicks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Jeffery Hicks\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/4471\\\/friday-fun-tickle-me-powershell\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/4471\\\/friday-fun-tickle-me-powershell\\\/\"},\"author\":{\"name\":\"Jeffery Hicks\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"headline\":\"Friday Fun: Tickle Me PowerShell!\",\"datePublished\":\"2015-07-24T15:16:19+00:00\",\"dateModified\":\"2015-07-24T15:24:35+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/4471\\\/friday-fun-tickle-me-powershell\\\/\"},\"wordCount\":344,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"image\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/4471\\\/friday-fun-tickle-me-powershell\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2015\\\/07\\\/072415_1516_FridayFunTi1.png\",\"keywords\":[\"Friday Fun\",\"PowerShell\",\"scheduled job\",\"Scripting\"],\"articleSection\":[\"Friday Fun\",\"PowerShell\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/4471\\\/friday-fun-tickle-me-powershell\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/4471\\\/friday-fun-tickle-me-powershell\\\/\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/4471\\\/friday-fun-tickle-me-powershell\\\/\",\"name\":\"Friday Fun: Tickle Me PowerShell! &#8226; The Lonely Administrator\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/4471\\\/friday-fun-tickle-me-powershell\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/4471\\\/friday-fun-tickle-me-powershell\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2015\\\/07\\\/072415_1516_FridayFunTi1.png\",\"datePublished\":\"2015-07-24T15:16:19+00:00\",\"dateModified\":\"2015-07-24T15:24:35+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/4471\\\/friday-fun-tickle-me-powershell\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/4471\\\/friday-fun-tickle-me-powershell\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/4471\\\/friday-fun-tickle-me-powershell\\\/#primaryimage\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2015\\\/07\\\/072415_1516_FridayFunTi1.png\",\"contentUrl\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2015\\\/07\\\/072415_1516_FridayFunTi1.png\",\"width\":298,\"height\":167},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/4471\\\/friday-fun-tickle-me-powershell\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Friday Fun\",\"item\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/category\\\/friday-fun\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Friday Fun: Tickle Me PowerShell!\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/\",\"name\":\"The Lonely Administrator\",\"description\":\"Practical Advice for the Automating IT Pro\",\"publisher\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\",\"name\":\"Jeffery Hicks\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg\",\"caption\":\"Jeffery Hicks\"},\"logo\":{\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Friday Fun: Tickle Me PowerShell! &#8226; The Lonely Administrator","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4471\/friday-fun-tickle-me-powershell\/","og_locale":"en_US","og_type":"article","og_title":"Friday Fun: Tickle Me PowerShell! &#8226; The Lonely Administrator","og_description":"I work at home for myself which means I have to act as my own assistant, reminding me of important events and tasks. And sometimes I need a little help. So why not use PowerShell? In the past I've used and written about using a background job to wait until a certain number of minutes...","og_url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4471\/friday-fun-tickle-me-powershell\/","og_site_name":"The Lonely Administrator","article_published_time":"2015-07-24T15:16:19+00:00","article_modified_time":"2015-07-24T15:24:35+00:00","og_image":[{"url":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2015\/07\/072415_1516_FridayFunTi1.png","type":"","width":"","height":""}],"author":"Jeffery Hicks","twitter_card":"summary_large_image","twitter_creator":"@JeffHicks","twitter_site":"@JeffHicks","twitter_misc":{"Written by":"Jeffery Hicks","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4471\/friday-fun-tickle-me-powershell\/#article","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4471\/friday-fun-tickle-me-powershell\/"},"author":{"name":"Jeffery Hicks","@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"headline":"Friday Fun: Tickle Me PowerShell!","datePublished":"2015-07-24T15:16:19+00:00","dateModified":"2015-07-24T15:24:35+00:00","mainEntityOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4471\/friday-fun-tickle-me-powershell\/"},"wordCount":344,"commentCount":1,"publisher":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"image":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4471\/friday-fun-tickle-me-powershell\/#primaryimage"},"thumbnailUrl":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2015\/07\/072415_1516_FridayFunTi1.png","keywords":["Friday Fun","PowerShell","scheduled job","Scripting"],"articleSection":["Friday Fun","PowerShell"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/4471\/friday-fun-tickle-me-powershell\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4471\/friday-fun-tickle-me-powershell\/","url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4471\/friday-fun-tickle-me-powershell\/","name":"Friday Fun: Tickle Me PowerShell! &#8226; The Lonely Administrator","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4471\/friday-fun-tickle-me-powershell\/#primaryimage"},"image":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4471\/friday-fun-tickle-me-powershell\/#primaryimage"},"thumbnailUrl":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2015\/07\/072415_1516_FridayFunTi1.png","datePublished":"2015-07-24T15:16:19+00:00","dateModified":"2015-07-24T15:24:35+00:00","breadcrumb":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4471\/friday-fun-tickle-me-powershell\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/4471\/friday-fun-tickle-me-powershell\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4471\/friday-fun-tickle-me-powershell\/#primaryimage","url":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2015\/07\/072415_1516_FridayFunTi1.png","contentUrl":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2015\/07\/072415_1516_FridayFunTi1.png","width":298,"height":167},{"@type":"BreadcrumbList","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4471\/friday-fun-tickle-me-powershell\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Friday Fun","item":"https:\/\/jdhitsolutions.com\/blog\/category\/friday-fun\/"},{"@type":"ListItem","position":2,"name":"Friday Fun: Tickle Me PowerShell!"}]},{"@type":"WebSite","@id":"https:\/\/jdhitsolutions.com\/blog\/#website","url":"https:\/\/jdhitsolutions.com\/blog\/","name":"The Lonely Administrator","description":"Practical Advice for the Automating IT Pro","publisher":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/jdhitsolutions.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9","name":"Jeffery Hicks","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg","url":"https:\/\/secure.gravatar.com\/avatar\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg","caption":"Jeffery Hicks"},"logo":{"@id":"https:\/\/secure.gravatar.com\/avatar\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg"}}]}},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"jetpack-related-posts":[{"id":5884,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/5884\/email-reminders-for-powershell-tasks\/","url_meta":{"origin":4471,"position":0},"title":"Email Reminders for PowerShell Tasks","author":"Jeffery Hicks","date":"February 7, 2018","format":false,"excerpt":"I've published a new version of the myTasks module to the PowerShell Gallery and its GitHub repository. The big change is that the current version has a feature to send you a daily email with tasks that are due in the next three days. I've added a command called Enable-EmailReminder\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2018\/02\/image_thumb-1.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2018\/02\/image_thumb-1.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2018\/02\/image_thumb-1.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2018\/02\/image_thumb-1.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":3865,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3865\/powershell-reminder-jobs\/","url_meta":{"origin":4471,"position":1},"title":"PowerShell Reminder Jobs","author":"Jeffery Hicks","date":"May 27, 2014","format":false,"excerpt":"This is something that might be better suited to one of my Friday Fun columns, but I'm enjoying this so much I couldn't wait to share it. I don't know about you but I spend much of my day in PowerShell or at least with a PowerShell session running. I\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},"img":{"alt_text":"timer","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2014\/05\/timer.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":2297,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/2297\/sql-saturday-129-session-material\/","url_meta":{"origin":4471,"position":2},"title":"SQL Saturday 129 Session Material","author":"Jeffery Hicks","date":"May 14, 2012","format":false,"excerpt":"I spoke this past weekend at a SQL Saturday event in Rochester, NY. My first SQL Saturday event and it was a lot of fun. A great turnout and some very interested attendees. I did three PowerShell sessions on jobs, scheduled jobs\/tasks and an intro to workflows. The latter talk\u2026","rel":"","context":"In &quot;Conferences&quot;","block_context":{"text":"Conferences","link":"https:\/\/jdhitsolutions.com\/blog\/category\/conferences\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/10\/talkbubble-150x150.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":7003,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/7003\/friday-fun-getting-ahead-with-windows-terminal\/","url_meta":{"origin":4471,"position":3},"title":"Friday Fun: Getting Ahead with Windows Terminal","author":"Jeffery Hicks","date":"November 29, 2019","format":false,"excerpt":"I've been using the new Windows Terminal from Microsoft for quite while. In fact, it has become my standard command line interface for PowerShell and more. I'm not sure at what point some of these features were added, but I can now set a background image and specify where to\u2026","rel":"","context":"In &quot;Friday Fun&quot;","block_context":{"text":"Friday Fun","link":"https:\/\/jdhitsolutions.com\/blog\/category\/friday-fun\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/11\/image_thumb-23.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/11\/image_thumb-23.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/11\/image_thumb-23.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/11\/image_thumb-23.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":2646,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/2646\/friday-fun-job-announcer\/","url_meta":{"origin":4471,"position":4},"title":"Friday Fun: Job Announcer","author":"Jeffery Hicks","date":"December 28, 2012","format":false,"excerpt":"Last week I came across some people having fun with the SAPI.SPVoice COM object. This is the object that lets your computer \"speak\". If you've never played with this, it is very simple to do in PowerShell. The voice quality in Windows 7 and 8 is quite nice, as far\u2026","rel":"","context":"In &quot;Friday Fun&quot;","block_context":{"text":"Friday Fun","link":"https:\/\/jdhitsolutions.com\/blog\/category\/friday-fun\/"},"img":{"alt_text":"announcer-blue","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2012\/12\/announcer-blue.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":3648,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3648\/remove-all-but-most-recent-powershell-job\/","url_meta":{"origin":4471,"position":5},"title":"Remove All but Most Recent PowerShell job","author":"Jeffery Hicks","date":"April 21, 2014","format":false,"excerpt":"I like sending little PowerShell tweet tips, but this one is a bit too long for Twitter. Here is a one-liner to remove all but the most recent job result for each job name. get-job | group Name | foreach { $_.group | sort PSEndTime -descending | Select -skip 1\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/4471","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/comments?post=4471"}],"version-history":[{"count":0,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/4471\/revisions"}],"wp:attachment":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=4471"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=4471"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=4471"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}