{"id":8307,"date":"2021-04-12T09:53:43","date_gmt":"2021-04-12T13:53:43","guid":{"rendered":"https:\/\/jdhitsolutions.com\/blog\/?p=8307"},"modified":"2021-04-12T09:53:46","modified_gmt":"2021-04-12T13:53:46","slug":"more-about-powershell-psdefaultparametervalues","status":"publish","type":"post","link":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8307\/more-about-powershell-psdefaultparametervalues\/","title":{"rendered":"More About PowerShell PSDefaultParameterValues"},"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\/01\/PowerShell_avatar.png\"><img loading=\"lazy\" decoding=\"async\" width=\"150\" height=\"150\" src=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/01\/PowerShell_avatar.png\" alt=\"\" class=\"wp-image-8014\"\/><\/a><\/figure><\/div>\n\n\n\n<p>Last week <a href=\"https:\/\/jdhitsolutions.com\/blog\/powershell\/8293\/make-defaults-a-way-of-life\/\" target=\"_blank\" rel=\"noreferrer noopener\">I shared a little nugget<\/a> about making PowerShell life easier by using the built-in variable, $PSDefaultParameterValues. This is a special hashtable where you can define default parameter values for any PowerShell command. This means any PowerShell script or function that has defined parameters AND uses [cmdletbinding()]. If you have a simple function that only uses a Param() block, $PSDefaultParameterValues won't work for that function. I recommend that all PowerShell functions use [cmdletbinding()] so hopefully, this won't be an issue. Since I received some positive feedback and a few questions on the previous post, I thought a quick follow-up might be in order.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Not Persistent<\/h2>\n\n\n\n<p>First, anything you put in $PSDefaultParameterValues is <strong>not <\/strong>persistent across PowerShell sessions. This is nothing more than another type of variable. As you should know, variables only exist for the duration of your PowerShell session. Or to put a more technical point on it, for the duration of the PowerShell scope. If you have parameter defaults you want to use all the time, put defining statements in your PowerShell profile script. You can any use any of these syntaxes.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"powershell\" class=\"language-powershell\">$PSDefaultParameterValues[\"get-ciminstance:classname\"]=\"win32_bios\"\n$PSDefaultParameterValues.Add(\"get-ciminstance:Verbose\",$True)\n$PSDefaultParameterValues.\"Export-Clixml:Encoding\" = \"UTF8\"<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Exporting and Importing<\/h2>\n\n\n\n<p>Another profile-related option you might consider is to define all the default values you want, then export $PSDefaultParameterValues to a file.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"powershell\" class=\"language-powershell\">$PSDefaultParameterValues | Export-Clixml c:\\work\\psdefaults.xml<\/code><\/pre>\n\n\n\n<p>I would recommend using Export-Clixml because it captures the most information and makes it very easy to import into a new session.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-style-default\"><a href=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/04\/export-psdefaults..png\"><img loading=\"lazy\" decoding=\"async\" width=\"1012\" height=\"518\" src=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/04\/export-psdefaults..png\" alt=\"\" class=\"wp-image-8309\" srcset=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/04\/export-psdefaults..png 1012w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/04\/export-psdefaults.-300x154.png 300w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/04\/export-psdefaults.-768x393.png 768w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/04\/export-psdefaults.-850x435.png 850w\" sizes=\"auto, (max-width: 1012px) 100vw, 1012px\" \/><\/a><\/figure>\n\n\n\n<p>I would definitely not use a CSV file because some of your default values might be nested objects or arrays. JSON might be a little better, but you would need to rebuild $PSDefaultParameterValues from it. And it probably won't handle values like SecureStrings or credentials. On Windows platforms, Export-Clixml will easily and securely store this type of data. Of course, you still want to take adequate precautions to protect the file.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Using and Not Using<\/h2>\n\n\n\n<p>The commands I ran earlier set a pair of default parameter values.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-style-default\"><a href=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/04\/gcim-psdefaultvalue.png\"><img loading=\"lazy\" decoding=\"async\" width=\"986\" height=\"227\" src=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/04\/gcim-psdefaultvalue.png\" alt=\"\" class=\"wp-image-8308\" srcset=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/04\/gcim-psdefaultvalue.png 986w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/04\/gcim-psdefaultvalue-300x69.png 300w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/04\/gcim-psdefaultvalue-768x177.png 768w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/04\/gcim-psdefaultvalue-850x196.png 850w\" sizes=\"auto, (max-width: 986px) 100vw, 986px\" \/><\/a><\/figure>\n\n\n\n<p>I didn't have to do anything. You can always specify other parameters or behavior.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-style-default\"><a href=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/04\/override-psdefaults.png\"><img loading=\"lazy\" decoding=\"async\" width=\"911\" height=\"114\" src=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/04\/override-psdefaults.png\" alt=\"\" class=\"wp-image-8310\" srcset=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/04\/override-psdefaults.png 911w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/04\/override-psdefaults-300x38.png 300w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/04\/override-psdefaults-768x96.png 768w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/04\/override-psdefaults-850x106.png 850w\" sizes=\"auto, (max-width: 911px) 100vw, 911px\" \/><\/a><\/figure>\n\n\n\n<p>As I have mentioned, $PSDefaultParameterValues is special. You can temporarily disable it by adding a Disabled key.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"powershell\" class=\"language-powershell\">$PSDefaultParameterValues.disabled = $True<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large is-style-default\"><a href=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/04\/disabled.png\"><img loading=\"lazy\" decoding=\"async\" width=\"969\" height=\"282\" src=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/04\/disabled.png\" alt=\"\" class=\"wp-image-8311\" srcset=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/04\/disabled.png 969w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/04\/disabled-300x87.png 300w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/04\/disabled-768x224.png 768w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/04\/disabled-850x247.png 850w\" sizes=\"auto, (max-width: 969px) 100vw, 969px\" \/><\/a><\/figure>\n\n\n\n<p>The variable is still defined in my session but ignored. When I set Disabled to $False, the defaults will be used again. You can also completely clear the variable.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-style-default\"><a href=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/04\/clear-psdefaults.png\"><img loading=\"lazy\" decoding=\"async\" width=\"822\" height=\"494\" src=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/04\/clear-psdefaults.png\" alt=\"\" class=\"wp-image-8312\" srcset=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/04\/clear-psdefaults.png 822w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/04\/clear-psdefaults-300x180.png 300w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/04\/clear-psdefaults-768x462.png 768w\" sizes=\"auto, (max-width: 822px) 100vw, 822px\" \/><\/a><\/figure>\n\n\n\n<p>I strongly recommend you read the about_parameters_default_values help topic to learn even more.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Last week I shared a little nugget about making PowerShell life easier by using the built-in variable, $PSDefaultParameterValues. This is a special hashtable where you can define default parameter values for any PowerShell command. This means any PowerShell script or function that has defined parameters AND uses [cmdletbinding()]. If you have a simple function that&#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: More About #PowerShell PSDefaultParameterValues","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":[534,444],"class_list":["post-8307","post","type-post","status-publish","format-standard","hentry","category-powershell","tag-powershell","tag-psdefaultparametervalues"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>More About PowerShell PSDefaultParameterValues &#8226; The Lonely Administrator<\/title>\n<meta name=\"description\" content=\"If you are just getting started with PowerShell PSDefaultParameterValues, here are a few other tips and tricks to get even more value.\" \/>\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\/8307\/more-about-powershell-psdefaultparametervalues\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"More About PowerShell PSDefaultParameterValues &#8226; The Lonely Administrator\" \/>\n<meta property=\"og:description\" content=\"If you are just getting started with PowerShell PSDefaultParameterValues, here are a few other tips and tricks to get even more value.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/jdhitsolutions.com\/blog\/powershell\/8307\/more-about-powershell-psdefaultparametervalues\/\" \/>\n<meta property=\"og:site_name\" content=\"The Lonely Administrator\" \/>\n<meta property=\"article:published_time\" content=\"2021-04-12T13:53:43+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-04-12T13:53:46+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/01\/PowerShell_avatar.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\\\/8307\\\/more-about-powershell-psdefaultparametervalues\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/8307\\\/more-about-powershell-psdefaultparametervalues\\\/\"},\"author\":{\"name\":\"Jeffery Hicks\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"headline\":\"More About PowerShell PSDefaultParameterValues\",\"datePublished\":\"2021-04-12T13:53:43+00:00\",\"dateModified\":\"2021-04-12T13:53:46+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/8307\\\/more-about-powershell-psdefaultparametervalues\\\/\"},\"wordCount\":402,\"commentCount\":3,\"publisher\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"image\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/8307\\\/more-about-powershell-psdefaultparametervalues\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/01\\\/PowerShell_avatar.png\",\"keywords\":[\"PowerShell\",\"PSDefaultParameterValues\"],\"articleSection\":[\"PowerShell\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/8307\\\/more-about-powershell-psdefaultparametervalues\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/8307\\\/more-about-powershell-psdefaultparametervalues\\\/\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/8307\\\/more-about-powershell-psdefaultparametervalues\\\/\",\"name\":\"More About PowerShell PSDefaultParameterValues &#8226; The Lonely Administrator\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/8307\\\/more-about-powershell-psdefaultparametervalues\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/8307\\\/more-about-powershell-psdefaultparametervalues\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/01\\\/PowerShell_avatar.png\",\"datePublished\":\"2021-04-12T13:53:43+00:00\",\"dateModified\":\"2021-04-12T13:53:46+00:00\",\"description\":\"If you are just getting started with PowerShell PSDefaultParameterValues, here are a few other tips and tricks to get even more value.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/8307\\\/more-about-powershell-psdefaultparametervalues\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/8307\\\/more-about-powershell-psdefaultparametervalues\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/8307\\\/more-about-powershell-psdefaultparametervalues\\\/#primaryimage\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/01\\\/PowerShell_avatar.png\",\"contentUrl\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/01\\\/PowerShell_avatar.png\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/8307\\\/more-about-powershell-psdefaultparametervalues\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"PowerShell\",\"item\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/category\\\/powershell\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"More About PowerShell PSDefaultParameterValues\"}]},{\"@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":"More About PowerShell PSDefaultParameterValues &#8226; The Lonely Administrator","description":"If you are just getting started with PowerShell PSDefaultParameterValues, here are a few other tips and tricks to get even more value.","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\/8307\/more-about-powershell-psdefaultparametervalues\/","og_locale":"en_US","og_type":"article","og_title":"More About PowerShell PSDefaultParameterValues &#8226; The Lonely Administrator","og_description":"If you are just getting started with PowerShell PSDefaultParameterValues, here are a few other tips and tricks to get even more value.","og_url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8307\/more-about-powershell-psdefaultparametervalues\/","og_site_name":"The Lonely Administrator","article_published_time":"2021-04-12T13:53:43+00:00","article_modified_time":"2021-04-12T13:53:46+00:00","og_image":[{"url":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/01\/PowerShell_avatar.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\/8307\/more-about-powershell-psdefaultparametervalues\/#article","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8307\/more-about-powershell-psdefaultparametervalues\/"},"author":{"name":"Jeffery Hicks","@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"headline":"More About PowerShell PSDefaultParameterValues","datePublished":"2021-04-12T13:53:43+00:00","dateModified":"2021-04-12T13:53:46+00:00","mainEntityOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8307\/more-about-powershell-psdefaultparametervalues\/"},"wordCount":402,"commentCount":3,"publisher":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"image":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8307\/more-about-powershell-psdefaultparametervalues\/#primaryimage"},"thumbnailUrl":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/01\/PowerShell_avatar.png","keywords":["PowerShell","PSDefaultParameterValues"],"articleSection":["PowerShell"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/8307\/more-about-powershell-psdefaultparametervalues\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8307\/more-about-powershell-psdefaultparametervalues\/","url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8307\/more-about-powershell-psdefaultparametervalues\/","name":"More About PowerShell PSDefaultParameterValues &#8226; The Lonely Administrator","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8307\/more-about-powershell-psdefaultparametervalues\/#primaryimage"},"image":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8307\/more-about-powershell-psdefaultparametervalues\/#primaryimage"},"thumbnailUrl":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/01\/PowerShell_avatar.png","datePublished":"2021-04-12T13:53:43+00:00","dateModified":"2021-04-12T13:53:46+00:00","description":"If you are just getting started with PowerShell PSDefaultParameterValues, here are a few other tips and tricks to get even more value.","breadcrumb":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8307\/more-about-powershell-psdefaultparametervalues\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/8307\/more-about-powershell-psdefaultparametervalues\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8307\/more-about-powershell-psdefaultparametervalues\/#primaryimage","url":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/01\/PowerShell_avatar.png","contentUrl":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/01\/PowerShell_avatar.png","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8307\/more-about-powershell-psdefaultparametervalues\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"PowerShell","item":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},{"@type":"ListItem","position":2,"name":"More About PowerShell PSDefaultParameterValues"}]},{"@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":3546,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell-3-0\/3546\/turn-on-powershell-help-window\/","url_meta":{"origin":8307,"position":0},"title":"Turn On PowerShell Help Window","author":"Jeffery Hicks","date":"November 7, 2013","format":false,"excerpt":"Here's a little suggestion for today that might make it easier for you to use PowerShell. In PowerShell 3.0, the Get-Help cmdlet includes a terrific new parameter called -ShowWindow. When you ask for help with this parameter, you get complete help in a new window. The window is re-sizable, searchable\u2026","rel":"","context":"In &quot;Powershell 3.0&quot;","block_context":{"text":"Powershell 3.0","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell-3-0\/"},"img":{"alt_text":"talkbubble-v3","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2012\/05\/talkbubble-v3-150x150.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":8293,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8293\/make-defaults-a-way-of-life\/","url_meta":{"origin":8307,"position":1},"title":"Make Defaults a Way of Life","author":"Jeffery Hicks","date":"April 8, 2021","format":false,"excerpt":"A quick post today to remind you of a way to make PowerShell even easier to use. PowerShell cmdlets and functions obviously help us get a lot done, and most commands offer a number of parameters to customize what needs to be done. Unless you love typing, you probably would\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\/04\/get-volume3.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/04\/get-volume3.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/04\/get-volume3.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/04\/get-volume3.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":7212,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/7212\/adding-a-powershell-profile-calendar\/","url_meta":{"origin":8307,"position":2},"title":"Adding a PowerShell Profile Calendar","author":"Jeffery Hicks","date":"February 1, 2020","format":false,"excerpt":"Some of you may be aware of my PSCalendar module which you can install from the PowerShell Gallery. The module contains commands that you can use to display a console-based calendar.\u00a0 The calendar commands let you specify days to highlight. These might be days with special events or appointments. I\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\/02\/image_thumb-2.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/02\/image_thumb-2.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/02\/image_thumb-2.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/02\/image_thumb-2.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":8343,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8343\/a-better-way-to-manage-powershell-functions\/","url_meta":{"origin":8307,"position":3},"title":"A Better Way to Manage PowerShell Functions","author":"Jeffery Hicks","date":"April 22, 2021","format":false,"excerpt":"Like many of you, I write a lot of PowerShell code. Much of it I use on a daily basis since I essentially spend my day at a PowerShell prompt. Also like many of you, I often assemble functions into a module. A module makes it easier to load 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\/04\/psfunctioninfo-content.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/04\/psfunctioninfo-content.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/04\/psfunctioninfo-content.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/04\/psfunctioninfo-content.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":2486,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/2486\/powershell-version-profile-tips\/","url_meta":{"origin":8307,"position":4},"title":"PowerShell Version Profile Tips","author":"Jeffery Hicks","date":"September 12, 2012","format":false,"excerpt":"Now that PowerShell v3 is finally and officially with us, I'm trusting that many of you are embracing it. I've made the jump, although I have had to make some minor adjustments. If you are going to live entirely in a PowerShell v3 world, fantastic! Go forth and spread 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\/2012\/05\/talkbubble-v3-150x150.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":7921,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/7921\/answering-the-powershell-linking-challenge\/","url_meta":{"origin":8307,"position":5},"title":"Answering the PowerShell Linking Challenge","author":"Jeffery Hicks","date":"December 2, 2020","format":false,"excerpt":"A few weeks ago, the Iron Scripter challenge was to move files meeting some criteria to a new location and leave a link behind. As I've written before, these challenges are a great way to test your PowerShell skills and stretch yourself. This challenge has a number of moving parts.\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\/new-item-link.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/12\/new-item-link.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/12\/new-item-link.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/12\/new-item-link.png?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/12\/new-item-link.png?resize=1050%2C600&ssl=1 3x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/12\/new-item-link.png?resize=1400%2C800&ssl=1 4x"},"classes":[]}],"_links":{"self":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/8307","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=8307"}],"version-history":[{"count":0,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/8307\/revisions"}],"wp:attachment":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=8307"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=8307"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=8307"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}