{"id":7458,"date":"2020-05-08T15:58:59","date_gmt":"2020-05-08T19:58:59","guid":{"rendered":"https:\/\/jdhitsolutions.com\/blog\/?p=7458"},"modified":"2020-05-08T16:15:07","modified_gmt":"2020-05-08T20:15:07","slug":"a-powershell-remote-function-framework","status":"publish","type":"post","link":"https:\/\/jdhitsolutions.com\/blog\/powershell\/7458\/a-powershell-remote-function-framework\/","title":{"rendered":"A PowerShell Remote Function Framework"},"content":{"rendered":"\n<p>The other day I shared a PowerShell function to query the registry on remote computers to <a rel=\"noreferrer noopener\" href=\"https:\/\/jdhitsolutions.com\/blog\/powershell\/7447\/get-installed-powershell-versions\/\" target=\"_blank\">find installed versions of PowerShell<\/a>. The function leveraged PowerShell remoting with the flexibility of using a computer name with an optional credential or existing PSSessions. The more I thought about it, the more I realized that the structure could be re-used for any command that I wanted to run on a remote computer. I think this is a terrific way to use PowerShell. With a little re-work, I came up with what I'm calling a remote function framework.<\/p>\n\n\n\n<p>The majority of the function's parameters are based on what you would use to create a PSSession. The function uses the session to run a scriptblock remotely.  Because I wanted to support PowerShell 7 which can use SSH for remoting, I wanted to add the necessary parameters like Hostname. Those parameters are only available on PowerShell 7 so I'm defining them as dynamic parameters with their own parameter set. Although, you could just as easily define the parameters in the Param block.<\/p>\n\n\n\n<p>The function creates temporary sessions as needed one at a time.I did this so that I could better handle exceptions. The code also had to account for values being passed by a parameter or from the pipeline. To simplify things, I removed the default value for $Computername and made it mandatory.<\/p>\n\n\n\n<p>To create your own command from my framework, all you really need to do is define the scriptblock, and any optional parameters you might need.<\/p>\n\n\n\n<p><p>The framework function is on Github.<\/p>\n<script src=\"https:\/\/gist.github.com\/jdhitsolutions\/5978a209cc912132ea2052a33a855327.js\"><\/script><\/p>\n\n\n\n<p>I've left a number of #TODO comments to guide you on the changes you need to make. As a proof of concept, here is a function that terminates a process on a remote computer.<\/p>\n\n\n<p><script src=\"https:\/\/gist.github.com\/jdhitsolutions\/0149c11c90fc244cf357d5df22e8ba2b.js\"><\/script><\/p>\n\n\n<p>As you look through the code you can see how I'm handling parameters I need for the remote scriptblock. Including support for -WhatIf. The way I have this written, $PSBoundParameters is getting splatted to New-PSSession, so you need to remove anything you've added that doesn't belong. You can see how I'm doing that in the code.<\/p>\n\n\n\n<p>Within a few minutes I had a fully functioning command.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"657\" src=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/05\/stop-remoteprocess-1024x657.png\" alt=\"\" class=\"wp-image-7462\" srcset=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/05\/stop-remoteprocess-1024x657.png 1024w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/05\/stop-remoteprocess-300x192.png 300w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/05\/stop-remoteprocess-768x493.png 768w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/05\/stop-remoteprocess-1536x986.png 1536w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/05\/stop-remoteprocess-850x545.png 850w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/05\/stop-remoteprocess.png 1557w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"174\" src=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/05\/stop-remoteprocess2-1024x174.png\" alt=\"\" class=\"wp-image-7463\" srcset=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/05\/stop-remoteprocess2-1024x174.png 1024w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/05\/stop-remoteprocess2-300x51.png 300w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/05\/stop-remoteprocess2-768x131.png 768w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/05\/stop-remoteprocess2-1536x262.png 1536w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/05\/stop-remoteprocess2-850x145.png 850w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/05\/stop-remoteprocess2.png 1762w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>And it works this way as well.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"341\" src=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/05\/stop-remoteprocess3-1024x341.png\" alt=\"\" class=\"wp-image-7465\" srcset=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/05\/stop-remoteprocess3-1024x341.png 1024w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/05\/stop-remoteprocess3-300x100.png 300w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/05\/stop-remoteprocess3-768x256.png 768w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/05\/stop-remoteprocess3-850x283.png 850w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/05\/stop-remoteprocess3.png 1132w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>I'm looking forward to seeing what else I can do with this framework. I'd love to hear how you use it. Enjoy.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The other day I shared a PowerShell function to query the registry on remote computers to find installed versions of PowerShell. The function leveraged PowerShell remoting with the flexibility of using a computer name with an optional credential or existing PSSessions. The more I thought about it, the more I realized that the structure could&#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":"Just published: A #PowerShell Remote Function Framework that works in Windows PowerShell 5.1 and PowerShell 7","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,8],"tags":[224,534,87,540,613],"class_list":["post-7458","post","type-post","status-publish","format-standard","hentry","category-powershell","category-scripting","tag-function","tag-powershell","tag-remoting","tag-scripting","tag-ssh"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>A PowerShell Remote Function Framework &#8226; The Lonely Administrator<\/title>\n<meta name=\"description\" content=\"I&#039;ve created a PowerShell function framework that uses remoting to do stuff. It is designed to run cross-platform and in Windows PowerShell.\" \/>\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\/7458\/a-powershell-remote-function-framework\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"A PowerShell Remote Function Framework &#8226; The Lonely Administrator\" \/>\n<meta property=\"og:description\" content=\"I&#039;ve created a PowerShell function framework that uses remoting to do stuff. It is designed to run cross-platform and in Windows PowerShell.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/jdhitsolutions.com\/blog\/powershell\/7458\/a-powershell-remote-function-framework\/\" \/>\n<meta property=\"og:site_name\" content=\"The Lonely Administrator\" \/>\n<meta property=\"article:published_time\" content=\"2020-05-08T19:58:59+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-05-08T20:15:07+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/05\/stop-remoteprocess-1024x657.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\\\/7458\\\/a-powershell-remote-function-framework\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/7458\\\/a-powershell-remote-function-framework\\\/\"},\"author\":{\"name\":\"Jeffery Hicks\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"headline\":\"A PowerShell Remote Function Framework\",\"datePublished\":\"2020-05-08T19:58:59+00:00\",\"dateModified\":\"2020-05-08T20:15:07+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/7458\\\/a-powershell-remote-function-framework\\\/\"},\"wordCount\":401,\"commentCount\":2,\"publisher\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"image\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/7458\\\/a-powershell-remote-function-framework\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/05\\\/stop-remoteprocess-1024x657.png\",\"keywords\":[\"Function\",\"PowerShell\",\"remoting\",\"Scripting\",\"SSH\"],\"articleSection\":[\"PowerShell\",\"Scripting\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/7458\\\/a-powershell-remote-function-framework\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/7458\\\/a-powershell-remote-function-framework\\\/\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/7458\\\/a-powershell-remote-function-framework\\\/\",\"name\":\"A PowerShell Remote Function Framework &#8226; The Lonely Administrator\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/7458\\\/a-powershell-remote-function-framework\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/7458\\\/a-powershell-remote-function-framework\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/05\\\/stop-remoteprocess-1024x657.png\",\"datePublished\":\"2020-05-08T19:58:59+00:00\",\"dateModified\":\"2020-05-08T20:15:07+00:00\",\"description\":\"I've created a PowerShell function framework that uses remoting to do stuff. It is designed to run cross-platform and in Windows PowerShell.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/7458\\\/a-powershell-remote-function-framework\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/7458\\\/a-powershell-remote-function-framework\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/7458\\\/a-powershell-remote-function-framework\\\/#primaryimage\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/05\\\/stop-remoteprocess.png\",\"contentUrl\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/05\\\/stop-remoteprocess.png\",\"width\":1557,\"height\":999},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/7458\\\/a-powershell-remote-function-framework\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"PowerShell\",\"item\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/category\\\/powershell\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"A PowerShell Remote Function Framework\"}]},{\"@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":"A PowerShell Remote Function Framework &#8226; The Lonely Administrator","description":"I've created a PowerShell function framework that uses remoting to do stuff. It is designed to run cross-platform and in Windows PowerShell.","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\/7458\/a-powershell-remote-function-framework\/","og_locale":"en_US","og_type":"article","og_title":"A PowerShell Remote Function Framework &#8226; The Lonely Administrator","og_description":"I've created a PowerShell function framework that uses remoting to do stuff. It is designed to run cross-platform and in Windows PowerShell.","og_url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/7458\/a-powershell-remote-function-framework\/","og_site_name":"The Lonely Administrator","article_published_time":"2020-05-08T19:58:59+00:00","article_modified_time":"2020-05-08T20:15:07+00:00","og_image":[{"url":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/05\/stop-remoteprocess-1024x657.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\/7458\/a-powershell-remote-function-framework\/#article","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/7458\/a-powershell-remote-function-framework\/"},"author":{"name":"Jeffery Hicks","@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"headline":"A PowerShell Remote Function Framework","datePublished":"2020-05-08T19:58:59+00:00","dateModified":"2020-05-08T20:15:07+00:00","mainEntityOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/7458\/a-powershell-remote-function-framework\/"},"wordCount":401,"commentCount":2,"publisher":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"image":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/7458\/a-powershell-remote-function-framework\/#primaryimage"},"thumbnailUrl":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/05\/stop-remoteprocess-1024x657.png","keywords":["Function","PowerShell","remoting","Scripting","SSH"],"articleSection":["PowerShell","Scripting"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/7458\/a-powershell-remote-function-framework\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/7458\/a-powershell-remote-function-framework\/","url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/7458\/a-powershell-remote-function-framework\/","name":"A PowerShell Remote Function Framework &#8226; The Lonely Administrator","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/7458\/a-powershell-remote-function-framework\/#primaryimage"},"image":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/7458\/a-powershell-remote-function-framework\/#primaryimage"},"thumbnailUrl":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/05\/stop-remoteprocess-1024x657.png","datePublished":"2020-05-08T19:58:59+00:00","dateModified":"2020-05-08T20:15:07+00:00","description":"I've created a PowerShell function framework that uses remoting to do stuff. It is designed to run cross-platform and in Windows PowerShell.","breadcrumb":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/7458\/a-powershell-remote-function-framework\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/7458\/a-powershell-remote-function-framework\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/7458\/a-powershell-remote-function-framework\/#primaryimage","url":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/05\/stop-remoteprocess.png","contentUrl":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/05\/stop-remoteprocess.png","width":1557,"height":999},{"@type":"BreadcrumbList","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/7458\/a-powershell-remote-function-framework\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"PowerShell","item":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},{"@type":"ListItem","position":2,"name":"A PowerShell Remote Function Framework"}]},{"@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":5895,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/5895\/another-look-at-powershell-core-version-information\/","url_meta":{"origin":7458,"position":0},"title":"Another Look at PowerShell Core Version Information","author":"Jeffery Hicks","date":"February 8, 2018","format":false,"excerpt":"As PowerShell Core begins to spread into our world, and as we start thinking about working and scripting cross-platform, it will be useful to know what type of platform you are running on. The built in $PSVersionTable is an obvious place to start. On PowerShell Core there are also some\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-5.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-5.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2018\/02\/image_thumb-5.png?resize=525%2C300&ssl=1 1.5x"},"classes":[]},{"id":6855,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell-7\/6855\/powershell-scripting-for-linux-is-still-about-the-objects\/","url_meta":{"origin":7458,"position":1},"title":"PowerShell Scripting for Linux is Still About the Objects","author":"Jeffery Hicks","date":"October 8, 2019","format":false,"excerpt":"I've been trying to increase my Linux skills, especially as I begin to write PowerShell scripts and tools that can work cross-platform. One very important concept I want to make sure you don't overlook is that even when scripting for non-Windows platforms, you must still be thinking about objects. The\u2026","rel":"","context":"In &quot;PowerShell 7&quot;","block_context":{"text":"PowerShell 7","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell-7\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":7969,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell-7\/7969\/deploy-openssh-server-to-windows-10\/","url_meta":{"origin":7458,"position":2},"title":"Deploy OpenSSH Server to Windows 10","author":"Jeffery Hicks","date":"December 16, 2020","format":false,"excerpt":"PowerShell 7 offers a number of compelling reasons to adopt it. One of the best is support for SSH as a PowerShell remoting protocol. Unfortunately, this is not a topic that typically comes up for Windows-centric IT Pros. I know this is definitely true in my case, and a deficiency\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\/2020\/12\/sshserver-installed.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/12\/sshserver-installed.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/12\/sshserver-installed.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/12\/sshserver-installed.png?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/12\/sshserver-installed.png?resize=1050%2C600&ssl=1 3x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/12\/sshserver-installed.png?resize=1400%2C800&ssl=1 4x"},"classes":[]},{"id":7361,"url":"https:\/\/jdhitsolutions.com\/blog\/scripting\/7361\/powershell-7-cross-platform-scripting-tips-and-traps\/","url_meta":{"origin":7458,"position":3},"title":"PowerShell 7 Cross-Platform Scripting Tips and Traps","author":"Jeffery Hicks","date":"March 13, 2020","format":false,"excerpt":"One of the reasons you want to adopt PowerShell 7 on your desktop, is that it can\u00a0 be used cross-platform. Theoretically, you can write a PowerShell script or function that works on Windows, Linux, and Mac. However, this is not without challenges. In some ways, it feels like we are\u2026","rel":"","context":"In &quot;PowerShell 7&quot;","block_context":{"text":"PowerShell 7","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell-7\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/03\/hicks-scripting-4.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/03\/hicks-scripting-4.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/03\/hicks-scripting-4.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/03\/hicks-scripting-4.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":4908,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4908\/get-local-group-members-with-powershell\/","url_meta":{"origin":7458,"position":4},"title":"Get Local Group Members with PowerShell","author":"Jeffery Hicks","date":"February 17, 2016","format":false,"excerpt":"Recently I posted a function to get information about local user accounts. I received a lot of positive feedback so it seemed natural to take this the next step and create a similar function to enumerate or list members of a local group, such as Administrators. The function, Get-LocalGroupMember, also\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},"img":{"alt_text":"image","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2016\/02\/image_thumb-7.png?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2016\/02\/image_thumb-7.png?resize=350%2C200 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2016\/02\/image_thumb-7.png?resize=525%2C300 1.5x"},"classes":[]},{"id":7712,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/7712\/answering-the-wsman-powershell-challenge\/","url_meta":{"origin":7458,"position":5},"title":"Answering the WSMan PowerShell Challenge","author":"Jeffery Hicks","date":"September 30, 2020","format":false,"excerpt":"Today, I thought I'd share my solution to a recent Iron Scripter challenge. I thought this was a fascinating task and one with a practical result.\u00a0 I'd encourage you to try your hand at the challenge and come back later to see how I tackled it. The challenge is not\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\/2020\/09\/get-psremotesessionuser-4.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/09\/get-psremotesessionuser-4.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/09\/get-psremotesessionuser-4.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/09\/get-psremotesessionuser-4.png?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/09\/get-psremotesessionuser-4.png?resize=1050%2C600&ssl=1 3x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/09\/get-psremotesessionuser-4.png?resize=1400%2C800&ssl=1 4x"},"classes":[]}],"_links":{"self":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/7458","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=7458"}],"version-history":[{"count":0,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/7458\/revisions"}],"wp:attachment":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=7458"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=7458"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=7458"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}