{"id":55553,"date":"2008-05-16T01:42:00","date_gmt":"2008-05-16T01:42:00","guid":{"rendered":"https:\/\/blogs.technet.microsoft.com\/heyscriptingguy\/2008\/05\/16\/hey-scripting-guy-how-can-i-delete-all-the-files-in-a-folder-except-for-the-most-recently-created-file\/"},"modified":"2008-05-16T01:42:00","modified_gmt":"2008-05-16T01:42:00","slug":"hey-scripting-guy-how-can-i-delete-all-the-files-in-a-folder-except-for-the-most-recently-created-file","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/scripting\/hey-scripting-guy-how-can-i-delete-all-the-files-in-a-folder-except-for-the-most-recently-created-file\/","title":{"rendered":"Hey, Scripting Guy! How Can I Delete All the Files in a Folder Except for the Most-Recently Created File?"},"content":{"rendered":"<p><img decoding=\"async\" class=\"nearGraphic\" title=\"Hey, Scripting Guy! Question\" height=\"34\" alt=\"Hey, Scripting Guy! Question\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/q-for-powertip.jpg\" width=\"34\" align=\"left\" border=\"0\" \/> <\/p>\n<p>Hey, Scripting Guy! I have a folder that has about 50 files in it. How can I delete all those files except the one most-recently created?<br \/>&#8212; GA<\/p>\n<p><img decoding=\"async\" height=\"5\" alt=\"Spacer\" src=\"https:\/\/devblogs.microsoft.com\/scripting\/wp-content\/uploads\/sites\/29\/2019\/05\/spacer.gif\" width=\"5\" border=\"0\" \/><img decoding=\"async\" class=\"nearGraphic\" title=\"Hey, Scripting Guy! Answer\" height=\"34\" alt=\"Hey, Scripting Guy! Answer\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/a-for-powertip.jpg\" width=\"34\" align=\"left\" border=\"0\" \/><a href=\"http:\/\/go.microsoft.com\/fwlink\/?linkid=68779&amp;clcid=0x409\"><img decoding=\"async\" class=\"farGraphic\" title=\"Script Center\" height=\"288\" alt=\"Script Center\" src=\"http:\/\/img.microsoft.com\/library\/media\/1033\/technet\/images\/scriptcenter\/ad.jpg\" width=\"120\" align=\"right\" border=\"0\" \/><\/a> <\/p>\n<p>Hey, GA. You know, today would be a good day to review some of the items that have recently been in the news. (You know that life must be exceedingly dull for the Scripting Guy who writes this column when he resorts to talking about the news rather than relating some absolutely <i>fascinating<\/i> anecdote drawn from his own life.)<\/p>\n<p>Let\u2019s see \u2026 oh, here\u2019s one. A few weeks ago the state of Washington passed a law mandating very strict requirements \u2013 and mandatory testing \u2013 on toys, the better to ensure that toys sold in the state do not contain toxic levels of lead, phthalates, or cadmium. (And yes, now that you mention it, Phthalates <i>is<\/i> Scripting Guy Peter Costantini\u2019s middle name: Joseph Peter Phthalates Costantini.) <\/p>\n<table class=\"dataTable\" id=\"EDD\" cellSpacing=\"0\" cellPadding=\"0\">\n<thead><\/thead>\n<tbody>\n<tr class=\"record\" vAlign=\"top\">\n<td class=\"\">\n<p class=\"lastInCell\"><b>Note<\/b>. Interestingly enough, not all toys are covered by the new law; for example, it\u2019s still legal to sell roller skates or tricycles made entirely out of phthalate.<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<div class=\"dataTableBottomMargin\"><\/div>\n<p>As you might expect, the passage of this law has engendered a considerable amount of controversy. Some people hail it as breakthrough legislation that will guarantee the safety of our children and our children\u2019s children; others claim that it will destroy the toy industry as we know it today. (Which, considering the lameness of many of the toys sold today, might not be such a bad idea.) As a Microsoft employee, the Scripting Guy who writes this column has no opinion on this issue one way or the other.<\/p>\n<p>Which, considering the lameness of most of his opinions, might not be such a bad idea.<\/p>\n<p>Far more interesting than the law itself, however, was the hype and hysteria that accompanied its trip through the legislature. Proponents of the law were convinced that the state\u2019s children would all drop dead tomorrow if the law failed to pass. (Which, considering the lameness \u2013 no, hey, just joking there.) Opponents of the law were convinced that the legislation would ban any toy that could pose even the <i>remotest<\/i> hazard to a child. What if you had, say, a soft foam-rubber ball, a ball made entirely out of non-toxic, fully edible material? Harmless, right? Hardly. After all, a kid could trade that \u201charmless\u201d foam-rubber ball for, say, a boomerang, throw that boomerang, and then conk some other poor kid on the head. Consequently, harmless foam-rubber balls would have to be banned, too.<\/p>\n<p>Which, of course, was silly. After all, what kid is going to trade a <i>boomerang<\/i> for some dumb foam-rubber ball?<\/p>\n<p>One the bright side, however, the state of Washington has yet to pass any legislation restricting the use of system administration scripts, not even scripts that can delete all the files in a folder except for the most-recently created file. Which is a good thing; after all, this column would make even less sense than usual if it didn\u2019t include the following chunk of code:<\/p>\n<pre class=\"codeSample\">strComputer = \".\"\n\nSet objWMIService = GetObject(\"winmgmts:\\\\\" &amp; strComputer &amp; \"\\root\\cimv2\")\n\nSet colFiles = objWMIService.ExecQuery _\n    (\"ASSOCIATORS OF {Win32_Directory.Name='C:\\Logs'} Where \" _\n        &amp; \"ResultClass = CIM_DataFile\")\n\ndtmCurrentDate = #1\/1\/1980 8:00 AM#\n\nFor Each objFile In colFiles\n    dtmFileDate = WMIDateStringToDate(objFile.CreationDate)\n    If dtmFileDate &gt; dtmCurrentDate Then   \n        If strLatestFile &lt;&gt; \"\" Then\n            strLatestFile = Replace(strLatestFile, \"\\\", \"\\\\\")\n            Set colOldFiles = objWMIService. _\n                ExecQuery(\"Select * From CIM_DataFile Where Name = '\" &amp; strLatestFile &amp; \"'\")\n\n            For Each objOldFile in colOldFiles\n                objOldFile.Delete\n            Next\n        End If\n\n        strLatestFile = objFile.Name\n        dtmCurrentDate = dtmFileDate\n    Else\n        objFile.Delete\n    End If\nNext\n\nFunction WMIDateStringToDate(dtmCreationDate)\n    WMIDateStringToDate = CDate(Mid(dtmCreationDate, 5, 2) &amp; \"\/\" &amp; _\n        Mid(dtmCreationDate, 7, 2) &amp; \"\/\" &amp; Left(dtmCreationDate, 4) _\n            &amp; \" \" &amp; Mid (dtmCreationDate, 9, 2) &amp; \":\" &amp; _\n                Mid(dtmCreationDate, 11, 2) &amp; \":\" &amp; Mid(dtmCreationDate, _\n                    13, 2))\nEnd Function\n<\/pre>\n<p>As you can see, we start things out by connecting to the WMI service on the local computer. Can we use this exact same script to delete files from a <i>remote <\/i>computer? Of course we can; to delete files from a remote computer, just assign the name of that computer to the variable strComputer:<\/p>\n<pre class=\"codeSample\">strComputer = \"atl-fs-001\"\n<\/pre>\n<p>If only everything in life was that easy, huh?<\/p>\n<p>After we connect to the WMI service we then use this weird-looking <b>Associators Of<\/b> query to return a collection of all the files in the folder C:\\Logs:<\/p>\n<pre class=\"codeSample\">Set colFiles = objWMIService.ExecQuery _\n    (\"ASSOCIATORS OF {Win32_Directory.Name='C:\\Logs'} Where \" _\n        &amp; \"ResultClass = CIM_DataFile\")\n<\/pre>\n<p>Don\u2019t worry too much about the syntax here; just note that we\u2019re asking for all the files (that is, all the instances of the <b>CIM_DataFile<\/b> class) that happen to reside in (are associated with) the directory named C:\\Logs.<\/p>\n<p>Now, in a perfect world, we\u2019d ask WMI to return this collection of files sorted by creation date; that would make it very, <i>very<\/i> easy to delete everything except the newest file in the folder. Unfortunately, though, this is not a perfect world.<\/p>\n<table class=\"dataTable\" id=\"ETE\" cellSpacing=\"0\" cellPadding=\"0\">\n<thead><\/thead>\n<tbody>\n<tr class=\"record\" vAlign=\"top\">\n<td class=\"\">\n<p><b>Note<\/b>. If you\u2019re one of the many people who\u2019ve been thinking that this <i>is<\/i> a perfect world, well, we\u2019re sorry to disillusion you. The truth is, this is really, really <i>close<\/i> to being a perfect world, but it\u2019s not quite there. And never will be, unless the Washington Huskies figure out how to win more than 3 or 4 football games a year.<\/p>\n<p>Oh, and then there\u2019s that global warming thing and economic downturns and other stuff like that. But compared to the state of the Husky football program those problems are really nothing.<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<div class=\"dataTableBottomMargin\"><\/div>\n<p>Like we said, WMI can\u2019t sort our collection of files; instead, it\u2019s simply going to return all the files in alphabetical order. If we wanted to, we could come up with an alternate way to sort the files; for example, we could stash all the files in a <a href=\"http:\/\/www.microsoft.com\/technet\/scriptcenter\/resources\/qanda\/may08\/hey0502.mspx\"><b>disconnected recordset<\/b><\/a> and then sort that recordset. But that sounded like too much work, especially for the Scripting Guys. Therefore, we decided to do this the old-fashioned way: we\u2019ll simply look at each file in the collection, and \u201cmanually\u201d identify the latest file to be created. We\u2019ll then hang on to that file, and delete everything else.<\/p>\n<p>Because if it\u2019s not the latest and greatest, well, then who really cares, right?<\/p>\n<p>So how do we determine which file is the most-recently created? Well, for starters we pick an arbitrary date to use as a file creation baseline; in this case, we chose January 1, 1980 at 8:00 AM (coincidentally, the same day that the Scripting Editor celebrated her 40<sup>th<\/sup> birthday):<\/p>\n<pre class=\"codeSample\">dtmCurrentDate = #1\/1\/1980 8:00 AM#\n<\/pre>\n<p>What do we need a baseline date for? Well, like we said, we\u2019re going to look at the creation date for each and every file, checking to see if this creation date is newer than, well, than what? We have to start somewhere, so we decided to start with January 1, 1980; we\u2019re assuming that you don\u2019t have any files that were created before that date. If you <i>do<\/i> have files that were created before January 1, 1980 then simply assign dtmCurrentDate a different starting point. <\/p>\n<p>Like, say, October 14, 1857, the same day that the Scripting Guy who writes this column first told people to stay tuned for part 3 of the <a href=\"http:\/\/www.microsoft.com\/technet\/scriptcenter\/hubs\/htas.mspx\"><b>HTA tutorial<\/b><\/a>.<\/p>\n<p>After we establish our baseline date we set up a For Each loop to loop through each and every file in the collection. Inside that loop the first thing we do is take the value of the file\u2019s <b>CreationDate<\/b> property and pass it to a function we\u2019ve named WMIDateStringToDate: <\/p>\n<pre class=\"codeSample\">dtmFileDate = WMIDateStringToDate(objFile.CreationDate)\n<\/pre>\n<p>What\u2019s the point of <i>that<\/i>? Well, as most of you know by now, WMI uses the UTC (Universal Time Coordinate) format when working with dates and times; that means that the creation date for a file is going to look something like this:<\/p>\n<pre class=\"codeSample\">20080418125447.687500-420\n<\/pre>\n<p>Admittedly, that looks like pure gibberish. As it turns out, however, there\u2019s method to the madness: it\u2019s possible to parse out individual date-time pieces from a UTC value. For example, the first four digits \u2013 2008 \u2013 represent the year; the next two digits \u2013 04 \u2013 represent the month, and so on. In fact, the value 20080418125447.687500-420 can be broken down like this:<\/p>\n<table class=\"dataTable\" id=\"EOG\" cellSpacing=\"0\" cellPadding=\"0\">\n<thead><\/thead>\n<tbody>\n<tr class=\"record\" vAlign=\"top\">\n<td class=\"\">\n<p class=\"lastInCell\"><b>Year<\/b><\/p>\n<\/td>\n<td class=\"\">\n<p class=\"lastInCell\"><b>Month<\/b><\/p>\n<\/td>\n<td class=\"\">\n<p class=\"lastInCell\"><b>Day<\/b><\/p>\n<\/td>\n<td class=\"\">\n<p class=\"lastInCell\"><b>Hour<\/b><\/p>\n<\/td>\n<td class=\"\">\n<p class=\"lastInCell\"><b>Minute<\/b><\/p>\n<\/td>\n<td class=\"\">\n<p class=\"lastInCell\"><b>Seconds<\/b><\/p>\n<\/td>\n<td class=\"\">\n<p class=\"lastInCell\"><b>Milliseconds<\/b><\/p>\n<\/td>\n<td class=\"\">\n<p class=\"lastInCell\"><b>Bias<\/b><\/p>\n<\/td>\n<\/tr>\n<tr class=\"evenRecord\" vAlign=\"top\">\n<td class=\"\">\n<p class=\"lastInCell\">2008<\/p>\n<\/td>\n<td class=\"\">\n<p class=\"lastInCell\">04<\/p>\n<\/td>\n<td class=\"\">\n<p class=\"lastInCell\">18<\/p>\n<\/td>\n<td class=\"\">\n<p class=\"lastInCell\">12<\/p>\n<\/td>\n<td class=\"\">\n<p class=\"lastInCell\">54<\/p>\n<\/td>\n<td class=\"\">\n<p class=\"lastInCell\">47<\/p>\n<\/td>\n<td class=\"\">\n<p class=\"lastInCell\">.687500<\/p>\n<\/td>\n<td class=\"\">\n<p class=\"lastInCell\">-420<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<div class=\"dataTableBottomMargin\"><\/div>\n<p>See? It\u2019s not gibberish after all. (But you already knew that. After all, frequent readers of this column should be very good at spotting <i>real<\/i> gibberish by now.)<\/p>\n<p>The function WMIDateStringToDate simply takes a UTC value and converts it to a regular old-date time value, like this one:<\/p>\n<pre class=\"codeSample\">4\/18\/2008 12:54:57 PM\n<\/pre>\n<table class=\"dataTable\" id=\"E2AAC\" cellSpacing=\"0\" cellPadding=\"0\">\n<thead><\/thead>\n<tbody>\n<tr class=\"record\" vAlign=\"top\">\n<td class=\"\">\n<p class=\"lastInCell\"><b>Note<\/b>. We won\u2019t take the time to explain <i>how<\/i> the function does that conversion; that\u2019s a discussion that goes a bit beyond the scope of today\u2019s column. If you\u2019d like to know more about converting UTC date-time values then take a peek at <a href=\"http:\/\/www.microsoft.com\/technet\/scriptcenter\/guide\/sas_wmi_yakv.mspx\"><b>this section<\/b><\/a> of the <i>Microsoft Windows 2000 Scripting Guide<\/i>.<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<div class=\"dataTableBottomMargin\"><\/div>\n<p>After we\u2019ve converted the CreationDate value we check to see if the creation date for the first file in our collection is greater than (i.e., newer than) our baseline date:<\/p>\n<pre class=\"codeSample\">If dtmFileDate &gt; dtmCurrentDate Then\n<\/pre>\n<p>Most likely the creation date <i>is<\/i> newer than the baseline date. In that case, we then check to make sure that the variable strLatestFile has a value:<\/p>\n<pre class=\"codeSample\">If strLatestFile &lt;&gt; \"\" Then\n<\/pre>\n<p>Why do we do that? Well, we\u2019re going to use the variable strLatestFile to hold the path to the most-recently created file; any time we find a newer file we\u2019ll use WMI\u2019s <b>Delete<\/b> method to delete the file that <i>used<\/i> to be the most-recently created. And how do we know which file to delete? That\u2019s right: we use the path stored in strLatestFile<\/p>\n<p>Of course, the first time through the loop strLatestFile <i>won\u2019t<\/i> have a value; that\u2019s because we haven\u2019t assigned it a value yet. Because of that, our script will blow up if we try to delete the file: we can\u2019t delete a file that doesn\u2019t exist. Our If-Then statement is simply a safeguard to ensure that the script <i>doesn\u2019t<\/i> blow up.<\/p>\n<table class=\"dataTable\" id=\"EKCAC\" cellSpacing=\"0\" cellPadding=\"0\">\n<thead><\/thead>\n<tbody>\n<tr class=\"record\" vAlign=\"top\">\n<td class=\"\">\n<p class=\"lastInCell\"><b>Note<\/b>. Does it matter to <i>us<\/i> if the script blows up? Heck no; we just don\u2019t want the state of Washington passing any laws banning the use of exploding scripts. We don\u2019t believe the government has the right to keep you from totally screwing up everything that you do, at least not when it comes to writing scripts.<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<div class=\"dataTableBottomMargin\"><\/div>\n<p>Let\u2019s assume that strLatestFile <i>doesn\u2019t<\/i> have a value yet. In that case, we execute these two lines of code:<\/p>\n<pre class=\"codeSample\">strLatestFile = objFile.Name\ndtmCurrentDate = dtmFileDate\n<\/pre>\n<p>As you can see, in line 1 we\u2019re \u2013 at last! \u2013 assigning strLatestFile a value: we\u2019re giving it the <b>Name<\/b> (file path) of the file we\u2019re currently looking at. In addition, we\u2019re assigning the file creation date (via the variable dtmFileDate) to the variable dtmCurrentDate. What does that mean? That means that our baseline date is no longer 1\/1\/1980; now \u2013 in keeping with our example \u2013 our baseline date, the date which all subsequent creation dates will be compared against, is 4\/18\/2008.<\/p>\n<p>See how that works? Each time we find a more-recently created file we update the variables strLatestFile and dtmCurrentDate with the new file path and file creation date.<\/p>\n<p>Now, what if strLatestFile <i>does<\/i> have a value? Well, in that case we execute the following block of code:<\/p>\n<pre class=\"codeSample\">strLatestFile = Replace(strLatestFile, \"\\\", \"\\\\\")\nSet colOldFiles = objWMIService. _\n    ExecQuery(\"Select * From CIM_DataFile Where Name = '\" &amp; strLatestFile &amp; \"'\")\n\nFor Each objOldFile in colOldFiles\n    objOldFile.Delete\nNext\n<\/pre>\n<p>In the first line we\u2019re taking the value of strLatestFile and replacing any instances of the \\ character with <i>two<\/i> \\\\ characters. That means a file path like C:\\Logs\\Test.log will end up looking like this:<\/p>\n<pre class=\"codeSample\">C:\\\\Logs\\\\Test.log\n<\/pre>\n<p>Why do we do that? Well, in our very next line of code we\u2019re going to use WMI\u2019s <b>ExecQuery<\/b> method to bind to the file C:\\Logs\\Test.log. Because we need to use the file path (the Name property) in our query, and because the \\ is a reserved character in WMI, that means we have to \u201cescape\u201d each \\ in the file path. And how do you escape a character in WMI? You got it: you preface each instance of the character with a \\.<\/p>\n<p>As we hinted at above, in line 2 we use the ExecQuery method to return a collection of all the files with the specified file path. Because file paths must be unique on a computer there will be only one such file in our collection; nevertheless, a collection <i>is<\/i> a collection, regardless of the number of items in that collection. Therefore, we next set up a For Each loop to loop through the items in our new collection:<\/p>\n<pre class=\"codeSample\">For Each objOldFile in colOldFiles\n<\/pre>\n<p>And what do we do inside <i>this<\/i> loop? One thing and one thing only: we delete the file that <i>used<\/i> to be the most-recently created file in the folder. Once we\u2019ve done that we assign new values to strLatestFile and dtmCurrentDate, then go back to the top of the loop and repeat the process with the next file in the collection.<\/p>\n<p>Of course, there\u2019s one other possibility we\u2019ve failed to cover: what if the file we\u2019re looking at is actually <i>older<\/i> than the most-recently created file? In that case our task is much easier: we simply delete the file in question, then go back to the top of the loop and try again.<\/p>\n<p>Admittedly, it\u2019s a bit confusing. But if you sketch it out \u2013 taking care to update the values of strLatestFile and dtmCurrentDate as you do so\u2014you should see how it all works.<\/p>\n<p>We hope that helps, GA. Incidentally, we know that today\u2019s column is a little longer than usual, but whatever you do, please do <i>not<\/i> print out the article. After all, that printout could be made into a paper airplane, someone could throw it, and some poor kid could get his eye poked out. And then system administration scripting <i>would<\/i> be banned forever, at least in the state of Washington. <\/p>\n<table class=\"dataTable\" id=\"EREAC\" cellSpacing=\"0\" cellPadding=\"0\">\n<thead><\/thead>\n<tbody>\n<tr class=\"record\" vAlign=\"top\">\n<td class=\"\">\n<p><b>Note<\/b>. The Scripting Guy who writes this column has no doubt that getting hit in the eye with a paper airplane would hurt, and could even cause some damage. Therefore, he does not advocate throwing paper airplanes at other people. (Although that seems to be a suggestion on the same level as the advice to never shoot a squirt gun at another person.) He\u2019s curious, though: could you actually <i>poke an eye out<\/i> just by hitting someone with a paper airplane? If you have any thoughts on that matter <a href=\"mailto:scripter@microsoft.com\"><b>let us know<\/b><\/a>.<\/p>\n<p>And yes, things are <i>really<\/i> dull for him these days, aren\u2019t they?<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n","protected":false},"excerpt":{"rendered":"<p>Hey, Scripting Guy! I have a folder that has about 50 files in it. How can I delete all those files except the one most-recently created?&#8212; GA Hey, GA. You know, today would be a good day to review some of the items that have recently been in the news. (You know that life must [&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":[38,11,3,12,5],"class_list":["post-55553","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-scripting","tag-files","tag-folders","tag-scripting-guy","tag-storage","tag-vbscript"],"acf":[],"blog_post_summary":"<p>Hey, Scripting Guy! I have a folder that has about 50 files in it. How can I delete all those files except the one most-recently created?&#8212; GA Hey, GA. You know, today would be a good day to review some of the items that have recently been in the news. (You know that life must [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/55553","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=55553"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/55553\/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=55553"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/categories?post=55553"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/tags?post=55553"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}