{"id":7081,"date":"2019-12-12T16:07:21","date_gmt":"2019-12-12T21:07:21","guid":{"rendered":"https:\/\/jdhitsolutions.com\/blog\/?p=7081"},"modified":"2019-12-12T16:07:27","modified_gmt":"2019-12-12T21:07:27","slug":"managing-my-powershell-backup-files","status":"publish","type":"post","link":"https:\/\/jdhitsolutions.com\/blog\/powershell\/7081\/managing-my-powershell-backup-files\/","title":{"rendered":"Managing My PowerShell Backup Files"},"content":{"rendered":"<p>Last month I started a project to begin <a title=\"re-visit the first article in the series\" href=\"https:\/\/jdhitsolutions.com\/blog\/?p=6905\" target=\"_blank\" rel=\"noopener noreferrer\">backing up critical folders<\/a>. This backup process is nothing more than another restore option should I need it. Still, it has been running for over a month and I now have a number of full backup files. I don't need to keep all of them. If I keep the 4 most recent full backups, that should be sufficient. Here's how I manage this process using PowerShell.<\/p>\n<p><!--more--><\/p>\n<p>When I create a full backup file, it gets copied to a share on my Synology NAS device. Here's what I have now.<\/p>\n<p><a href=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/12\/image-14.png\"><img loading=\"lazy\" decoding=\"async\" style=\"display: inline; background-image: none;\" title=\"backup file list\" src=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/12\/image_thumb-14.png\" alt=\"backup file list\" width=\"714\" height=\"772\" border=\"0\" \/><\/a><\/p>\n<p>If you recall, each file name includes what is in essence a set description; Scripts and Dropbox for example. It is easy enough to sort the files on the last write time and then delete accordingly.\u00a0 I have 5 sets\u00a0 and could run this:<\/p>\n<pre class=\"lang:ps mark:0 decode:true\">Get-childitem -Path \"\\\\ds416\\backup\\20*-full.rar\" |\nSort-Object -Property LastWriteTime -Descending |\nSelect-Object -Skip 20\n<\/pre>\n<p><a href=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/12\/image-15.png\"><img loading=\"lazy\" decoding=\"async\" style=\"display: inline; background-image: none;\" title=\"Files to delete\" src=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/12\/image_thumb-15.png\" alt=\"Files to delete\" width=\"1028\" height=\"486\" border=\"0\" \/><\/a><\/p>\n<p>I these should be the oldest files that I can delete. However, I don't want to make any assumptions. What if a full backup didn't complete one week or I manually ran an extra full backup? I need a more sophisticated approach. Let's start again.<\/p>\n<p>First, get all of the backup files.<\/p>\n<pre class=\"lang:ps mark:0 decode:true\">$files = Get-ChildItem -Path \"\\\\ds416\\backup\\20*-full.rar\" -file\n<\/pre>\n<p>Next, using a regular expression pattern to extract the backup set name, I group the files.<\/p>\n<pre class=\"lang:ps mark:0 decode:true\">$grouped = $files | Group-Object -property { ([regex]\"(?&lt;=_)\\w+(?=-)\").match($_.BaseName).value }\n<\/pre>\n<p>The regular expression is looking for text that is preceded by an _ and followed by a -. These are lookbehinds and lookaheads.<\/p>\n<p><a href=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/12\/image-16.png\"><img loading=\"lazy\" decoding=\"async\" style=\"display: inline; background-image: none;\" title=\"Grouped results\" src=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/12\/image_thumb-16.png\" alt=\"Grouped results\" width=\"1028\" height=\"255\" border=\"0\" \/><\/a><\/p>\n<p>Now I can process each group, sort the files and remove the oldest ones.<\/p>\n<pre class=\"lang:ps mark:0 decode:true\">foreach ($item in $grouped) {\n   $item.group | Sort-Object -property LastWriteTime -descending | Select-Object -skip 4 | Remove-Item -WhatIf\n}\n<\/pre>\n<p><a href=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/12\/image-17.png\"><img loading=\"lazy\" decoding=\"async\" style=\"display: inline; background-image: none;\" title=\"Removing old files\" src=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/12\/image_thumb-17.png\" alt=\"Removing old files\" width=\"1028\" height=\"273\" border=\"0\" \/><\/a><\/p>\n<p>Here's my complete backup trim PowerShell script.<\/p>\n<pre class=\"lang:ps mark:0 decode:true\">#MyBackupTrim.ps1\n\n#trim full backups to the last X number of files\n\n[cmdletbinding(SupportsShouldProcess)]\nParam(\n    [Parameter(Position = 0, HelpMessage = \"Specify the backup folder location\")]\n    [ValidateNotNullOrEmpty()]\n    [ValidateScript({Test-Path $_ })]\n    [string]$Path = \"\\\\ds416\\backup\",\n    [Parameter(HelpMessage = \"Specify a file pattern\")]\n    [ValidateNotNullOrEmpty()]\n    [string]$Pattern = \"*-FULL.rar\",\n    [Parameter(HelpMessage = \"Specify the number of the most recent files to keep\")]\n    [Validatescript({ $_ -ge 1 })]\n    [int]$Count = 4\n)\n\n$find = Join-Path -Path $path -ChildPath $pattern\nWrite-Verbose \"Finding backup files from $Find\"\nTry {\n    $files = Get-ChildItem -Path $find -file -ErrorAction Stop\n}\nCatch {\n    Throw $_\n}\n\nif ($files.count -gt 0) {\n    Write-Verbose \"Found $($files.count) backup files\"\n    # group the files based on the naming convention\n    # like 20191108_documents-FULL.rar and 20191108_Scripts-FULL.rar\n    # but make sure there are at least $Count number of files\n    $grouped = $files | Group-Object -property { ([regex]\"(?&lt;=_)\\w+(?=-)\").match($_.BaseName).value } | Where-Object { $_.count -gt $count}\n    if ($grouped) {\n        foreach ($item in $grouped) {\n            Write-Verbose \"Trimming $($item.name)\"\n            $item.group | Sort-Object -property LastWriteTime -descending | Select-Object -skip $count | Remove-Item\n        }\n    }\n    else {\n        Write-Host \"Not enough files to justify cleanup.\" -ForegroundColor magenta\n    }\n}\n\n#End of script\n<\/pre>\n<p><a href=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/12\/image-18.png\"><img loading=\"lazy\" decoding=\"async\" style=\"display: inline; background-image: none;\" title=\"Running the PowerShell script with -Whatif\" src=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/12\/image_thumb-18.png\" alt=\"Running the PowerShell script with -Whatif\" width=\"1028\" height=\"435\" border=\"0\" \/><\/a><\/p>\n<p>I can add this script to the end of my Weekly backup script and trim away old files. I can periodically check my backup folders manually to verify I'm only keeping what I really need. Otherwise I can kick back and let PowerShell do my work for me.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Last month I started a project to begin backing up critical folders. This backup process is nothing more than another restore option should I need it. Still, it has been running for over a month and I now have a number of full backup files. I don&#8217;t need to keep all of them. If I&#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 on the blog: Managing My #PowerShell Backup Files","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":[4],"tags":[201,534,540],"class_list":["post-7081","post","type-post","status-publish","format-standard","hentry","category-powershell","tag-backup","tag-powershell","tag-scripting"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Managing My PowerShell Backup Files &#8226; The Lonely Administrator<\/title>\n<meta name=\"description\" content=\"I&#039;ve been backing up files with PowerShell. Now I need a way to trim old backup files automatically. This is how I do it with Group-Object and regular expressions.\" \/>\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\/7081\/managing-my-powershell-backup-files\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Managing My PowerShell Backup Files &#8226; The Lonely Administrator\" \/>\n<meta property=\"og:description\" content=\"I&#039;ve been backing up files with PowerShell. Now I need a way to trim old backup files automatically. This is how I do it with Group-Object and regular expressions.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/jdhitsolutions.com\/blog\/powershell\/7081\/managing-my-powershell-backup-files\/\" \/>\n<meta property=\"og:site_name\" content=\"The Lonely Administrator\" \/>\n<meta property=\"article:published_time\" content=\"2019-12-12T21:07:21+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-12-12T21:07:27+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/12\/image_thumb-14.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=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/7081\\\/managing-my-powershell-backup-files\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/7081\\\/managing-my-powershell-backup-files\\\/\"},\"author\":{\"name\":\"Jeffery Hicks\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"headline\":\"Managing My PowerShell Backup Files\",\"datePublished\":\"2019-12-12T21:07:21+00:00\",\"dateModified\":\"2019-12-12T21:07:27+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/7081\\\/managing-my-powershell-backup-files\\\/\"},\"wordCount\":311,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"image\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/7081\\\/managing-my-powershell-backup-files\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2019\\\/12\\\/image_thumb-14.png\",\"keywords\":[\"Backup\",\"PowerShell\",\"Scripting\"],\"articleSection\":[\"PowerShell\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/7081\\\/managing-my-powershell-backup-files\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/7081\\\/managing-my-powershell-backup-files\\\/\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/7081\\\/managing-my-powershell-backup-files\\\/\",\"name\":\"Managing My PowerShell Backup Files &#8226; The Lonely Administrator\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/7081\\\/managing-my-powershell-backup-files\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/7081\\\/managing-my-powershell-backup-files\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2019\\\/12\\\/image_thumb-14.png\",\"datePublished\":\"2019-12-12T21:07:21+00:00\",\"dateModified\":\"2019-12-12T21:07:27+00:00\",\"description\":\"I've been backing up files with PowerShell. Now I need a way to trim old backup files automatically. This is how I do it with Group-Object and regular expressions.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/7081\\\/managing-my-powershell-backup-files\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/7081\\\/managing-my-powershell-backup-files\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/7081\\\/managing-my-powershell-backup-files\\\/#primaryimage\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2019\\\/12\\\/image_thumb-14.png\",\"contentUrl\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2019\\\/12\\\/image_thumb-14.png\",\"width\":714,\"height\":772},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/7081\\\/managing-my-powershell-backup-files\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"PowerShell\",\"item\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/category\\\/powershell\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Managing My PowerShell Backup Files\"}]},{\"@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":"Managing My PowerShell Backup Files &#8226; The Lonely Administrator","description":"I've been backing up files with PowerShell. Now I need a way to trim old backup files automatically. This is how I do it with Group-Object and regular expressions.","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\/7081\/managing-my-powershell-backup-files\/","og_locale":"en_US","og_type":"article","og_title":"Managing My PowerShell Backup Files &#8226; The Lonely Administrator","og_description":"I've been backing up files with PowerShell. Now I need a way to trim old backup files automatically. This is how I do it with Group-Object and regular expressions.","og_url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/7081\/managing-my-powershell-backup-files\/","og_site_name":"The Lonely Administrator","article_published_time":"2019-12-12T21:07:21+00:00","article_modified_time":"2019-12-12T21:07:27+00:00","og_image":[{"url":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/12\/image_thumb-14.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":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/7081\/managing-my-powershell-backup-files\/#article","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/7081\/managing-my-powershell-backup-files\/"},"author":{"name":"Jeffery Hicks","@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"headline":"Managing My PowerShell Backup Files","datePublished":"2019-12-12T21:07:21+00:00","dateModified":"2019-12-12T21:07:27+00:00","mainEntityOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/7081\/managing-my-powershell-backup-files\/"},"wordCount":311,"commentCount":1,"publisher":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"image":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/7081\/managing-my-powershell-backup-files\/#primaryimage"},"thumbnailUrl":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/12\/image_thumb-14.png","keywords":["Backup","PowerShell","Scripting"],"articleSection":["PowerShell"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/7081\/managing-my-powershell-backup-files\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/7081\/managing-my-powershell-backup-files\/","url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/7081\/managing-my-powershell-backup-files\/","name":"Managing My PowerShell Backup Files &#8226; The Lonely Administrator","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/7081\/managing-my-powershell-backup-files\/#primaryimage"},"image":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/7081\/managing-my-powershell-backup-files\/#primaryimage"},"thumbnailUrl":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/12\/image_thumb-14.png","datePublished":"2019-12-12T21:07:21+00:00","dateModified":"2019-12-12T21:07:27+00:00","description":"I've been backing up files with PowerShell. Now I need a way to trim old backup files automatically. This is how I do it with Group-Object and regular expressions.","breadcrumb":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/7081\/managing-my-powershell-backup-files\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/7081\/managing-my-powershell-backup-files\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/7081\/managing-my-powershell-backup-files\/#primaryimage","url":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/12\/image_thumb-14.png","contentUrl":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/12\/image_thumb-14.png","width":714,"height":772},{"@type":"BreadcrumbList","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/7081\/managing-my-powershell-backup-files\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"PowerShell","item":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},{"@type":"ListItem","position":2,"name":"Managing My PowerShell Backup Files"}]},{"@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":6955,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/6955\/creating-a-powershell-backup-system-part-3\/","url_meta":{"origin":7081,"position":0},"title":"Creating a PowerShell Backup System &#8211; Part 3","author":"Jeffery Hicks","date":"November 11, 2019","format":false,"excerpt":"Let's continue exploring my PowerShell based backup system. If you are just jumping in, be sure to read part 1 and part 2 first. At the end of the previous article I have set up a scheduled job that is logging changed files in key folders to CSV files. The\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\/2019\/11\/image_thumb-9.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-9.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/11\/image_thumb-9.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/11\/image_thumb-9.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":6905,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/6905\/creating-a-powershell-backup-system\/","url_meta":{"origin":7081,"position":1},"title":"Creating a PowerShell Backup System","author":"Jeffery Hicks","date":"November 7, 2019","format":false,"excerpt":"If you follow me on Twitter, you know that I have a monthly tweet reminder about running and testing backups. I have to say that the concept of a backup is different today than it was when I started in IT. Now we have cheap disk storage and cloud services.\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\/2019\/11\/image_thumb-4.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-4.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/11\/image_thumb-4.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/11\/image_thumb-4.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":6996,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/6996\/powershell-controller-scripts\/","url_meta":{"origin":7081,"position":2},"title":"PowerShell Controller Scripts","author":"Jeffery Hicks","date":"November 26, 2019","format":false,"excerpt":"When it comes to PowerShell scripting we tend to focus a lot on functions and modules. We place an emphasis on building re-usable tools. The idea is that we can then use these tools at a PowerShell prompt to achieve a given task. More than likely, these tasks are repetitive.\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\/2019\/11\/image_thumb-21.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-21.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/11\/image_thumb-21.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/11\/image_thumb-21.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":7422,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/7422\/backing-up-windows-terminal-settings-with-powershell\/","url_meta":{"origin":7081,"position":3},"title":"Backing Up Windows Terminal Settings with PowerShell","author":"Jeffery Hicks","date":"April 30, 2020","format":false,"excerpt":"I've been a big fan of Windows Terminal since the very beginning. In fact, I've been using it for so long that I've been moving along profile settings that have long since changed. I didn't bother to update my settings. Part of the challenge is that the app will update\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":[]},{"id":6962,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/6962\/creating-a-powershell-backup-system-part-4\/","url_meta":{"origin":7081,"position":4},"title":"Creating a PowerShell Backup System &#8211; Part 4","author":"Jeffery Hicks","date":"November 12, 2019","format":false,"excerpt":"We're almost to the end of my PowerShell backup system. Last time I showed you how I handle my daily incremental backups. Today I figured I should circle back and go over how I handle weekly full backups. Remember, I am only concerned about backing up a handful of critical\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\/2019\/11\/image_thumb-11.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-11.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/11\/image_thumb-11.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/11\/image_thumb-11.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":6910,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/6910\/creating-a-powershell-backup-system-part-2\/","url_meta":{"origin":7081,"position":5},"title":"Creating a PowerShell Backup System Part 2","author":"Jeffery Hicks","date":"November 8, 2019","format":false,"excerpt":"Yesterday I began a series of articles documenting my PowerShell based backup system. The core of my system is using the System.IO.FileSystemWatcher as a means to track daily file changes so I know what to backup. However there are some challenges. I need to watch several folders, I need to\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},"img":{"alt_text":"Checking pending files","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/11\/image_thumb-5.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-5.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/11\/image_thumb-5.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/11\/image_thumb-5.png?resize=700%2C400&ssl=1 2x"},"classes":[]}],"_links":{"self":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/7081","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=7081"}],"version-history":[{"count":0,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/7081\/revisions"}],"wp:attachment":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=7081"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=7081"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=7081"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}