{"id":15941,"date":"2011-01-11T00:01:00","date_gmt":"2011-01-11T00:01:00","guid":{"rendered":"https:\/\/blogs.technet.microsoft.com\/heyscriptingguy\/2011\/01\/11\/validate-powershell-parameters-before-running-the-script\/"},"modified":"2011-01-11T00:01:00","modified_gmt":"2011-01-11T00:01:00","slug":"validate-powershell-parameters-before-running-the-script","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/scripting\/validate-powershell-parameters-before-running-the-script\/","title":{"rendered":"Validate PowerShell Parameters Before Running the Script"},"content":{"rendered":"<p><span style=\"font-size:10.0pt\">&nbsp;<\/span><span style=\"font-size:10.0pt\">&nbsp;<\/span><\/p>\n<p><b><span style=\"font-size:10.0pt\">Summary:<\/span><\/b><span style=\"font-size:10.0pt\"> Learn how to use Windows PowerShell parameter validation attributes to check parameters before running the script.<\/span><\/p>\n<p><span style=\"font-size:10.0pt\">&nbsp;<\/span><\/p>\n<p><span style=\"font-size:10.0pt\"><span style=\"font-size: 10pt\"><span style=\"font-size: 10pt\"><span style=\"font-size: 10pt\"><span style=\"font-size: 10pt\"><span style=\"font-size: 10pt\"><span style=\"font-size: 10pt\"><span style=\"font-size: 10pt\"><span style=\"font-size: 10pt\"><span style=\"font-size: 10pt\"><span style=\"font-size: 10pt\"><span style=\"font-size: 10pt\"><span style=\"font-size: 10pt\"><span style=\"font-size: 10pt\"><span style=\"font-size: 10pt\"><span style=\"font-size: 10pt\"><span style=\"font-size: 10pt\"><span style=\"font-size: 10pt\"><span style=\"font-size: 10pt\"><span style=\"font-size: 10pt\"><span style=\"font-size: 10pt\"><span style=\"font-size: 10pt\"><span style=\"font-size: 10pt\"><img decoding=\"async\" height=\"34\" width=\"34\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/q-for-powertip.jpg\" align=\"left\" alt=\"Hey, Scripting Guy! Question\" border=\"0\" title=\"Hey, Scripting Guy! Question\" \/><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>Hey, Scripting Guy! I have a problem that I think that you can help me with. I have created a Windows PowerShell script that allows Help Desk people to enter information about users such as the user&rsquo;s telephone number. The idea is that when users call the Help Desk, the Help Desk technician updates the user&rsquo;s information in <a href=\"http:\/\/gallery.technet.microsoft.com\/ScriptCenter\/en-us\/site\/search?f%5B0%5D.Type=RootCategory&amp;f%5B0%5D.Value=activedirectory&amp;f%5B0%5D.Text=Active%20Directory\">Active Directory<\/a>. We tried using a self-service portal to do this but the users were unable to perform that task correctly. When we requested a data dump from Human Resources (HR), we found that much of the information was incomplete. My problem is that the Help Desk people do not appear to enjoy doing this job and therefore they are sloppy. I need something to add to my script to ensure that the information is entered in the proper format. That is where you come in, I hope. <\/span><\/p>\n<p><span style=\"font-size:10.0pt\">&#8212; HI<\/span><\/p>\n<p><span style=\"font-size:10.0pt\">&nbsp;<\/span><\/p>\n<p><span style=\"font-size:10.0pt\"><span style=\"font-size: 10pt\"><span style=\"font-size: 10pt\"><span style=\"font-size: 10pt\"><span style=\"font-size: 10pt\"><span style=\"font-size: 10pt\"><span style=\"font-size: 10pt\"><span style=\"font-size: 10pt\"><span style=\"font-size: 10pt\"><span style=\"font-size: 10pt\"><span style=\"font-size: 10pt\"><span style=\"font-size: 10pt\"><span style=\"font-size: 10pt\"><span style=\"font-size: 10pt\"><span style=\"font-size: 10pt\"><span style=\"font-size: 10pt\"><span style=\"font-size: 10pt\"><span style=\"font-size: 10pt\"><span style=\"font-size: 10pt\"><span style=\"font-size: 10pt\"><span style=\"font-size: 10pt\"><span style=\"font-size: 10pt\"><img decoding=\"async\" height=\"34\" width=\"34\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/a-for-powertip.jpg\" align=\"left\" alt=\"Hey, Scripting Guy! Answer\" border=\"0\" title=\"Hey, Scripting Guy! Answer\" \/><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>Hello HI, Microsoft Scripting Guy Ed Wilson here. Today is <a href=\"http:\/\/blogs.technet.com\/b\/heyscriptingguy\/archive\/2008\/01\/15\/how-can-i-add-a-record-to-a-database-using-windows-powershell.aspx\">Scripting Guys Day<\/a>! It does not mean that my boss will take me out for lunch, or even buy me flowers . However, it does mean that I intend to do what I want today (except for the three meetings I have, and the one report I have to generate). The things that I enjoy doing the most are answering email messages that are sent to <a href=\"mailto:Scripter@Microsoft.Com\">Scripter@Microsoft.Com<\/a> and hanging out on <a href=\"https:\/\/twitter.com\/Scriptingguys\">Twitter<\/a>. The fun thing about being the Microsoft Scripting Guy is getting to answer questions and help people to become more effective in using Windows PowerShell to resolve real-world problems. Yep, yep, yep, that is what I am going to do today. Not only is it Scripting Guys Day but the date can be expressed as 1-11-11 (that is 31 in decimal) &ndash; now that ought to count for something. <\/span><\/p>\n<p><span style=\"font-size:10.0pt\">As an aside, it is easy to perform numeric conversions using Windows PowerShell. To convert 11111 to decimal in Windows PowerShell, I use the static <b>toInt16<\/b> method from the <b>system.convert<\/b> .NET Framework class. This is shown here.<\/span><\/p>\n<p class=\"CodeBlock\" style=\"margin-left:0.5in\"><span style=\"font-size: 10pt\"><span style=\"font-family: courier new,courier\">PS C:\\&gt; [convert]::ToInt16(11111,2)<\/span><\/span><\/p>\n<p class=\"CodeBlock\" style=\"margin-left:0.5in\"><span style=\"font-size: 10pt\"><span style=\"font-family: courier new,courier\">31<\/span><\/span><\/p>\n<p><span style=\"font-size:10.0pt\">&nbsp;<\/span><\/p>\n<p><span style=\"font-size:10.0pt\">If on the other hand, I want to convert decimal 31 to binary, I use the <b>ToString<\/b> static method. This is seen here.<\/span><\/p>\n<p class=\"CodeBlock\" style=\"margin-left:0.5in\"><span style=\"font-size: 10pt\"><span style=\"font-family: courier new,courier\">PS C:\\&gt; [convert]::ToString(31,2)<\/span><\/span><\/p>\n<p class=\"CodeBlock\" style=\"margin-left:0.5in\"><span style=\"font-size: 10pt\"><span style=\"font-family: courier new,courier\">11111<\/span><\/span><\/p>\n<p><span style=\"font-size:10.0pt\">&nbsp;<\/span><\/p>\n<p><span style=\"font-size:10.0pt\">By the way, I can convert 31 to hexadecimal by also using the <b>toString <\/b>static method. This time, I specify that I want base 16. This is seen here.<\/span><\/p>\n<p class=\"CodeBlock\" style=\"margin-left:0.5in\"><span style=\"font-size: 10pt\"><span style=\"font-family: courier new,courier\">PS C:\\&gt; [convert]::ToString(31,16)<\/span><\/span><\/p>\n<p class=\"CodeBlock\" style=\"margin-left:0.5in\"><span style=\"font-size: 10pt\"><span style=\"font-family: courier new,courier\">1f<\/span><\/span><\/p>\n<p><span style=\"font-size:10.0pt\">&nbsp;<\/span><\/p>\n<p><span style=\"font-size:10.0pt\">In the past, <a href=\"http:\/\/blogs.technet.com\/b\/heyscriptingguy\/archive\/tags\/windows+powershell\/retrieving+input\/\">I have written about retrieving input<\/a>, and about validating input by using various mechanisms. Today, I want to look at using parameter validation attributes. I am going to make it easy and examine telephone numbers. I say make it easy because I recently talked <a href=\"http:\/\/blogs.technet.com\/b\/heyscriptingguy\/archive\/2009\/04\/13\/how-can-i-create-a-phone-directory-from-files-with-varying-text-formats.aspx\">about how to use regular expressions to validate telephone numbers<\/a>. Refer to that article for the Regex pattern explanation. A basic parameter validation for telephone numbers is seen in the <b>Test-ParameterPatternBasic.ps1<\/b> script. <\/span><\/p>\n<p class=\"CodeBlockScreenedHead\" style=\"padding-left: 30px;background: none transparent scroll repeat 0% 0%\"><span style=\"font-size:10.0pt\"><strong>Test-ParameterPatternBasic.ps1<\/strong><\/span><\/p>\n<p class=\"CodeBlockScreened\" style=\"padding-left: 30px;background: none transparent scroll repeat 0% 0%\"><span style=\"font-size: 10pt\"><span style=\"font-family: courier new,courier\">Function Test-Parameters<\/span><\/span><\/p>\n<p class=\"CodeBlockScreened\" style=\"padding-left: 30px;background: none transparent scroll repeat 0% 0%\"><span style=\"font-size: 10pt\"><span style=\"font-family: courier new,courier\">{<\/span><\/span><\/p>\n<p class=\"CodeBlockScreened\" style=\"padding-left: 30px;background: none transparent scroll repeat 0% 0%\"><span style=\"font-size: 10pt\"><span style=\"font-family: courier new,courier\"><span>&nbsp;<\/span>Param(<\/span><\/span><\/p>\n<p class=\"CodeBlockScreened\" style=\"padding-left: 30px;background: none transparent scroll repeat 0% 0%\"><span style=\"font-size: 10pt\"><span style=\"font-family: courier new,courier\"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>[ValidatePattern(&#8220;\\d{3}-\\d{3}-\\d{4}&#8221;)]<\/span><\/span><\/p>\n<p class=\"CodeBlockScreened\" style=\"padding-left: 30px;background: none transparent scroll repeat 0% 0%\"><span style=\"font-size: 10pt\"><span style=\"font-family: courier new,courier\"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>$phoneNumber<\/span><\/span><\/p>\n<p class=\"CodeBlockScreened\" style=\"padding-left: 30px;background: none transparent scroll repeat 0% 0%\"><span style=\"font-size: 10pt\"><span style=\"font-family: courier new,courier\"><span>&nbsp;<\/span>)<\/span><\/span><\/p>\n<p class=\"CodeBlockScreened\" style=\"padding-left: 30px;background: none transparent scroll repeat 0% 0%\"><span style=\"font-size: 10pt\"><span style=\"font-family: courier new,courier\"><span>&nbsp; <\/span>Write-host &#8220;The phone number $phoneNumber is valid&#8221;<\/span><\/span><\/p>\n<p class=\"CodeBlockScreened\" style=\"padding-left: 30px;background: none transparent scroll repeat 0% 0%\"><span style=\"font-size:10.0pt\"><span><span style=\"font-family: courier new,courier\">&nbsp;<\/span><\/span><\/span><\/p>\n<p class=\"CodeBlockScreened\" style=\"padding-left: 30px;background: none transparent scroll repeat 0% 0%\"><span style=\"font-size: 10pt\"><span style=\"font-family: courier new,courier\"><span>&nbsp;<\/span>} #end function Test-Parameters<\/span><\/span><\/p>\n<p class=\"CodeBlockScreened\" style=\"padding-left: 30px;background: none transparent scroll repeat 0% 0%\"><span style=\"font-size:10.0pt\"><span><span style=\"font-family: courier new,courier\">&nbsp;<\/span><\/span><\/span><\/p>\n<p class=\"CodeBlockScreened\" style=\"padding-left: 30px;background: none transparent scroll repeat 0% 0%\"><span style=\"font-size: 10pt\"><span style=\"font-family: courier new,courier\"><span>&nbsp;<\/span>Test-Parameters -phoneNumber 999-555-1212<\/span><\/span><\/p>\n<p><span style=\"font-size:10.0pt\">&nbsp;<\/span><\/p>\n<p><span style=\"font-size:10.0pt\">The &ldquo;trick&rdquo; is to use the <b>[ValidatePattern()]<\/b> parameter validation attribute. Inside the () I place the regex pattern I want to use to validate the input value to the parameter. Here the regex pattern is &#8220;\\d{3}-\\d{3}-\\d{4}&rdquo;. That is the pattern that I copied from my previous Hey, Scripting Guy! Blog post. The pattern tells me that I am looking for three digits separated by a dash, followed by three digits, a dash, and four more digits. That is it. <\/span><\/p>\n<p><span style=\"font-size:10.0pt\">As for placement of the <b>[ValidatePattern(&#8220;\\d{3}-\\d{3}-\\d{4}&#8221;)]<\/b> attribute, it is placed before the parameter, but after the <b>Param<\/b> statement. I like to place them on their individual line in the script to ensure readability. Then the script runs, and a valid telephone number is submitted a message is displayed that the telephone number is valid. The cool thing is that the telephone number does not have to be enclosed in quotation marks. The output is seen in the following figure.<\/span><\/p>\n<p><span style=\"font-size:10.0pt\"><img decoding=\"async\" src=\"https:\/\/msdnshared.blob.core.windows.net\/media\/TNBlogsFS\/prod.evol.blogs.technet.com\/CommunityServer.Blogs.Components.WeblogFiles\/00\/00\/00\/76\/18\/7673.HSG-1-11-11-01.jpg\" border=\"0\" \/><\/span><span style=\"font-size:10.0pt\">&nbsp;<\/span><\/p>\n<p><span style=\"font-size:10.0pt\">If a telephone number is submitted (or anything else that does not match the pattern previously described) an error will be generated. This error will describe the expected pattern, and is illustrated in the following figure. (I have highlighted the pattern portion of the error in yellow, and drawn an arrow to it. Normally, the error message would appear without these emendations.)<\/span><\/p>\n<p class=\"Num-Caption\"><span style=\"font-size:10.0pt\"><img decoding=\"async\" src=\"https:\/\/msdnshared.blob.core.windows.net\/media\/TNBlogsFS\/prod.evol.blogs.technet.com\/CommunityServer.Blogs.Components.WeblogFiles\/00\/00\/00\/76\/18\/2308.HSG-1-11-11-02.jpg\" border=\"0\" \/><\/span><span style=\"font-size:10.0pt\">&nbsp;<\/span><\/p>\n<p><span style=\"font-size:10.0pt\">If the parameter is mandatory (as in the case of this script) I like to use the mandatory parameter attribute. When I do this, I also like to supply a help message that will be displayed if the function is called without supplying a value for the parameter. The revised script that uses the mandatory parameter attribute is seen here. <\/span><\/p>\n<p class=\"CodeBlockScreenedHead\" style=\"padding-left: 30px;background: none transparent scroll repeat 0% 0%\"><span style=\"font-size:10.0pt\"><strong>Test-ParameterPatternAdvanced.ps1<\/strong><\/span><\/p>\n<p class=\"CodeBlockScreened\" style=\"padding-left: 30px;background: none transparent scroll repeat 0% 0%\"><span style=\"font-size: 10pt\"><span style=\"font-family: courier new,courier\">Function Test-Parameters<\/span><\/span><\/p>\n<p class=\"CodeBlockScreened\" style=\"padding-left: 30px;background: none transparent scroll repeat 0% 0%\"><span style=\"font-size: 10pt\"><span style=\"font-family: courier new,courier\">{<\/span><\/span><\/p>\n<p class=\"CodeBlockScreened\" style=\"padding-left: 30px;background: none transparent scroll repeat 0% 0%\"><span style=\"font-size: 10pt\"><span style=\"font-family: courier new,courier\"><span>&nbsp;<\/span>Param(<\/span><\/span><\/p>\n<p class=\"CodeBlockScreened\" style=\"padding-left: 30px;background: none transparent scroll repeat 0% 0%\"><span style=\"font-size: 10pt\"><span style=\"font-family: courier new,courier\"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>[Parameter(Mandatory=$true, <\/span><\/span><\/p>\n<p class=\"CodeBlockScreened\" style=\"padding-left: 30px;background: none transparent scroll repeat 0% 0%\"><span style=\"font-size: 10pt\"><span style=\"font-family: courier new,courier\"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>HelpMessage=&#8221;Enter a valid telephone number xxx-xxx-xxxx&#8221;)] <\/span><\/span><\/p>\n<p class=\"CodeBlockScreened\" style=\"padding-left: 30px;background: none transparent scroll repeat 0% 0%\"><span style=\"font-size: 10pt\"><span style=\"font-family: courier new,courier\">&nbsp;<\/span><\/span><\/p>\n<p class=\"CodeBlockScreened\" style=\"padding-left: 30px;background: none transparent scroll repeat 0% 0%\"><span style=\"font-size: 10pt\"><span style=\"font-family: courier new,courier\"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>[ValidatePattern(&#8220;\\d{3}-\\d{3}-\\d{4}&#8221;)]<\/span><\/span><\/p>\n<p class=\"CodeBlockScreened\" style=\"padding-left: 30px;background: none transparent scroll repeat 0% 0%\"><span style=\"font-size: 10pt\"><span style=\"font-family: courier new,courier\"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>$phoneNumber<\/span><\/span><\/p>\n<p class=\"CodeBlockScreened\" style=\"padding-left: 30px;background: none transparent scroll repeat 0% 0%\"><span style=\"font-size: 10pt\"><span style=\"font-family: courier new,courier\"><span>&nbsp;<\/span>)<\/span><\/span><\/p>\n<p class=\"CodeBlockScreened\" style=\"padding-left: 30px;background: none transparent scroll repeat 0% 0%\"><span style=\"font-size: 10pt\"><span style=\"font-family: courier new,courier\"><span>&nbsp; <\/span>Write-host &#8220;The phone number $phoneNumber is valid&#8221;<\/span><\/span><\/p>\n<p class=\"CodeBlockScreened\" style=\"padding-left: 30px;background: none transparent scroll repeat 0% 0%\"><span style=\"font-size:10.0pt\"><span><span style=\"font-family: courier new,courier\">&nbsp;<\/span><\/span><\/span><\/p>\n<p class=\"CodeBlockScreened\" style=\"padding-left: 30px;background: none transparent scroll repeat 0% 0%\"><span style=\"font-size: 10pt\"><span style=\"font-family: courier new,courier\"><span>&nbsp;<\/span>} #end function Test-Parameters<\/span><\/span><\/p>\n<p class=\"CodeBlockScreened\" style=\"padding-left: 30px;background: none transparent scroll repeat 0% 0%\"><span style=\"font-size:10.0pt\"><span><span style=\"font-family: courier new,courier\">&nbsp;<\/span><\/span><\/span><\/p>\n<p class=\"CodeBlockScreened\" style=\"padding-left: 30px;background: none transparent scroll repeat 0% 0%\"><span style=\"font-size: 10pt\"><span style=\"font-family: courier new,courier\"><span>&nbsp;<\/span>Test-Parameters -phoneNumber 111-555-1212<\/span><\/span><\/p>\n<p><span style=\"font-size:10.0pt\">&nbsp;<\/span><\/p>\n<p><span style=\"font-size:10.0pt\">The only change to the script was adding the mandatory parameter attribute. This is seen here.<\/span><\/p>\n<p class=\"CodeBlock\" style=\"margin-left:0.5in\"><span style=\"font-size: 10pt\"><span style=\"font-family: courier new,courier\"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>[Parameter(Mandatory=$true, <\/span><\/span><\/p>\n<p class=\"CodeBlock\" style=\"margin-left:0.5in\"><span style=\"font-size: 10pt\"><span style=\"font-family: courier new,courier\"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>HelpMessage=&#8221;Enter a valid telephone number xxx-xxx-xxxx&#8221;)]<\/span><\/span><\/p>\n<p><span style=\"font-size:10.0pt\">&nbsp;<\/span><\/p>\n<p><span style=\"font-size:10.0pt\">No commas are used to separate the two parameter validation attributes. Here the mandatory attribute and help message are a single command that is broken into two lines to display it on the blog. When the script is run, and the mandatory parameter is absent, a dialog appears (when running in Windows PowerShell ISE) with the help text listed below the prompt. This is seen in the following figure.<\/span><\/p>\n<p class=\"Num-Caption\"><span style=\"font-size:10.0pt\"><img decoding=\"async\" src=\"https:\/\/msdnshared.blob.core.windows.net\/media\/TNBlogsFS\/prod.evol.blogs.technet.com\/CommunityServer.Blogs.Components.WeblogFiles\/00\/00\/00\/76\/18\/3225.HSG-1-11-11-03.jpg\" border=\"0\" \/><\/span><span style=\"font-size:10.0pt\">&nbsp;<\/span><\/p>\n<p><span style=\"font-size:10.0pt\">HI, that is all there is to using parameter validation attributes. Input week will continue tomorrow. <\/span><\/p>\n<p><span style=\"font-size:10.0pt\">I invite you to follow me on <a target=\"_blank\" href=\"http:\/\/bit.ly\/scriptingguystwitter\">Twitter<\/a> or <a href=\"http:\/\/bit.ly\/scriptingguysfacebook\">Facebook<\/a>. If you have any questions, send email to me at <a target=\"_blank\" href=\"mailto:scripter@microsoft.com\">scripter@microsoft.com<\/a> or post them on the <a href=\"http:\/\/social.technet.microsoft.com\/Forums\/en\/ITCG\/threads\/\">Official Scripting Guys Forum<\/a>. See you tomorrow. Until then, peace.<\/span><\/p>\n<p><span style=\"font-size:10.0pt\">&nbsp;<\/span><\/p>\n<p><b><span style=\"font-size:10.0pt\">Ed Wilson, Microsoft Scripting Guy<\/span><\/b><\/p>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp;&nbsp; Summary: Learn how to use Windows PowerShell parameter validation attributes to check parameters before running the script. &nbsp; Hey, Scripting Guy! I have a problem that I think that you can help me with. I have created a Windows PowerShell script that allows Help Desk people to enter information about users such as the [&hellip;]<\/p>\n","protected":false},"author":595,"featured_media":87096,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[22,3,4,45],"class_list":["post-15941","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-scripting","tag-retrieving-input","tag-scripting-guy","tag-scripting-techniques","tag-windows-powershell"],"acf":[],"blog_post_summary":"<p>&nbsp;&nbsp; Summary: Learn how to use Windows PowerShell parameter validation attributes to check parameters before running the script. &nbsp; Hey, Scripting Guy! I have a problem that I think that you can help me with. I have created a Windows PowerShell script that allows Help Desk people to enter information about users such as the [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/15941","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/users\/595"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/comments?post=15941"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/15941\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/media\/87096"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/media?parent=15941"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/categories?post=15941"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/tags?post=15941"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}