{"id":714,"date":"2010-07-21T09:51:34","date_gmt":"2010-07-21T14:51:34","guid":{"rendered":"http:\/\/jdhitsolutions.com\/blog\/?p=714"},"modified":"2010-07-21T09:51:34","modified_gmt":"2010-07-21T14:51:34","slug":"get-parameter","status":"publish","type":"post","link":"https:\/\/jdhitsolutions.com\/blog\/powershell\/714\/get-parameter\/","title":{"rendered":"Get Parameter"},"content":{"rendered":"<p>As I continue to work on the 2nd edition of <span style=\"text-decoration: underline;\">Managing Active Directory with Windows PowerShell: TFM<\/span>, I find situations where I need a tool to get information out of Windows PowerShell. For example, the cmdlets in the Microsoft Active Directory module have a lot of parameters and I wanted to know some specifics. Now I could simply keep reading the full cmdlet help, but that gets kind of tedious. Instead I remembered I can use the <strong>Get-Command<\/strong> cmdlet to dig into the details.<\/p>\n<p>For example, here are the parameters for <strong>Get-Service<\/strong>.<\/p>\n<div id=\"codeSnippetWrapper\">\n<pre id=\"codeSnippet\" class=\"csharpcode\">PS C:\\&gt; (get-command get-service).parameters \r\n\r\nKey               Value\r\n---               -----\r\nName              System.Management.Automation.ParameterMetadata\r\nComputerName      System.Management.Automation.ParameterMetadata\r\nDependentServices System.Management.Automation.ParameterMetadata\r\nRequiredServices  System.Management.Automation.ParameterMetadata\r\nDisplayName       System.Management.Automation.ParameterMetadata\r\nInclude           System.Management.Automation.ParameterMetadata\r\nExclude           System.Management.Automation.ParameterMetadata\r\nInputObject       System.Management.Automation.ParameterMetadata\r\nVerbose           System.Management.Automation.ParameterMetadata\r\nDebug             System.Management.Automation.ParameterMetadata\r\nErrorAction       System.Management.Automation.ParameterMetadata\r\nWarningAction     System.Management.Automation.ParameterMetadata\r\nErrorVariable     System.Management.Automation.ParameterMetadata\r\nWarningVariable   System.Management.Automation.ParameterMetadata\r\nOutVariable       System.Management.Automation.ParameterMetadata\r\nOutBuffer         System.Management.Automation.ParameterMetadata<\/pre>\n<\/div>\n<p>The value, System.Management.Automation.ParameterMetadata is intriguing. The output is a dictionary object so I can check just a single parameter.<\/p>\n<pre id=\"codeSnippet\" class=\"csharpcode\">PS C:\\&gt; (get-command get-service).parameters.name\r\n\r\nName            : Name\r\nParameterType   : System.String[]\r\nParameterSets   : {[Default, System.Management.Automation.ParameterSetMetadata]}\r\nIsDynamic       : False\r\nAliases         : {ServiceName}\r\nAttributes      : {Default, System.Management.Automation.AliasAttribute}\r\nSwitchParameter : False<\/pre>\n<p>I can even take it a step further and get attribute information.<\/p>\n<div id=\"codeSnippetWrapper\">\n<pre id=\"codeSnippet\" class=\"csharpcode\">PS C:\\&gt; (get-command get-service).parameters.name.attributes\r\n\r\nPosition                        : 0\r\nParameterSetName                : Default\r\nMandatory                       : False\r\nValueFromPipeline               : True\r\nValueFromPipelineByPropertyName : True\r\nValueFromRemainingArguments     : False\r\nHelpMessage                     :\r\nHelpMessageBaseName             :\r\nHelpMessageResourceId           :\r\nTypeId                          : System.Management.Automation.ParameterAttribute\r\n\r\nAliasNames : {ServiceName}\r\nTypeId     : System.Management.Automation.AliasAttribute<\/pre>\n<\/div>\n<p>Now that I know where to go and how to get what I need, I can write a function to retrieve parameters for a given cmdlet or function.<\/p>\n<div id=\"codeSnippetWrapper\" class=\"csharpcode-wrapper\">\n<pre id=\"codeSnippet\" class=\"csharpcode\">Function Get-Parameter {\r\n\r\n&lt;<span class=\"rem\">#<\/span>\r\n.Synopsis\r\n    Retrieve command parameter information.\r\n.Description\r\n    Using Get-Command, this <span class=\"kwrd\">function<\/span> will <span class=\"kwrd\">return<\/span> information about parameters\r\n    <span class=\"kwrd\">for<\/span> any loaded cmdlet or <span class=\"kwrd\">function<\/span>. The common parameters like Verbose and\r\n    ErrorAction are omitted. Get-Parameter returns a custom object with the most\r\n    useful information an administrator might need to know. Here is an example:\r\n\r\n    Position          : 0\r\n    Name              : Name\r\n    Type              : System.String[]\r\n    Aliases           : {ServiceName}\r\n    ValueFromPipeline : True\r\n    Mandatory         : False\r\n    ParameterSet      : Default\r\n\r\n.Parameter Command\r\n    The name of a cmdlet or <span class=\"kwrd\">function<\/span>. The parameter has an alias of Name.\r\n.Example\r\n    PS C:\\&gt; get-parameter get-service\r\n\r\n    Return parameter information <span class=\"kwrd\">for<\/span> get-service\r\n.Example\r\nPS C:\\Scripts&gt; get-parameter mkdir | select Name,type\r\nFound 6 specific parameters <span class=\"kwrd\">for<\/span> mkdir\r\n\r\nName                        Type\r\n----                        ----\r\nPath                        System.String[]\r\nName                        System.String\r\nValue                       System.Object\r\nForce                       System.Management.Automation.SwitchParameter\r\nCredential                  System.Management.Automation.PSCredential\r\nUseTransaction              System.Management.Automation.SwitchParameter\r\n.Example\r\nPS C:\\Scripts&gt; get-parameter get-wmiobject | sort parameterset |\r\nformat-table -GroupBy ParameterSet -Property Name,Alias,Position,Type\r\nFound 18 non-common parameters <span class=\"kwrd\">for<\/span> get-wmiobject\r\n\r\n   ParameterSet: __AllParameterSets\r\n\r\nName          Alias Position Type\r\n----          ----- -------- ----\r\nThrottleLimit                System.Int32\r\nAmended                      System.Management.Automation.SwitchParameter\r\nAsJob                        System.Management.Automation.SwitchParameter\r\n\r\n   ParameterSet: class\r\n\r\nName          Alias Position Type\r\n----          ----- -------- ----\r\nLocale                       System.String\r\nImpersonation                System.Management.ImpersonationLevel\r\n\r\n   ParameterSet: list\r\n\r\nName         Alias Position Type\r\n----         ----- -------- ----\r\nNamespace                   System.String\r\nComputerName                System.String[]\r\nAuthority                   System.String\r\nList                        System.Management.Automation.SwitchParameter\r\nRecurse                     System.Management.Automation.SwitchParameter\r\n\r\n   ParameterSet: query\r\n\r\nName                Alias Position Type\r\n----                ----- -------- ----\r\nFilter                             System.String\r\nProperty                  1        System.String[]\r\nClass                     0        System.String\r\nEnableAllPrivileges                System.Management.Automation.SwitchParameter\r\nDirectRead                         System.Management.Automation.SwitchParameter\r\n\r\n   ParameterSet: WQLQuery\r\n\r\nName           Alias Position Type\r\n----           ----- -------- ----\r\nQuery                         System.String\r\nCredential                    System.Management.Automation.PSCredential\r\nAuthentication                System.Management.AuthenticationLevel\r\n\r\n.Inputs\r\n    [string]\r\n.Outputs\r\n    custom object\r\n.Link\r\n    http:\/\/jdhitsolutions.com\/blog\/2010\/07\/get-parameter\r\n.Link\r\n    Get-Command\r\n\r\n.Notes\r\n NAME:      Get-Parameter\r\n VERSION:   1.2\r\n AUTHOR:    Jeffery Hicks\r\n LASTEDIT:  July 20, 2010\r\n\r\n Learn more with a copy of Windows PowerShell 2.0: TFM (SAPIEN Press 2010)\r\n <span class=\"rem\">#&gt;<\/span>\r\n\r\nParam(\r\n[Parameter(Position=0,Mandatory=$True,\r\nValueFromPipeline=$True,ValueFromPipelineByPropertyName=$True,\r\nHelpMessage=<span class=\"str\">\"Enter a cmdlet name\"<\/span>)]\r\n[ValidateNotNullorEmpty()]\r\n[Alias(<span class=\"str\">\"name\"<\/span>)]\r\n[string]$command\r\n)\r\n\r\nProcess {\r\n    <span class=\"rem\">#define the set of common parameters to exclude<\/span>\r\n    $common=@(<span class=\"str\">\"Verbose\"<\/span>,\r\n    <span class=\"str\">\"Debug\"<\/span>,\r\n    <span class=\"str\">\"ErrorAction\"<\/span>,\r\n    <span class=\"str\">\"ErrorVariable\"<\/span>,\r\n    <span class=\"str\">\"WarningAction\"<\/span>,\r\n    <span class=\"str\">\"WarningVariable\"<\/span>,\r\n    <span class=\"str\">\"OutVariable\"<\/span>,\r\n    <span class=\"str\">\"OutBuffer\"<\/span>,\r\n    <span class=\"str\">\"WhatIf\"<\/span>,\r\n    <span class=\"str\">\"Confirm\"<\/span>)\r\n\r\n    Try {\r\n        $data=(Get-Command -Name $command -errorAction <span class=\"str\">\"Stop\"<\/span>).parameters\r\n    }\r\n    Catch {\r\n        Write-Warning <span class=\"str\">\"Failed to find command $command\"<\/span>\r\n    }\r\n    <span class=\"rem\">#keep going if parameters were found<\/span>\r\n    <span class=\"kwrd\">if<\/span> ($data.count <span class=\"preproc\">-gt<\/span> 0) {\r\n        <span class=\"rem\">#$data is a hash table<\/span>\r\n        $params=$data.keys | where {$common -notcontains $_}\r\n        $count=($params | measure-object).count\r\n        <span class=\"rem\">#only keep going if non-common parameters were found<\/span>\r\n        write-host <span class=\"str\">\"Found $count non-common parameters for $command\"<\/span> `\r\n        -ForegroundColor Green\r\n\r\n        <span class=\"kwrd\">if<\/span> ($count <span class=\"preproc\">-gt<\/span> 0) {\r\n            <span class=\"rem\">#get information from each parameter<\/span>\r\n\r\n            $params | <span class=\"kwrd\">foreach<\/span> {\r\n                $name=$_\r\n                $type=$data.item($name).ParameterType\r\n                $aliases=$data.item($name).Aliases\r\n                $attributes=$data.item($name).Attributes\r\n                <span class=\"kwrd\">if<\/span> ($attributes[0].position <span class=\"preproc\">-ge<\/span> 0) {\r\n                    $position=$attributes[0].position\r\n                  }\r\n                <span class=\"kwrd\">else<\/span> {\r\n                    $position=$null\r\n                }\r\n                <span class=\"rem\">#write a custom object to the pipeline    <\/span>\r\n                New-Object -TypeName PSObject -Property @{\r\n                    Name=$name\r\n                    Aliases=$aliases\r\n                    Mandatory=$attributes[0].mandatory\r\n                    Position=$position\r\n                    ValueFromPipeline=$attributes[0].ValueFromPipeline\r\n                    Type=$type\r\n                    ParameterSet=$attributes[0].ParameterSetName\r\n                }\r\n            } <span class=\"rem\">#foreach<\/span>\r\n        } <span class=\"rem\">#if $count<\/span>\r\n     } <span class=\"rem\">#if $data<\/span>\r\n     <span class=\"kwrd\">else<\/span> {\r\n        Write-Host <span class=\"str\">\"$command has no defined parameters\"<\/span> -ForegroundColor Red\r\n     }\r\n } <span class=\"rem\">#process<\/span>\r\n} <span class=\"rem\">#end function<\/span><\/pre>\n<\/div>\n<p>The function has comment based help and examples so be sure to take a look. Otherwise the function is pretty straight forward. I use it with an alias, gpa.<\/p>\n<div id=\"codeSnippetWrapper\">\n<pre id=\"codeSnippet\" class=\"csharpcode\">PS C:\\&gt; gpa new-object\r\nFound 5 non-common parameters <span class=\"kwrd\">for<\/span> new-object\r\n\r\nPosition          : 0\r\nName              : TypeName\r\nType              : System.String\r\nAliases           : {}\r\nValueFromPipeline : False\r\nMandatory         : True\r\nParameterSet      : Net\r\n\r\nPosition          : 0\r\nName              : ComObject\r\nType              : System.String\r\nAliases           : {}\r\nValueFromPipeline : False\r\nMandatory         : True\r\nParameterSet      : Com\r\n\r\nPosition          : 1\r\nName              : ArgumentList\r\nType              : System.Object[]\r\nAliases           : {Args}\r\nValueFromPipeline : False\r\nMandatory         : False\r\nParameterSet      : Net\r\n\r\nPosition          :\r\nName              : Strict\r\nType              : System.Management.Automation.SwitchParameter\r\nAliases           : {}\r\nValueFromPipeline : False\r\nMandatory         : False\r\nParameterSet      : Com\r\n\r\nPosition          :\r\nName              : Property\r\nType              : System.Collections.Hashtable\r\nAliases           : {}\r\nValueFromPipeline :\r\nMandatory         :\r\nParameterSet      :<\/pre>\n<\/div>\n<p>I'm sure it needs a few tweaks so let me know what works and what doesn't.\u00a0 You can download Get-Parameter.ps1 <a href=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2010\/07\/Get-Parameter.txt\" target=\"_blank\">here<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>As I continue to work on the 2nd edition of Managing Active Directory with Windows PowerShell: TFM, I find situations where I need a tool to get information out of Windows PowerShell. For example, the cmdlets in the Microsoft Active Directory module have a lot of parameters and I wanted to know some specifics. Now&#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":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[4,8],"tags":[32,93,534,540],"class_list":["post-714","post","type-post","status-publish","format-standard","hentry","category-powershell","category-scripting","tag-functions","tag-parameters","tag-powershell","tag-scripting"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Get Parameter &#8226; The Lonely Administrator<\/title>\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\/714\/get-parameter\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Get Parameter &#8226; The Lonely Administrator\" \/>\n<meta property=\"og:description\" content=\"As I continue to work on the 2nd edition of Managing Active Directory with Windows PowerShell: TFM, I find situations where I need a tool to get information out of Windows PowerShell. For example, the cmdlets in the Microsoft Active Directory module have a lot of parameters and I wanted to know some specifics. Now...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/jdhitsolutions.com\/blog\/powershell\/714\/get-parameter\/\" \/>\n<meta property=\"og:site_name\" content=\"The Lonely Administrator\" \/>\n<meta property=\"article:published_time\" content=\"2010-07-21T14:51:34+00:00\" \/>\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=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/714\\\/get-parameter\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/714\\\/get-parameter\\\/\"},\"author\":{\"name\":\"Jeffery Hicks\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"headline\":\"Get Parameter\",\"datePublished\":\"2010-07-21T14:51:34+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/714\\\/get-parameter\\\/\"},\"wordCount\":209,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"keywords\":[\"functions\",\"parameters\",\"PowerShell\",\"Scripting\"],\"articleSection\":[\"PowerShell\",\"Scripting\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/714\\\/get-parameter\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/714\\\/get-parameter\\\/\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/714\\\/get-parameter\\\/\",\"name\":\"Get Parameter &#8226; The Lonely Administrator\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#website\"},\"datePublished\":\"2010-07-21T14:51:34+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/714\\\/get-parameter\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/714\\\/get-parameter\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/714\\\/get-parameter\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"PowerShell\",\"item\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/category\\\/powershell\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Get Parameter\"}]},{\"@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":"Get Parameter &#8226; The Lonely Administrator","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\/714\/get-parameter\/","og_locale":"en_US","og_type":"article","og_title":"Get Parameter &#8226; The Lonely Administrator","og_description":"As I continue to work on the 2nd edition of Managing Active Directory with Windows PowerShell: TFM, I find situations where I need a tool to get information out of Windows PowerShell. For example, the cmdlets in the Microsoft Active Directory module have a lot of parameters and I wanted to know some specifics. Now...","og_url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/714\/get-parameter\/","og_site_name":"The Lonely Administrator","article_published_time":"2010-07-21T14:51:34+00:00","author":"Jeffery Hicks","twitter_card":"summary_large_image","twitter_creator":"@JeffHicks","twitter_site":"@JeffHicks","twitter_misc":{"Written by":"Jeffery Hicks","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/714\/get-parameter\/#article","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/714\/get-parameter\/"},"author":{"name":"Jeffery Hicks","@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"headline":"Get Parameter","datePublished":"2010-07-21T14:51:34+00:00","mainEntityOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/714\/get-parameter\/"},"wordCount":209,"commentCount":1,"publisher":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"keywords":["functions","parameters","PowerShell","Scripting"],"articleSection":["PowerShell","Scripting"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/714\/get-parameter\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/714\/get-parameter\/","url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/714\/get-parameter\/","name":"Get Parameter &#8226; The Lonely Administrator","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#website"},"datePublished":"2010-07-21T14:51:34+00:00","breadcrumb":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/714\/get-parameter\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/714\/get-parameter\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/714\/get-parameter\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"PowerShell","item":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},{"@type":"ListItem","position":2,"name":"Get Parameter"}]},{"@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":579,"url":"https:\/\/jdhitsolutions.com\/blog\/scripting\/579\/powershell-picasso\/","url_meta":{"origin":714,"position":0},"title":"PowerShell Picasso","author":"Jeffery Hicks","date":"February 23, 2010","format":false,"excerpt":"You have probably heard the story (or legend) about Pablo Picasso and his napkin drawing. A guy goes up to Picasso in a cafe and asks for an autograph or something. Picasso sketches out something in a minute or so. He turns to the guy and says, \u201cThat will be\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":"powershell--picasso","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2010\/02\/powershellpicasso_thumb.jpg?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":9057,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/9057\/using-powershell-your-way\/","url_meta":{"origin":714,"position":1},"title":"Using PowerShell Your Way","author":"Jeffery Hicks","date":"June 6, 2022","format":false,"excerpt":"I've often told people that I spend my day in a PowerShell prompt. I run almost my entire day with PowerShell. I've shared many of the tools I use daily on Github. Today, I want to share another way I have PowerShell work the way I need it, with minimal\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2022\/06\/dl.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2022\/06\/dl.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2022\/06\/dl.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2022\/06\/dl.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":7604,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/7604\/discovering-provider-specific-commands\/","url_meta":{"origin":714,"position":2},"title":"Discovering Provider Specific Commands","author":"Jeffery Hicks","date":"July 22, 2020","format":false,"excerpt":"I've been diving into PowerShell help lately while preparing my next Pluralsight course. One of the sad things I have discovered is the loss of provider-aware help. As you may know, some commands have parameters that only exist when using a specific PSDrive.\u00a0 For example, the -File parameter for Get-ChildItem\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\/07\/gsyn-2.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/07\/gsyn-2.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/07\/gsyn-2.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/07\/gsyn-2.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":7361,"url":"https:\/\/jdhitsolutions.com\/blog\/scripting\/7361\/powershell-7-cross-platform-scripting-tips-and-traps\/","url_meta":{"origin":714,"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":49,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/49\/reading-the-registry-in-powershell\/","url_meta":{"origin":714,"position":4},"title":"Reading the Registry in PowerShell","author":"Jeffery Hicks","date":"August 26, 2006","format":false,"excerpt":"One of the great PowerShell features is that it treats the registry like any other location or directory. In PowerShell you can connect directly to the registry and navigate the key hierarchy just as if it as a logical drive with folders. I have a very brief demonstration script you\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":1384,"url":"https:\/\/jdhitsolutions.com\/blog\/scripting\/1384\/create-a-master-powershell-online-help-page\/","url_meta":{"origin":714,"position":5},"title":"Create a Master PowerShell Online Help Page","author":"Jeffery Hicks","date":"April 28, 2011","format":false,"excerpt":"As I hope you know, PowerShell cmdlets can include links to online help. This is very handy because it is much easier to keep online help up to date. To see online help for a cmdlet use the -online parameter. get-help get-wmiobject -online I decided to take things to another\u2026","rel":"","context":"In &quot;Miscellaneous&quot;","block_context":{"text":"Miscellaneous","link":"https:\/\/jdhitsolutions.com\/blog\/category\/miscellaneous\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/714","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=714"}],"version-history":[{"count":0,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/714\/revisions"}],"wp:attachment":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=714"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=714"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=714"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}