{"id":8334,"date":"2021-04-19T11:12:11","date_gmt":"2021-04-19T15:12:11","guid":{"rendered":"https:\/\/jdhitsolutions.com\/blog\/?p=8334"},"modified":"2021-04-19T11:12:13","modified_gmt":"2021-04-19T15:12:13","slug":"unlocking-powershell-secrets","status":"publish","type":"post","link":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8334\/unlocking-powershell-secrets\/","title":{"rendered":"Unlocking PowerShell Secrets"},"content":{"rendered":"\n<div class=\"wp-block-image is-style-default\"><figure class=\"alignleft size-large\"><a href=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/04\/pexels-pixabay-164425.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"320\" height=\"213\" src=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/04\/pexels-pixabay-164425.jpg\" alt=\"\" class=\"wp-image-8335\" srcset=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/04\/pexels-pixabay-164425.jpg 320w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/04\/pexels-pixabay-164425-300x200.jpg 300w\" sizes=\"auto, (max-width: 320px) 100vw, 320px\" \/><\/a><\/figure><\/div>\n\n\n\n<p>So I've been kicking the tires and trying to do more with the Secrets Management modules from Microsoft, now that they are out of pre-release status. You can install the Microsoft.PowerShell.SecretStore and Microsoft.PowerShell.SecretManagement modules, you'll need both,  from the PowerShell Gallery. You can find extension modules that build on the Microsoft modules for working with other key vaults or secret store. Run <code>find-module -tag secretmanagement <\/code>to find additional modules.  But what I want to talk about today relates to the Microsoft modules. Although, it might apply to you with any of the extension modules. The challenge is using the secrets management modules with a PowerShell profile script.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Defined Variables<\/h2>\n\n\n\n<p>In my PowerShell profile script, I call a script that defines a number of variables. These are items I use throughout the day, often in conjunction with PSDefaultParameterValues. Things like API keys and saved tokens. I used to store these values in the script file but decided to move these items to a secret store using the Microsoft secret management modules. I modified the script to set the variables by getting the values from the store. <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"powershell\" class=\"language-powershell\">$foo\u00a0=\u00a0Get-Secret\u00a0-name\u00a0foo\u00a0-vault\u00a0Secrets\u00a0-AsPlainText<\/code><\/pre>\n\n\n\n<p>When launching a new PowerShell session, this worked. Up to a point. I would start PowerShell, and then be prompted to for the vault password.  This isn't that big a burden, but there are implications.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Schedule Jobs<\/h2>\n\n\n\n<p>On my desktop, there are other things that can start PowerShell. Specifically, items like ScheduledJobs. By default, when you setup a scheduled job, the job launches a new PowerShell session which will run your profile scripts. But now there is a problem. When a scheduled job runs , the profile script is going to prompt for a password. But this is not happening interactively, so I can't provide it. <\/p>\n\n\n\n<p>I could modify the scheduled job to not load the profile. But that's a lot of extra work. And maybe some of my scheduled jobs <em>need <\/em>the profile. I need to programmatically unlock the secret store so that I can define my variables. This is also the challenge you face when trying to integrate secret management into any type of automated process.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Separate the Password<\/h2>\n\n\n\n<p>First, let me point out that my approach is <strong><em>not<\/em><\/strong> the only solution, or even the best solution. Whenever you are dealing with secrets or sensitive information, there are always risks, challenges, and trade-offs.  In my situation, the solution was to separate the vault password from the vault. By that I mean, I needed another way to get the password that didn't require any interaction.<\/p>\n\n\n\n<p>I took the vault password and stored it in a protected CMS message using <a href=\"https:\/\/docs.microsoft.com\/powershell\/module\/microsoft.powershell.security\/protect-cmsmessage?view=powershell-7.1&amp;WT.mc_id=ps-gethelp\" target=\"_blank\" rel=\"noreferrer noopener\">Protect-CMSMessage<\/a>. The document can only be read on a computer with the necessary document encryption private keys. I saved the file to a text file using the computer name as part of the file name.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"powershell\" class=\"language-powershell\">$vPass\u00a0=\u00a0\"C:\\scripts\\$($env:computername)-vault.txt\"\n$myVault\u00a0=\u00a0\"Secrets\"<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Unlocking Secrets<\/h2>\n\n\n\n<p>In my profile script, I can uprotect the password, convert it back to a secure string and use it to unlock the vault.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"powershell\" class=\"language-powershell\">$q\u00a0=\u00a0Unprotect-CmsMessage\u00a0-Path\u00a0$vPass\u00a0|\u00a0ConvertTo-SecureString\u00a0-AsPlainText\u00a0-Force\nUnlock-SecretStore\u00a0-Password\u00a0$q\u00a0-PasswordTimeout\u00a028800<\/code><\/pre>\n\n\n\n<p>I work at home and don't have too many security concerns, so I also set the password timeout to 8 hours, so that if I need to access the vault later in the day I don't need to re-enter the password. Once the fault is unlocked I can use Get-Secret to retrieve the values and set my variables.  Because my secret names are identical to the variables I use, I can loop through a list.  Here's the complete code snippet.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"powershell\" class=\"language-powershell\">$vPass\u00a0=\u00a0\"C:\\scripts\\$($env:computername)-vault.txt\"\n$myVault\u00a0=\u00a0\"Secrets\"\n\nif\u00a0(Test-Path\u00a0$vPass)\u00a0{\n\u00a0\u00a0\u00a0\u00a0$q\u00a0=\u00a0Unprotect-CmsMessage\u00a0-Path\u00a0$vPass\u00a0|\u00a0ConvertTo-SecureString\u00a0-AsPlainText\u00a0-Force\n\u00a0\u00a0\u00a0\u00a0Unlock-SecretStore\u00a0-Password\u00a0$q\u00a0-PasswordTimeout\u00a028800\n\n\u00a0\u00a0\u00a0\u00a0$vars\u00a0=\u00a0\"foo\",\u00a0\"bar\",\u00a0\"secret\",\u00a0\"secret2\",\u00a0\"apikey\",\u00a0\u00a0\"gitkey\",\"bitlykey\"\n\n\u00a0\u00a0\u00a0\u00a0foreach\u00a0($var\u00a0in\u00a0$vars)\u00a0{\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Set-Variable\u00a0-Name\u00a0$var\u00a0-Value\u00a0(Get-Secret\u00a0-Name\u00a0$var\u00a0-Vault\u00a0$myVault\u00a0-AsPlainText)\u00a0-Scope\u00a0global\n\u00a0\u00a0\u00a0\u00a0}\n\u00a0   #secure\u00a0string\u00a0variables\n\u00a0\u00a0\u00a0\u00a0$bitly\u00a0=\u00a0Get-Secret\u00a0-Name\u00a0bitly\u00a0-Vault\u00a0$myVault\n\u00a0\u00a0\u00a0\u00a0$artd\u00a0=\u00a0Get-Secret\u00a0-Name\u00a0company\u00a0-Vault\u00a0$myVault\n}<\/code><\/pre>\n\n\n\n<p>This code runs as part of my profile script. I also have a few secrets that I want to remain as secure strings. <\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Summary<\/h2>\n\n\n\n<p>With this solution, I can store secrets in the secret management vault and use them in my profile. And, the profile can be used with Scheduled Jobs as well.  It is up to you to find the best method for securely storing and retrieving the vault password.<\/p>\n\n\n\n<p>You can learn more about the secret management module by visiting the module's <a href=\"https:\/\/github.com\/PowerShell\/SecretManagement\" target=\"_blank\" rel=\"noreferrer noopener\">repository<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>So I&#8217;ve been kicking the tires and trying to do more with the Secrets Management modules from Microsoft, now that they are out of pre-release status. You can install the Microsoft.PowerShell.SecretStore and Microsoft.PowerShell.SecretManagement modules, you&#8217;ll need both, from the PowerShell Gallery. You can find extension modules that build on the Microsoft modules for working with&#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: Unlocking #PowerShell Secrets from the Microsoft Secret Management vault.","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":[534,84,653],"class_list":["post-8334","post","type-post","status-publish","format-standard","hentry","category-powershell","category-scripting","tag-powershell","tag-profile","tag-secret-management"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Unlocking PowerShell Secrets &#8226; The Lonely Administrator<\/title>\n<meta name=\"description\" content=\"Here&#039;s how I handle unlocking secrets from the Microsoft Secret Management vault and using them in my PowerShell profile script.\" \/>\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\/8334\/unlocking-powershell-secrets\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Unlocking PowerShell Secrets &#8226; The Lonely Administrator\" \/>\n<meta property=\"og:description\" content=\"Here&#039;s how I handle unlocking secrets from the Microsoft Secret Management vault and using them in my PowerShell profile script.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/jdhitsolutions.com\/blog\/powershell\/8334\/unlocking-powershell-secrets\/\" \/>\n<meta property=\"og:site_name\" content=\"The Lonely Administrator\" \/>\n<meta property=\"article:published_time\" content=\"2021-04-19T15:12:11+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-04-19T15:12:13+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/04\/pexels-pixabay-164425.jpg\" \/>\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=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/8334\\\/unlocking-powershell-secrets\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/8334\\\/unlocking-powershell-secrets\\\/\"},\"author\":{\"name\":\"Jeffery Hicks\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"headline\":\"Unlocking PowerShell Secrets\",\"datePublished\":\"2021-04-19T15:12:11+00:00\",\"dateModified\":\"2021-04-19T15:12:13+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/8334\\\/unlocking-powershell-secrets\\\/\"},\"wordCount\":672,\"commentCount\":8,\"publisher\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"image\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/8334\\\/unlocking-powershell-secrets\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/04\\\/pexels-pixabay-164425.jpg\",\"keywords\":[\"PowerShell\",\"Profile\",\"Secret Management\"],\"articleSection\":[\"PowerShell\",\"Scripting\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/8334\\\/unlocking-powershell-secrets\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/8334\\\/unlocking-powershell-secrets\\\/\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/8334\\\/unlocking-powershell-secrets\\\/\",\"name\":\"Unlocking PowerShell Secrets &#8226; The Lonely Administrator\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/8334\\\/unlocking-powershell-secrets\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/8334\\\/unlocking-powershell-secrets\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/04\\\/pexels-pixabay-164425.jpg\",\"datePublished\":\"2021-04-19T15:12:11+00:00\",\"dateModified\":\"2021-04-19T15:12:13+00:00\",\"description\":\"Here's how I handle unlocking secrets from the Microsoft Secret Management vault and using them in my PowerShell profile script.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/8334\\\/unlocking-powershell-secrets\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/8334\\\/unlocking-powershell-secrets\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/8334\\\/unlocking-powershell-secrets\\\/#primaryimage\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/04\\\/pexels-pixabay-164425.jpg\",\"contentUrl\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/04\\\/pexels-pixabay-164425.jpg\",\"width\":320,\"height\":213},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/8334\\\/unlocking-powershell-secrets\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"PowerShell\",\"item\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/category\\\/powershell\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Unlocking PowerShell Secrets\"}]},{\"@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":"Unlocking PowerShell Secrets &#8226; The Lonely Administrator","description":"Here's how I handle unlocking secrets from the Microsoft Secret Management vault and using them in my PowerShell profile script.","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\/8334\/unlocking-powershell-secrets\/","og_locale":"en_US","og_type":"article","og_title":"Unlocking PowerShell Secrets &#8226; The Lonely Administrator","og_description":"Here's how I handle unlocking secrets from the Microsoft Secret Management vault and using them in my PowerShell profile script.","og_url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8334\/unlocking-powershell-secrets\/","og_site_name":"The Lonely Administrator","article_published_time":"2021-04-19T15:12:11+00:00","article_modified_time":"2021-04-19T15:12:13+00:00","og_image":[{"url":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/04\/pexels-pixabay-164425.jpg","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":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8334\/unlocking-powershell-secrets\/#article","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8334\/unlocking-powershell-secrets\/"},"author":{"name":"Jeffery Hicks","@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"headline":"Unlocking PowerShell Secrets","datePublished":"2021-04-19T15:12:11+00:00","dateModified":"2021-04-19T15:12:13+00:00","mainEntityOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8334\/unlocking-powershell-secrets\/"},"wordCount":672,"commentCount":8,"publisher":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"image":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8334\/unlocking-powershell-secrets\/#primaryimage"},"thumbnailUrl":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/04\/pexels-pixabay-164425.jpg","keywords":["PowerShell","Profile","Secret Management"],"articleSection":["PowerShell","Scripting"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/8334\/unlocking-powershell-secrets\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8334\/unlocking-powershell-secrets\/","url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8334\/unlocking-powershell-secrets\/","name":"Unlocking PowerShell Secrets &#8226; The Lonely Administrator","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8334\/unlocking-powershell-secrets\/#primaryimage"},"image":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8334\/unlocking-powershell-secrets\/#primaryimage"},"thumbnailUrl":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/04\/pexels-pixabay-164425.jpg","datePublished":"2021-04-19T15:12:11+00:00","dateModified":"2021-04-19T15:12:13+00:00","description":"Here's how I handle unlocking secrets from the Microsoft Secret Management vault and using them in my PowerShell profile script.","breadcrumb":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8334\/unlocking-powershell-secrets\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/8334\/unlocking-powershell-secrets\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8334\/unlocking-powershell-secrets\/#primaryimage","url":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/04\/pexels-pixabay-164425.jpg","contentUrl":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/04\/pexels-pixabay-164425.jpg","width":320,"height":213},{"@type":"BreadcrumbList","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8334\/unlocking-powershell-secrets\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"PowerShell","item":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},{"@type":"ListItem","position":2,"name":"Unlocking PowerShell Secrets"}]},{"@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":5143,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/5143\/compare-powershell-modules\/","url_meta":{"origin":8334,"position":0},"title":"Compare PowerShell Modules","author":"Jeffery Hicks","date":"June 29, 2016","format":false,"excerpt":"One of the attractive features in PowerShell v5 is PowerShellGet. This module includes commands which makes it easy to discover and install PowerShell modules from the Internet, or even your network. The modules are stored in online repositories. Microsoft maintains one called PSGallery. Typically you will use PowerShell commands to\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},"img":{"alt_text":"Comparing module versions","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2016\/06\/image_thumb-26.png?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2016\/06\/image_thumb-26.png?resize=350%2C200 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2016\/06\/image_thumb-26.png?resize=525%2C300 1.5x"},"classes":[]},{"id":8999,"url":"https:\/\/jdhitsolutions.com\/blog\/github\/8999\/hey-psgallery-whats-new\/","url_meta":{"origin":8334,"position":1},"title":"Hey PSGallery, What&#8217;s New?","author":"Jeffery Hicks","date":"April 8, 2022","format":false,"excerpt":"I am a Cmdlet and Module Working Group member that helps triage Github issues for PowerShell. Like all of you, resources are limited, and Microsoft can only take on so much work. We often see requests for new or enhanced cmdlets. Often, we recognize the value, but it comes down\u2026","rel":"","context":"In &quot;GitHub&quot;","block_context":{"text":"GitHub","link":"https:\/\/jdhitsolutions.com\/blog\/category\/github\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2022\/04\/psgallery-report..png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2022\/04\/psgallery-report..png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2022\/04\/psgallery-report..png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2022\/04\/psgallery-report..png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":9003,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/9003\/tips-for-powershell-gallery-success\/","url_meta":{"origin":8334,"position":2},"title":"Tips for PowerShell Gallery Success","author":"Jeffery Hicks","date":"April 13, 2022","format":false,"excerpt":"New on the blog: Tips for #PowerShell Gallery Success","rel":"","context":"In &quot;Best Practices&quot;","block_context":{"text":"Best Practices","link":"https:\/\/jdhitsolutions.com\/blog\/category\/best-practices\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2022\/04\/PowerShell_Hero_small.jpg?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2022\/04\/PowerShell_Hero_small.jpg?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2022\/04\/PowerShell_Hero_small.jpg?resize=525%2C300&ssl=1 1.5x"},"classes":[]},{"id":8027,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8027\/powershell-modules-in-a-cross-version-world\/","url_meta":{"origin":8334,"position":3},"title":"PowerShell Modules in a Cross-Version World","author":"Jeffery Hicks","date":"January 14, 2021","format":false,"excerpt":"The other day I was helping a friend sort out some module-related questions. While helping him, I realized his questions and problems were not unique. Now that many of us are running Windows PowerShell 7 side-by-side, what are the implications when it comes to using PowerShell modules? What are 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\/2021\/01\/module-locations.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/01\/module-locations.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/01\/module-locations.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/01\/module-locations.png?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/01\/module-locations.png?resize=1050%2C600&ssl=1 3x"},"classes":[]},{"id":9323,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/9323\/module-linking\/","url_meta":{"origin":8334,"position":4},"title":"Module Linking","author":"Jeffery Hicks","date":"February 27, 2024","format":false,"excerpt":"I know it has been a while since I've given the blog any attention. I am hoping to correct that in 2024, although I'm already behind schedule. But let's get to it. I have a short tip today that you may find useful, especially if you write modules for your\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":817,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell-v2-0\/817\/module-mania\/","url_meta":{"origin":8334,"position":5},"title":"Module Mania","author":"Jeffery Hicks","date":"August 12, 2010","format":false,"excerpt":"More and more, you're seeing members of the Windows PowerShell community package their contributions into modules, myself included. Although you'll probably still see a lot of individual functions because it is often easier to demonstrate or educate. I received a comment on my Weather module that I thought merited a\u2026","rel":"","context":"In &quot;PowerShell v2.0&quot;","block_context":{"text":"PowerShell v2.0","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell-v2-0\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2010\/08\/get-command-module-300x224.png?resize=350%2C200","width":350,"height":200},"classes":[]}],"_links":{"self":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/8334","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=8334"}],"version-history":[{"count":0,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/8334\/revisions"}],"wp:attachment":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=8334"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=8334"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=8334"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}