{"id":6629,"date":"2019-04-02T15:29:38","date_gmt":"2019-04-02T19:29:38","guid":{"rendered":"https:\/\/jdhitsolutions.com\/blog\/?p=6629"},"modified":"2019-04-02T15:29:46","modified_gmt":"2019-04-02T19:29:46","slug":"extending-powershell-and-docker-containers","status":"publish","type":"post","link":"https:\/\/jdhitsolutions.com\/blog\/powershell\/6629\/extending-powershell-and-docker-containers\/","title":{"rendered":"Extending PowerShell and Docker Containers"},"content":{"rendered":"<p>I've been continuing to tinker with my PowerShell command for getting information about Docker containers. The Docker CLI is fine, but it is very difficult to work with the output or do much with it. That's why I prefer to have objects in a PowerShell pipeline. One of the Docker container elements that I ignored until now was the container size. The whole beauty of containers is that they are small by design so why not get that information as well?<\/p>\n<p><!--more--><\/p>\n<h2>Container Size<\/h2>\n<p>You can use the Docker CLI to display a container size.<\/p>\n<p><a href=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/04\/image.png\"><img loading=\"lazy\" decoding=\"async\" style=\"display: inline; background-image: none;\" title=\"Getting docker container size\" src=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/04\/image_thumb.png\" alt=\"Getting docker container size\" width=\"1028\" height=\"170\" border=\"0\" \/><\/a><\/p>\n<p>From what I can tell, this is the size of writable layers in the container. For me this always seems to be 0 bytes. Still, eventually I might have a container with an actual value so I need some code to extract it.<\/p>\n<pre class=\"lang:ps mark:0 decode:true\">$name = \"cow1\"\n$sz = docker ps -asf \"name=$name\" --format \"{{json .}}\" | Convertfrom-json | Select -expandproperty size\n[regex]$rx = \"\\d+\"\n$szbytes = $rx.match($sz).value\n<\/pre>\n<p>Using the JSON trick I discussed last time I can extract the Size property which in my case will be 0B. I use a regular expression pattern to get just the numeric portion of this string, or 0.<\/p>\n<h2>Get Docker Files<\/h2>\n<p>Each container also includes a set of files, such as logs, which are stored in the Docker program location. Using a little PowerShell processing, I can get that location from Docker system information.<\/p>\n<pre class=\"lang:ps mark:0 decode:true\">$dockpath = ((docker system info | select-string \"docker root dir\") -split \": \")[1]\n<\/pre>\n<p>In Windows, this should be C:\\ProgramData\\Docker.\u00a0 Each container has its own directory.<\/p>\n<p><a href=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/04\/image-1.png\"><img loading=\"lazy\" decoding=\"async\" style=\"display: inline; background-image: none;\" title=\"Docker container folders\" src=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/04\/image_thumb-1.png\" alt=\"Docker container folders\" width=\"1028\" height=\"377\" border=\"0\" \/><\/a><\/p>\n<p>The folder name is the container ID which I already know how to get. From there it is a simple matter of measuring the total size of all files.<\/p>\n<pre class=\"lang:ps mark:0 decode:true\">$name = \"cow1\"\n$ID = (docker inspect $name --format \"{{json .ID}}\") -replace '\"',''\n$stat = Get-Childitem (join-path $dockpath \"containers\\$ID\") -file -recurse | \nMeasure-Object -Property length -sum\n<\/pre>\n<p>$Stat gives me a sum value of 11977.<\/p>\n<h2>Include Docker Container Volumes<\/h2>\n<p>Finally, a container might have an associated volume for persistent storage.<\/p>\n<pre class=\"lang:ps mark:0 decode:true\">$c = docker inspect cow1 | Convertfrom-json\n<\/pre>\n<p><a href=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/04\/image-2.png\"><img loading=\"lazy\" decoding=\"async\" style=\"display: inline; background-image: none;\" title=\"Docker container mounts\" src=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/04\/image_thumb-2.png\" alt=\"Docker container mounts\" width=\"981\" height=\"350\" border=\"0\" \/><\/a><\/p>\n<p>Again, this is pretty easy to measure.<\/p>\n<pre class=\"lang:ps mark:0 decode:true\">$m = $c.mounts | foreach { get-childitem -path $_.source -file -recurse } | \nmeasure-object length -sum\n<\/pre>\n<p>I can then add all the values together to get a pretty close approximation of the container's size.<\/p>\n<h2>Updated PowerShell Function<\/h2>\n<p>With this in mind, I updated the Get-DockerContainer function.<\/p>\n<p><script src=\"https:\/\/gist.github.com\/jdhitsolutions\/a55db2737d30fcb57d4d8c15d47a9cda.js\"><\/script><\/p>\n<p>I updated the class to include size.<\/p>\n<p><a href=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/04\/image-3.png\"><img loading=\"lazy\" decoding=\"async\" style=\"display: inline; background-image: none;\" title=\"Getting Docker container size with PowerShell\" src=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/04\/image_thumb-3.png\" alt=\"Geting Docker container size with PowerShell\" width=\"1028\" height=\"651\" border=\"0\" \/><\/a><\/p>\n<h2>PowerShell Formatting<\/h2>\n<p>The function includes code to use a format.ps1xml file which I've also put up on Github.<\/p>\n<p><script src=\"https:\/\/gist.github.com\/jdhitsolutions\/74e52f89471720fb29b7fbaed279e183.js\"><\/script><\/p>\n<p>The default view is still a table.<\/p>\n<p><a href=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/04\/image-4.png\"><img loading=\"lazy\" decoding=\"async\" style=\"display: inline; background-image: none;\" title=\"Default formatted view of Docker containers\" src=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/04\/image_thumb-4.png\" alt=\"Default formatted view of Docker containers\" width=\"1028\" height=\"403\" border=\"0\" \/><\/a><\/p>\n<p>But I also added a 2nd table view called <strong>stats<\/strong>.<\/p>\n<p><a href=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/04\/image-5.png\"><img loading=\"lazy\" decoding=\"async\" style=\"display: inline; background-image: none;\" title=\"Using the Stats alternate view\" src=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/04\/image_thumb-5.png\" alt=\"Using the Stats alternate view\" width=\"1028\" height=\"297\" border=\"0\" \/><\/a><\/p>\n<p>Now I have very useful PowerShell command for at least getting Docker container information.<\/p>\n<p><a href=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/04\/image-6.png\"><img loading=\"lazy\" decoding=\"async\" style=\"display: inline; background-image: none;\" title=\"Getting all Docker container information\" src=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/04\/image_thumb-6.png\" alt=\"Getting all Docker container information\" width=\"1028\" height=\"402\" border=\"0\" \/><\/a><\/p>\n<p>Because it is in PowerShell, I can export it, dump it to a database, create an HTML report or anything else you can think of in PowerShell. As I said, the Docker CLI is helpful, but it isn't <strong><em>PowerShell<\/em><\/strong> useful.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve been continuing to tinker with my PowerShell command for getting information about Docker containers. The Docker CLI is fine, but it is very difficult to work with the output or do much with it. That&#8217;s why I prefer to have objects in a PowerShell pipeline. One of the Docker container elements that I ignored&#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: Extending #PowerShell and #Docker Containers","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":[600,4],"tags":[601,534,540],"class_list":["post-6629","post","type-post","status-publish","format-standard","hentry","category-docker","category-powershell","tag-containers","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>Extending PowerShell and Docker Containers &#8226; The Lonely Administrator<\/title>\n<meta name=\"description\" content=\"I continue my work with PowerShell scripting and Docker containers. Now I can also include an approximation of container size. Plus a new formatting file.\" \/>\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\/6629\/extending-powershell-and-docker-containers\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Extending PowerShell and Docker Containers &#8226; The Lonely Administrator\" \/>\n<meta property=\"og:description\" content=\"I continue my work with PowerShell scripting and Docker containers. Now I can also include an approximation of container size. Plus a new formatting file.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/jdhitsolutions.com\/blog\/powershell\/6629\/extending-powershell-and-docker-containers\/\" \/>\n<meta property=\"og:site_name\" content=\"The Lonely Administrator\" \/>\n<meta property=\"article:published_time\" content=\"2019-04-02T19:29:38+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-04-02T19:29:46+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/04\/image_thumb.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=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/6629\\\/extending-powershell-and-docker-containers\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/6629\\\/extending-powershell-and-docker-containers\\\/\"},\"author\":{\"name\":\"Jeffery Hicks\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"headline\":\"Extending PowerShell and Docker Containers\",\"datePublished\":\"2019-04-02T19:29:38+00:00\",\"dateModified\":\"2019-04-02T19:29:46+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/6629\\\/extending-powershell-and-docker-containers\\\/\"},\"wordCount\":419,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"image\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/6629\\\/extending-powershell-and-docker-containers\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2019\\\/04\\\/image_thumb.png\",\"keywords\":[\"Containers\",\"PowerShell\",\"Scripting\"],\"articleSection\":[\"Docker\",\"PowerShell\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/6629\\\/extending-powershell-and-docker-containers\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/6629\\\/extending-powershell-and-docker-containers\\\/\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/6629\\\/extending-powershell-and-docker-containers\\\/\",\"name\":\"Extending PowerShell and Docker Containers &#8226; The Lonely Administrator\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/6629\\\/extending-powershell-and-docker-containers\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/6629\\\/extending-powershell-and-docker-containers\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2019\\\/04\\\/image_thumb.png\",\"datePublished\":\"2019-04-02T19:29:38+00:00\",\"dateModified\":\"2019-04-02T19:29:46+00:00\",\"description\":\"I continue my work with PowerShell scripting and Docker containers. Now I can also include an approximation of container size. Plus a new formatting file.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/6629\\\/extending-powershell-and-docker-containers\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/6629\\\/extending-powershell-and-docker-containers\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/6629\\\/extending-powershell-and-docker-containers\\\/#primaryimage\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2019\\\/04\\\/image_thumb.png\",\"contentUrl\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2019\\\/04\\\/image_thumb.png\",\"width\":1028,\"height\":170},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/6629\\\/extending-powershell-and-docker-containers\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Docker\",\"item\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/category\\\/docker\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Extending PowerShell and Docker Containers\"}]},{\"@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":"Extending PowerShell and Docker Containers &#8226; The Lonely Administrator","description":"I continue my work with PowerShell scripting and Docker containers. Now I can also include an approximation of container size. Plus a new formatting file.","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\/6629\/extending-powershell-and-docker-containers\/","og_locale":"en_US","og_type":"article","og_title":"Extending PowerShell and Docker Containers &#8226; The Lonely Administrator","og_description":"I continue my work with PowerShell scripting and Docker containers. Now I can also include an approximation of container size. Plus a new formatting file.","og_url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/6629\/extending-powershell-and-docker-containers\/","og_site_name":"The Lonely Administrator","article_published_time":"2019-04-02T19:29:38+00:00","article_modified_time":"2019-04-02T19:29:46+00:00","og_image":[{"url":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/04\/image_thumb.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":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/6629\/extending-powershell-and-docker-containers\/#article","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/6629\/extending-powershell-and-docker-containers\/"},"author":{"name":"Jeffery Hicks","@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"headline":"Extending PowerShell and Docker Containers","datePublished":"2019-04-02T19:29:38+00:00","dateModified":"2019-04-02T19:29:46+00:00","mainEntityOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/6629\/extending-powershell-and-docker-containers\/"},"wordCount":419,"commentCount":0,"publisher":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"image":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/6629\/extending-powershell-and-docker-containers\/#primaryimage"},"thumbnailUrl":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/04\/image_thumb.png","keywords":["Containers","PowerShell","Scripting"],"articleSection":["Docker","PowerShell"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/6629\/extending-powershell-and-docker-containers\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/6629\/extending-powershell-and-docker-containers\/","url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/6629\/extending-powershell-and-docker-containers\/","name":"Extending PowerShell and Docker Containers &#8226; The Lonely Administrator","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/6629\/extending-powershell-and-docker-containers\/#primaryimage"},"image":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/6629\/extending-powershell-and-docker-containers\/#primaryimage"},"thumbnailUrl":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/04\/image_thumb.png","datePublished":"2019-04-02T19:29:38+00:00","dateModified":"2019-04-02T19:29:46+00:00","description":"I continue my work with PowerShell scripting and Docker containers. Now I can also include an approximation of container size. Plus a new formatting file.","breadcrumb":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/6629\/extending-powershell-and-docker-containers\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/6629\/extending-powershell-and-docker-containers\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/6629\/extending-powershell-and-docker-containers\/#primaryimage","url":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/04\/image_thumb.png","contentUrl":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/04\/image_thumb.png","width":1028,"height":170},{"@type":"BreadcrumbList","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/6629\/extending-powershell-and-docker-containers\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Docker","item":"https:\/\/jdhitsolutions.com\/blog\/category\/docker\/"},{"@type":"ListItem","position":2,"name":"Extending PowerShell and Docker Containers"}]},{"@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":6612,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/6612\/more-fun-with-docker-containers-and-powershell\/","url_meta":{"origin":6629,"position":0},"title":"More Fun with Docker Containers and PowerShell","author":"Jeffery Hicks","date":"March 29, 2019","format":false,"excerpt":"A few days ago I shared some experiences of working with Docker containers and PowerShell. As I continue to learn Docker, I am also learning how to manage it with PowerShell. The Docker command line tools are fine but I think they are even better when drizzled with a nice\u2026","rel":"","context":"In &quot;Docker&quot;","block_context":{"text":"Docker","link":"https:\/\/jdhitsolutions.com\/blog\/category\/docker\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/03\/image_thumb-20.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/03\/image_thumb-20.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/03\/image_thumb-20.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/03\/image_thumb-20.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":6586,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/6586\/powershell-remoting-sessions-and-containers\/","url_meta":{"origin":6629,"position":1},"title":"PowerShell Remoting Sessions and Containers","author":"Jeffery Hicks","date":"March 26, 2019","format":false,"excerpt":"This year I've been ramping up my work with containers via the Docker Desktop application. When Windows Server 2016 was in preview Microsoft tried out some PowerShell cmdlets for working with containers but they never went anywhere. Essentially, the docker command line has become the defacto management tool. There are\u2026","rel":"","context":"In &quot;Docker&quot;","block_context":{"text":"Docker","link":"https:\/\/jdhitsolutions.com\/blog\/category\/docker\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/03\/image_thumb-8.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/03\/image_thumb-8.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/03\/image_thumb-8.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/03\/image_thumb-8.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":6751,"url":"https:\/\/jdhitsolutions.com\/blog\/training\/6751\/get-a-jump-start-on-docker\/","url_meta":{"origin":6629,"position":2},"title":"Get a Jump Start on Docker","author":"Jeffery Hicks","date":"June 5, 2019","format":false,"excerpt":"Over the last few years, perhaps no topic has caught fire as much as Docker and containers. If you're like me you've perhaps installed Docker for Windows, pulled down a Windows server image and tinkered a bit with it. Of course, there is so much more to learn and do\u2026","rel":"","context":"In &quot;Docker&quot;","block_context":{"text":"Docker","link":"https:\/\/jdhitsolutions.com\/blog\/category\/docker\/"},"img":{"alt_text":"image","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/06\/image.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":8871,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8871\/more-colorful-fun-with-powershell\/","url_meta":{"origin":6629,"position":3},"title":"More Colorful Fun with PowerShell","author":"Jeffery Hicks","date":"February 14, 2022","format":false,"excerpt":"In my last Friday Fun post, I shared some PowerShell code for displaying [System.Drawing.Color] values from a console using ANSI escape sequences. After I published the article, I realized what I really wanted was a color palette display that wouldn't be affected by the console background. A Windows Presentation Foundation\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\/2022\/02\/textbox-background.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2022\/02\/textbox-background.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2022\/02\/textbox-background.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2022\/02\/textbox-background.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":8173,"url":"https:\/\/jdhitsolutions.com\/blog\/active-directory\/8173\/climbing-trees-in-powershell\/","url_meta":{"origin":6629,"position":4},"title":"Climbing Trees in PowerShell","author":"Jeffery Hicks","date":"February 15, 2021","format":false,"excerpt":"I'm continuing with my renewed interest in Active Directory, and how I can take advantage of PowerShell. This is a topic I've been working with since the PowerShell v2 days. I have a lot of old code. Some of which I've decided to dust off and polish up. One topic\u2026","rel":"","context":"In &quot;Active Directory&quot;","block_context":{"text":"Active Directory","link":"https:\/\/jdhitsolutions.com\/blog\/category\/active-directory\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/canonical-ou-sort.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/canonical-ou-sort.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/canonical-ou-sort.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/canonical-ou-sort.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":3101,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3101\/turning-cli-tools-into-powershell-tools\/","url_meta":{"origin":6629,"position":5},"title":"Turning CLI Tools into PowerShell Tools","author":"Jeffery Hicks","date":"June 12, 2013","format":false,"excerpt":"Last night I gave a presentation for the Mississippi PowerShell User Group. My talk was based on the chapter I contributed to the forthcoming PowerShell Deep Dives book. In the chapter I explore different techniques for turning command line tools into PowerShell tools. My presentation demonstrated those techniques in action.\u2026","rel":"","context":"In &quot;CommandLine&quot;","block_context":{"text":"CommandLine","link":"https:\/\/jdhitsolutions.com\/blog\/category\/commandline\/"},"img":{"alt_text":"talkbubble","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/10\/talkbubble-150x150.png?resize=350%2C200","width":350,"height":200},"classes":[]}],"_links":{"self":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/6629","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=6629"}],"version-history":[{"count":0,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/6629\/revisions"}],"wp:attachment":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=6629"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=6629"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=6629"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}