{"id":8701,"date":"2012-07-16T00:01:00","date_gmt":"2012-07-16T00:01:00","guid":{"rendered":"https:\/\/blogs.technet.microsoft.com\/heyscriptingguy\/2012\/07\/16\/use-powershell-to-detect-and-fix-files-with-leading-spaces\/"},"modified":"2012-07-16T00:01:00","modified_gmt":"2012-07-16T00:01:00","slug":"use-powershell-to-detect-and-fix-files-with-leading-spaces","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/scripting\/use-powershell-to-detect-and-fix-files-with-leading-spaces\/","title":{"rendered":"Use PowerShell to Detect and Fix Files with Leading Spaces"},"content":{"rendered":"<p><b>Summary<\/b>: Microsoft Scripting Guy, Ed Wilson, shows how to use Windows PowerShell to detect and to fix files that have leading spaces in the file name.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/q-for-powertip.jpg\" alt=\"Hey, Scripting Guy! Question\" \/> Hey, Scripting Guy! I am hoping that you can help me. We have a rather strange problem at work, and if I do not get to the end of it, I am afraid I might be looking for a new job. The reason is that for some reason we are getting files that have a leading space in the file name on one of our storage servers. This is only part of the problem because our backup program is rather old. It works&mdash;except that it fails when it finds a file with a leading space in the file name. You might say we should upgrade our backup program, and that would be fine, except that our tape array is no longer supported and new backup programs do not have the correct driver. I know, I know, I know. But, for now, I need to figure out a way to detect files that are getting this leading space in the file name. As luck would have it, the way we found out that the files were not getting backed up is that our CEO corrupted one of the files that had the leading space in it, and when we attempted to restore the file, we discovered the problem. Of course, we did not replace the guy who was in charge of backups and who must have been the last planet to know about the software and the old tape array, but no one wants to hear about that. Well anyway, now I am &ldquo;on notice&rdquo; and I am really hoping you can help me.<\/p>\n<p>&mdash;KS<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/a-for-powertip.jpg\" alt=\"Hey, Scripting Guy! Answer\" \/> Hello KS,<\/p>\n<p>Microsoft Scripting Guy, Ed Wilson, is here. Wow! KS, I am sorry things have not been going so well for you recently. I am really saddened to hear about your problems at work. To be honest, I do not think I have ever created a file with a leading space in the name&mdash;don&rsquo;t know why I would want to do so. As a matter of a fact, I am not certain that until I read your email to <a href=\"mailto:scripter@microsoft.com\">scripter@microsoft.com<\/a>, I even knew that one could create a file with a leading space in it.<\/p>\n<p>The first thing I decided to do was to create a file with a leading space in it. I opened Windows File Explorer, and created a new text file with 10 leading spaces. This is shown in the image that follows.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/2804.HSG-7-16-12-01.png\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/2804.HSG-7-16-12-01.png\" alt=\"Image of menu\" title=\"Image of menu\" \/><\/a><\/p>\n<p>But when I pressed ENTER, it seems that Windows Explorer stripped out the leading spaces. This is shown in the image that follows.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/3733.HSG-7-16-12-02.png\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/3733.HSG-7-16-12-02.png\" alt=\"Image of menu\" title=\"Image of menu\" \/><\/a><\/p>\n<p>Of course, the best way to check this is to use Windows PowerShell. To do this, I run the following Windows PowerShell code, which gets the length of the file name, and uses the <b>Trim<\/b><i> <\/i>string method to remove excess spaces. Nothing returns, which lends credence to my suspicion.<\/p>\n<p style=\"padding-left: 30px\">PS C:\\a&gt; gci -Recurse | % { if($_.name.length -ne $_.name.trim().length) { &#8220;file with space&#8221;}}<\/p>\n<p>KS, based on this easy test, it would seem that Windows File Explorer, at least, does not permit creating files with spaces at the beginning of the name. So someone is using some other method to create the files. If I am going to test my code, I need a quick easy way to create files with leading spaces. To do that, I need to use Windows PowerShell. I create a function called <b>New-FilesWithLeadingSpaces<\/b>. This function accepts three parameters. The first is the path to create the files, and the second is a base file name parameter. I set the default value to <b>myfile.txt<\/b>, but you could use any string you choose to do this. The final parameter is <b>Count<\/b>, which tells the function how many files to create. Inside the function, I have a <b>for<\/b><i> <\/i>loop that counts up to the <b>Count<\/b> property. Inside the loop I create a space padding string that I prepend to each <b>FileBaseName<\/b>. Of course the <b>ItemType<\/b> is file. Here is the new <b>New-FilesWithLeadingSpaces<\/b> function:<\/p>\n<p style=\"padding-left: 30px\"><b>Function New-FilesWithLeadingSpaces<\/b><\/p>\n<p style=\"padding-left: 30px\">{<\/p>\n<p style=\"padding-left: 30px\">&nbsp;Param([string]$path = &#8220;c:\\test&#8221;,<\/p>\n<p style=\"padding-left: 30px\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [string]$FileBaseName = &#8220;myfile.txt&#8221;,<\/p>\n<p style=\"padding-left: 30px\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [int]$count)<\/p>\n<p style=\"padding-left: 30px\">&nbsp; For($i = 0; $i -le $count ;$i ++)<\/p>\n<p style=\"padding-left: 30px\">&nbsp;&nbsp;&nbsp; { $pad = &#8221; &#8221; * $i<\/p>\n<p style=\"padding-left: 30px\">&nbsp;&nbsp;&nbsp;&nbsp; New-item -Path $path -Name &#8220;$pad$FileBasename&#8221; -ItemType file}<\/p>\n<p style=\"padding-left: 30px\">} #end function new-FileWithLeadingSpaces<\/p>\n<p>When I run the script, I bounce over to the Windows File Explorer, and it is obvious that Windows does, in fact, permit files with a leading space&mdash;KS, a fact unfortunately of which you are painfully aware. The Windows File Explorer results are shown here:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/2821.HSG-7-16-12-03.png\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/2821.HSG-7-16-12-03.png\" alt=\"Image of menu\" title=\"Image of menu\" \/><\/a><\/p>\n<p>So, I created a new function called <b>Get-FilesWithLeadingSpaces<\/b>. This function accepts a single parameter, <b>Path<\/b>, which specifies from whence the search begins. Next, the <b>Get-ChildItem<\/b> cmdlet with the <b>&ndash;recurse<\/b> switch is used to return the <b>FileInfo<\/b> objects that are piped to the <b>Foreach-Object<\/b> cmdlet. Inside the loop, the length of a file name is compared with the length of the file name after using the <b>Trim<\/b><i> <\/i>method to remove any trailing spaces. Using the <b>Trim<\/b><i> <\/i>string method is perfect for this application. The following illustrates using <b>Trim<\/b><i>. <\/i>First, a variable that holds five spaces and the word <b>fiveSpaces<\/b> is created. That value displays and shows that there are five spaces preceding the value. Now, the <b>Trim<\/b> method is called to remove the spaces. This is shown here:<\/p>\n<p style=\"padding-left: 30px\">PS C:\\a&gt; $name = &#8221;&nbsp;&nbsp;&nbsp;&nbsp; fiveSpaces&#8221;<\/p>\n<p style=\"padding-left: 30px\">PS C:\\a&gt; $name<\/p>\n<p style=\"padding-left: 30px\">&nbsp;&nbsp;&nbsp;&nbsp; fiveSpaces<\/p>\n<p style=\"padding-left: 30px\">PS C:\\a&gt; $name.Trim()<\/p>\n<p style=\"padding-left: 30px\">fiveSpaces<\/p>\n<p>If the length of the trimmed file name is not equal to the file name, it means that it contains either leading or trailing spaces. Therefore, the file name displays to the console. The complete function is shown here:<\/p>\n<p style=\"padding-left: 30px\"><b>Function Get-FilesWithLeadingSpaces<\/b><\/p>\n<p style=\"padding-left: 30px\">{<\/p>\n<p style=\"padding-left: 30px\">&nbsp;Param([string]$path = &#8220;c:\\a&#8221;)<\/p>\n<p style=\"padding-left: 30px\">&nbsp;Get-ChildItem -Path $path -Recurse |<\/p>\n<p style=\"padding-left: 30px\">&nbsp;foreach-object {<\/p>\n<p style=\"padding-left: 30px\">&nbsp;&nbsp; if($_.name.length -ne $_.name.trim().length)<\/p>\n<p style=\"padding-left: 30px\">&nbsp;&nbsp;&nbsp; { &#8220;$($_.basename) contains a leading space&#8221;} }<\/p>\n<p style=\"padding-left: 30px\">} #end function Get-FilesWithLeadingSpaces<\/p>\n<p>When the function loads and is run, the output in the Windows PowerShell ISE appears as shown here:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/6283.HSG-7-16-12-04.png\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/6283.HSG-7-16-12-04.png\" alt=\"Image of command output\" title=\"Image of command output\" \/><\/a><\/p>\n<p>If there was only one file, renaming it might not be too bad. But in the case of my example, if I renamed each file after removing the leading spaces, I would end up with a bunch of duplicate files. Therefore, I decided to add a counter number to the file name after renaming it. Renaming a file in Windows PowerShell is trivial because there is a <b>Rename-Item<\/b> cmdlet that takes a <b>Path<\/b><i> <\/i>and a new <b>Name<\/b> parameter. Rather than creating a new function with much of the same capabilities of the <b>Get-FilesWithLeadingSpaces<\/b> function (such as detecting files that have a leading space in the name, I decided instead to add a <b>Rename<\/b><i> <\/i>switch to rename the files with leading spaces in the name. Adding a switched parameter is super easy in Windows PowerShell&mdash;all you do is use the <b>[switch]<\/b> type constraint in front of the variable name as shown here:<\/p>\n<p style=\"padding-left: 30px\">[switch]$rename<\/p>\n<p>Because I wanted an easy way to create a unique file name, I added a counter variable at the <b>Begin<\/b><i> <\/i>portion of the <b>Foreach-Object<\/b> command. In the <b>Begin<\/b><i> <\/i>portion, I set the value of the <b>$count<\/b> variable to 0. This appears here.<\/p>\n<p style=\"padding-left: 30px\">-Begin {$count = 0}<\/p>\n<p>When I detect that I have a file name with spaces either before or after the file name, I check to see if the <b>$rename<\/b> switch appears. If it does, the <b>Rename-Item<\/b> cmdlet renames the file. The path is the <b>FullName<\/b><i> <\/i>property from the <b>FileInfo<\/b> object. The <b>FullName<\/b><i> <\/i>property contains the complete path to the file, and it should always be used when working with files that are discovered via the <b>Get-Item<\/b> cmdlet (this is one good property name to remember). Next, the new name needs to be created. First I take the <b>BaseName<\/b> property&mdash;that is the file name without the path or the file extension. I trim that <b>BaseName<\/b>, and then I use the count number from the <b>$count<\/b> variable. Lastly, I add back in the file extension. The file extension is always available from the <b>Extension<\/b><i> <\/i>property. If at any time you are not certain of what properties you have available to you, use the <b>Get-Member<\/b> cmdlet to display the properties of your file. This technique is shown here:<\/p>\n<p style=\"padding-left: 30px\">PS C:\\a&gt; Get-Item .\\myfile.txt | Get-Member -MemberType property<\/p>\n<p style=\"padding-left: 30px\">&nbsp;<\/p>\n<p style=\"padding-left: 30px\">&nbsp;&nbsp; TypeName: System.IO.FileInfo<\/p>\n<p style=\"padding-left: 30px\">&nbsp;<\/p>\n<p style=\"padding-left: 30px\">Name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MemberType Definition<\/p>\n<p style=\"padding-left: 30px\">&#8212;-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8212;&#8212;&#8212;- &#8212;&#8212;&#8212;-<\/p>\n<p style=\"padding-left: 30px\">Attributes&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Property&nbsp;&nbsp; System.IO.FileAttributes Attributes {get;set;}<\/p>\n<p style=\"padding-left: 30px\">CreationTime&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Property&nbsp;&nbsp; System.DateTime CreationTime {get;set;}<\/p>\n<p style=\"padding-left: 30px\">CreationTimeUtc&nbsp;&nbsp; Property&nbsp;&nbsp; System.DateTime CreationTimeUtc {get;set;}<\/p>\n<p style=\"padding-left: 30px\">Directory&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Property&nbsp;&nbsp; System.IO.DirectoryInfo Directory {get;}<\/p>\n<p style=\"padding-left: 30px\">DirectoryName&nbsp;&nbsp;&nbsp;&nbsp; Property&nbsp;&nbsp; System.String DirectoryName {get;}<\/p>\n<p style=\"padding-left: 30px\">Exists&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Property&nbsp;&nbsp; System.Boolean Exists {get;}<\/p>\n<p style=\"padding-left: 30px\">Extension&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Property&nbsp;&nbsp; System.String Extension {get;}<\/p>\n<p style=\"padding-left: 30px\">FullName&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Property&nbsp;&nbsp; System.String FullName {get;}<\/p>\n<p style=\"padding-left: 30px\">IsReadOnly&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Property&nbsp;&nbsp; System.Boolean IsReadOnly {get;set;}<\/p>\n<p style=\"padding-left: 30px\">LastAccessTime&nbsp;&nbsp;&nbsp; Property&nbsp;&nbsp; System.DateTime LastAccessTime {get;set;}<\/p>\n<p style=\"padding-left: 30px\">LastAccessTimeUtc Property&nbsp;&nbsp; System.DateTime LastAccessTimeUtc {get;set;}<\/p>\n<p style=\"padding-left: 30px\">LastWriteTime&nbsp;&nbsp;&nbsp;&nbsp; Property&nbsp;&nbsp; System.DateTime LastWriteTime {get;set;}<\/p>\n<p style=\"padding-left: 30px\">LastWriteTimeUtc&nbsp; Property&nbsp;&nbsp; System.DateTime LastWriteTimeUtc {get;set;}<\/p>\n<p style=\"padding-left: 30px\">Length&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Property&nbsp;&nbsp; System.Int64 Length {get;}<\/p>\n<p style=\"padding-left: 30px\">Name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Property&nbsp;&nbsp; System.String Name {get;}<\/p>\n<p style=\"padding-left: 30px\">The newly added <i>rename <\/i>clause appears here.<\/p>\n<p style=\"padding-left: 30px\">if($rename)<\/p>\n<p style=\"padding-left: 30px\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<\/p>\n<p style=\"padding-left: 30px\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Rename-Item -Path $_.fullname -NewName (&#8220;{0}{1}{2}&#8221; -f `<\/p>\n<p style=\"padding-left: 30px\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $_.basename.trim(),$count,$_.extension)<\/p>\n<p style=\"padding-left: 30px\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $count++<\/p>\n<p style=\"padding-left: 30px\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<\/p>\n<p>The complete function is shown here:<\/p>\n<p style=\"padding-left: 30px\"><strong>Function Get-FilesWithLeadingSpaces<\/strong><\/p>\n<p style=\"padding-left: 30px\">{<\/p>\n<p style=\"padding-left: 30px\">&nbsp;Param(<\/p>\n<p style=\"padding-left: 30px\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [string]$path = &#8220;c:\\a&#8221;,<\/p>\n<p style=\"padding-left: 30px\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [switch]$rename<\/p>\n<p style=\"padding-left: 30px\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; )<\/p>\n<p style=\"padding-left: 30px\">&nbsp;Get-ChildItem -Path $path -Recurse |<\/p>\n<p style=\"padding-left: 30px\">&nbsp;foreach-object -Begin {$count = 0} -process {<\/p>\n<p style=\"padding-left: 30px\">&nbsp;&nbsp; if($_.name.length -ne $_.name.trim().length)<\/p>\n<p style=\"padding-left: 30px\">&nbsp;&nbsp;&nbsp; {<\/p>\n<p style=\"padding-left: 30px\">&nbsp;&nbsp;&nbsp;&nbsp; if($rename)<\/p>\n<p style=\"padding-left: 30px\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<\/p>\n<p style=\"padding-left: 30px\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Rename-Item -Path $_.fullname -NewName (&#8220;{0}{1}{2}&#8221; -f `<\/p>\n<p style=\"padding-left: 30px\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $_.basename.trim(),$count,$_.extension)<\/p>\n<p style=\"padding-left: 30px\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $count++<\/p>\n<p style=\"padding-left: 30px\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<\/p>\n<p style=\"padding-left: 30px\">&nbsp;&nbsp;&nbsp;&nbsp; else<\/p>\n<p style=\"padding-left: 30px\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {&#8220;$($_.basename) contains a leading space&#8221;}} }<\/p>\n<p style=\"padding-left: 30px\">} #end function Get-FilesWithLeadingSpaces<\/p>\n<p>After I run the function, I go back into the Windows File Explorer to see if it worked. As shown here, it worked perfectly.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/5047.HSG-7-16-12-05.png\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/5047.HSG-7-16-12-05.png\" alt=\"Image of menu\" title=\"Image of menu\" \/><\/a><\/p>\n<p>KS, that is all there is to using Windows PowerShell to detect files that have leading spaces. Join me tomorrow for more good Windows PowerShell stuff.<\/p>\n<p>I invite you to follow me on <a href=\"http:\/\/bit.ly\/scriptingguystwitter\" target=\"_blank\">Twitter<\/a> and <a href=\"http:\/\/bit.ly\/scriptingguysfacebook\" target=\"_blank\">Facebook<\/a>. If you have any questions, send email to me at <a href=\"mailto:scripter@microsoft.com\" target=\"_blank\">scripter@microsoft.com<\/a>, or post your questions on the <a href=\"http:\/\/bit.ly\/scriptingforum\" target=\"_blank\">Official Scripting Guys Forum<\/a>. See you tomorrow. Until then, peace.<\/p>\n<p><b>Ed Wilson, Microsoft Scripting Guy<\/b>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Summary: Microsoft Scripting Guy, Ed Wilson, shows how to use Windows PowerShell to detect and to fix files that have leading spaces in the file name. Hey, Scripting Guy! I am hoping that you can help me. We have a rather strange problem at work, and if I do not get to the end of [&hellip;]<\/p>\n","protected":false},"author":596,"featured_media":87096,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[38,3,4,12,45],"class_list":["post-8701","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-scripting","tag-files","tag-scripting-guy","tag-scripting-techniques","tag-storage","tag-windows-powershell"],"acf":[],"blog_post_summary":"<p>Summary: Microsoft Scripting Guy, Ed Wilson, shows how to use Windows PowerShell to detect and to fix files that have leading spaces in the file name. Hey, Scripting Guy! I am hoping that you can help me. We have a rather strange problem at work, and if I do not get to the end of [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/8701","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\/596"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/comments?post=8701"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/8701\/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=8701"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/categories?post=8701"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/tags?post=8701"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}