{"id":52513,"date":"2009-09-08T03:01:00","date_gmt":"2009-09-08T03:01:00","guid":{"rendered":"https:\/\/blogs.technet.microsoft.com\/heyscriptingguy\/2009\/09\/08\/hey-scripting-guy-can-i-delete-all-files-from-nested-folders-and-subfolders\/"},"modified":"2009-09-08T03:01:00","modified_gmt":"2009-09-08T03:01:00","slug":"hey-scripting-guy-can-i-delete-all-files-from-nested-folders-and-subfolders","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/scripting\/hey-scripting-guy-can-i-delete-all-files-from-nested-folders-and-subfolders\/","title":{"rendered":"Hey, Scripting Guy! Can I Delete All Files from Nested Folders and Subfolders?"},"content":{"rendered":"<p><span class=\"sbmLink\">   <\/p>\n<table cellspacing=\"1\" cellpadding=\"1\">\n<tbody>\n<tr>\n<td class=\"sbmText\">Share this post: <\/td>\n<td><a title=\"Post it to Backflip!\" href=\"http:\/\/www.backflip.com\/add_page_pop.ihtml?url=http:\/\/blogs.technet.com\/heyscriptingguy\/archive\/2009\/09\/08\/hey-scripting-guy-september-8-2009.aspx&amp;title=Hey, Scripting Guy! Can I Delete All Files from Nested Folders and Subfolders?\" target=\"_blank\"><img decoding=\"async\" border=\"0\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/backflip4.png\" \/><\/a><\/td>\n<td><a title=\"Post it to Buddymark!\" href=\"http:\/\/buddymarks.com\/s_add_bookmark.php?bookmark_url=http:\/\/blogs.technet.com\/heyscriptingguy\/archive\/2009\/09\/08\/hey-scripting-guy-september-8-2009.aspx&amp;bookmark_title=Hey, Scripting Guy! Can I Delete All Files from Nested Folders and Subfolders?\" target=\"_blank\"><img decoding=\"async\" border=\"0\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/buddymar4.png\" \/><\/a><\/td>\n<td><a title=\"Post it to Del.icio.us!\" href=\"http:\/\/del.icio.us\/post?url=http:\/\/blogs.technet.com\/heyscriptingguy\/archive\/2009\/09\/08\/hey-scripting-guy-september-8-2009.aspx&amp;;title=Hey, Scripting Guy! Can I Delete All Files from Nested Folders and Subfolders?\" target=\"_blank\"><img decoding=\"async\" border=\"0\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/deliciou4.png\" \/><\/a><\/td>\n<td><a title=\"Post it to Digg!\" href=\"http:\/\/digg.com\/submit?phase=2&amp;url=http:\/\/blogs.technet.com\/heyscriptingguy\/archive\/2009\/09\/08\/hey-scripting-guy-september-8-2009.aspx&amp;title=Hey, Scripting Guy! Can I Delete All Files from Nested Folders and Subfolders?\" target=\"_blank\"><img decoding=\"async\" border=\"0\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/digg14.png\" \/><\/a><\/td>\n<td><a title=\"Post it to Facebook!\" href=\"http:\/\/www.facebook.com\/sharer.php?u=http:\/\/blogs.technet.com\/heyscriptingguy\/archive\/2009\/09\/08\/hey-scripting-guy-september-8-2009.aspx&amp;t=Hey, Scripting Guy! Can I Delete All Files from Nested Folders and Subfolders?\" target=\"_blank\"><img decoding=\"async\" border=\"0\" src=\"https:\/\/msdnshared.blob.core.windows.net\/media\/TNBlogsFS\/prod.evol.blogs.technet.com\/telligent.evolution.components.attachments\/13\/4982\/00\/00\/01\/76\/53\/19\/facebook.JPG\" \/><\/a><\/td>\n<td><a title=\"Post it to Furl!\" href=\"http:\/\/www.furl.net\/store?s=f&amp;to=0&amp;u=http:\/\/blogs.technet.com\/heyscriptingguy\/archive\/2009\/09\/08\/hey-scripting-guy-september-8-2009.aspx&amp;ti=Hey, Scripting Guy! Can I Delete All Files from Nested Folders and Subfolders?\" target=\"_blank\"><img decoding=\"async\" border=\"0\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/furl4.png\" \/><\/a><\/td>\n<td><a title=\"Post it to Netvouz!\" href=\"http:\/\/netvouz.com\/action\/submitBookmark?url=http:\/\/blogs.technet.com\/heyscriptingguy\/archive\/2009\/09\/08\/hey-scripting-guy-september-8-2009.aspx&amp;title=Hey, Scripting Guy! Can I Delete All Files from Nested Folders and Subfolders?\" target=\"_blank\"><img decoding=\"async\" border=\"0\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/netvouz4.png\" \/><\/a><\/td>\n<td><a title=\"Post it to Reddit!\" href=\"http:\/\/reddit.com\/submit?url=http:\/\/blogs.technet.com\/heyscriptingguy\/archive\/2009\/09\/08\/hey-scripting-guy-september-8-2009.aspx&amp;title=Hey, Scripting Guy! Can I Delete All Files from Nested Folders and Subfolders?\" target=\"_blank\"><img decoding=\"async\" border=\"0\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/reddit4.png\" \/><\/a><\/td>\n<td><a title=\"Post it to Spurl!\" href=\"http:\/\/www.spurl.net\/spurl.php?v=3&amp;url=http:\/\/blogs.technet.com\/heyscriptingguy\/archive\/2009\/09\/08\/hey-scripting-guy-september-8-2009.aspx&amp;title=Hey, Scripting Guy! Can I Delete All Files from Nested Folders and Subfolders?\" target=\"_blank\"><img decoding=\"async\" border=\"0\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/spurl8.png\" \/><\/a><\/td>\n<td><a title=\"Post it to Technorati!\" href=\"http:\/\/technorati.com\/faves\/?add=http:\/\/blogs.technet.com\/heyscriptingguy\/archive\/2009\/09\/08\/hey-scripting-guy-september-8-2009.aspx&amp;title=Hey, Scripting Guy! Can I Delete All Files from Nested Folders and Subfolders?\" target=\"_blank\"><img decoding=\"async\" border=\"0\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/technora4.png\" \/><\/a><\/td>\n<td><a title=\"Post it to Wists!\" href=\"http:\/\/www.wists.com\/?action=add&amp;url=http:\/\/blogs.technet.com\/heyscriptingguy\/archive\/2009\/09\/08\/hey-scripting-guy-september-8-2009.aspx&amp;title=Hey, Scripting Guy! Can I Delete All Files from Nested Folders and Subfolders?\" target=\"_blank\"><img decoding=\"async\" border=\"0\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/wists9.png\" \/><\/a><\/td>\n<td><a title=\"Post it to Yahoo!\" href=\"http:\/\/myweb.yahoo.com\/myresults\/bookmarklet?u=http:\/\/blogs.technet.com\/heyscriptingguy\/archive\/2009\/09\/08\/hey-scripting-guy-september-8-2009.aspx&amp;t=Hey, Scripting Guy! Can I Delete All Files from Nested Folders and Subfolders?\" target=\"_blank\"><img decoding=\"async\" border=\"0\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/yahoo9.png\" \/><\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p> <\/span>  <\/p>\n<p><img decoding=\"async\" title=\"Hey, Scripting Guy! Question\" border=\"0\" alt=\"Hey, Scripting Guy! Question\" align=\"left\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/q-for-powertip.jpg\" width=\"34\" height=\"34\" \/>Hey, Scripting Guy! At work we have a series of folders that are used to store files for a month. At the end of the month, we need to delete all of the files that are in the folders and start over. The folder structure is very nested; therefore, I do not want to have to recreate all of the folders, subfolders, and even more subfolders. Because of all the subfolders that I have to click, it takes me more than an hour to clean out these files. Worse than the amount of time it takes, I have to get up at 12:01 A.M. on the first of each month to remote into work and delete these files. I could create a scheduled task to do this, but I need to keep the subfolders. If you can figure out how to do this, I would greatly appreciate it. <\/p>\n<p>&#8212; EM<\/p>\n<p><img decoding=\"async\" title=\"Hey, Scripting Guy! Answer\" border=\"0\" alt=\"Hey, Scripting Guy! Answer\" align=\"left\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/a-for-powertip.jpg\" width=\"34\" height=\"34\" \/>Hello EM, <\/p>\n<p>Microsoft Scripting Guy Ed Wilson here. Today is a <a href=\"http:\/\/blogs.technet.com\/heyscriptingguy\/archive\/2009\/03\/04\/how-do-i-migrate-my-vbscript-wmi-queries-to-windows-powershell.aspx\">coffee day for me<\/a>. I look forward to having a coffee day about once a quarter. I don&#8217;t schedule them on my Outlook 2010 calendar as recurring appointments, but I do plan them in advance. Last night as I finished reading <a href=\"http:\/\/en.wikipedia.org\/wiki\/The_Fountainhead\">The Fountainhead<\/a> (if you have friended me on Facebook, you know about that already), I thought to myself, \u201cI think tomorrow will be a coffee day.\u201d <\/p>\n<p>There is nothing more disappointing than looking forward to coffee and not having the required supplies, so I sauntered into the kitchen to check on my stash of <a href=\"http:\/\/en.wikipedia.org\/wiki\/Kona_coffee\">Kona<\/a> <a href=\"http:\/\/en.wikipedia.org\/wiki\/Peaberry\">Peaberry coffee beans<\/a>, coffee grinder, and <a href=\"http:\/\/en.wikipedia.org\/wiki\/French_press\">French press<\/a>. Fortunately, all was in readiness, and coffee day sprung forth with a light spring in the air. Because I really appreciate a good cup of coffee and tend to linger long over the aroma, I do not mind the extra manual work involved in making the perfect cup of coffee: grinding beans, slowly filling the French press with the almost boiling fresh spring water, pre-heating the milk, and measuring out the exact weight of <a href=\"http:\/\/en.wikipedia.org\/wiki\/Turbinado\">Turbinado<\/a> sugar. <\/p>\n<p>If I had to make coffee every morning, I would probably grab some type of plastic coffee pot, set it on a timer, stuff a coffee baggie\/filter combo pack into the slot, and wake up in the morning to a fresh pot of coffee. In other words, I would automate the task as much as possible. And because I suspect you do not savor the prospects of waking up at midnight to delete files from a nested folder structure, I will be glad to help you automate your task.<\/p>\n<p>This week, we are looking at questions that have been posted to the <a href=\"http:\/\/bit.ly\/2h50Tk\">Official Scripting Guys Forum<\/a>. This forum is a great place to ask questions related to VBScript or Windows PowerShell. It is also an excellent resource for learning scripting by reading answers to others\u2019 questions or by becoming involved in discussions through posting answers. In addition to being a learning resource, the forum is also a fun place to interact with people from around the world who have an interest in scripting. The Official Scripting Guys Forum is free. If you wish to post a question or propose an answer to a question, you will need to log in with your <a href=\"http:\/\/bit.ly\/wI4Nj\">Windows Live ID<\/a>.<\/p>\n<p>EM, interestingly enough <a href=\"http:\/\/bit.ly\/3Znfm7\">this question came up<\/a> recently:<\/p>\n<p><img decoding=\"async\" style=\"width: 600px;height: 326px\" title=\"Image of question posted in the forum\" alt=\"Image of question posted in the forum\" src=\"http:\/\/img.microsoft.com\/library\/media\/1033\/technet\/images\/scriptcenter\/qanda\/hsg\/2009\/september\/hey0908\/hsg-09-08-09-01.jpg\" width=\"600\" height=\"326\" \/><\/p>\n<p>To begin with, a nested folder structure is one that might look something like the one shown here. <\/p>\n<p style=\"margin: 4pt 0in 7pt;background: #d9d9d9\" class=\"CodeBlock\"><span style=\"font-size: 9.5pt\"><font face=\"Lucida Sans Typewriter\">C:\\test\\fso1       <br \/>C:\\test\\fso2        <br \/>C:\\test\\fso2\\fso3        <br \/>C:\\test\\fso2\\fso3\\fso4        <\/p>\n<p>     <\/font><\/span><\/p>\n<p>If each of the folders contains various files, as seen in the following image, you can have problems trying to clean out the folders to make room for a new batch of data. EM, your scenario is one that is often used by applications that do file routing. It is also common for certain accounting types of applications to store invoices in folders that are batch-processed on a schedule. The problem in your case is that the application is not well behaved enough to clean up after itself. <\/p>\n<p><img decoding=\"async\" style=\"width: 600px;height: 393px\" title=\"Image of each folder containing various files\" alt=\"Image of each folder containing various files\" src=\"http:\/\/img.microsoft.com\/library\/media\/1033\/technet\/images\/scriptcenter\/qanda\/hsg\/2009\/september\/hey0908\/hsg-09-08-09-02.jpg\" width=\"600\" height=\"393\" \/><\/p>\n<p>The trick to deleting the files and not the folders is to use the <b>PSIsContainer<\/b> attribute from either the file or the folder object. To retrieve the properties of the folder object, use the <b>Get-Item<\/b> cmdlet and pipe the results to the <b>Format-List<\/b> cmdlet while using a wildcard character to select the properties. We use the <b>Format-List<\/b> cmdlet instead of the <b>Get-Member<\/b> cmdlet to look at the properties of the folder object because we want to see sample values of the properties. Often the properties of the object do not display meaningful data. By piping the object returned from the <b>Get-Item<\/b> cmdlet to the <b>Format-List<\/b> cmdlet, you are able to see if the property will be useful for your specific purposes. This is seen here:<\/p>\n<p style=\"margin: 4pt 0in 7pt;background: #d9d9d9\" class=\"CodeBlock\"><span style=\"font-size: 9.5pt\"><font face=\"Lucida Sans Typewriter\">PS C:\\&gt; Get-Item \u2013path C:\\test | Format-List -property *       <\/p>\n<p>PSPath<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>: Microsoft.PowerShell.Core\\FileSystem::C:\\test        <br \/>PSParentPath<span>&#160;&#160;&#160;&#160;&#160; <\/span>: Microsoft.PowerShell.Core\\FileSystem::C:\\        <br \/>PSChildName<span>&#160;&#160;&#160;&#160;&#160;&#160; <\/span>: test        <br \/>PSDrive<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>: C        <br \/>PSProvider<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>: Microsoft.PowerShell.Core\\FileSystem        <br \/>PSIsContainer<span>&#160;&#160;&#160;&#160; <\/span>: True        <br \/>Mode<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>: d&#8212;-        <br \/>Name<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>: test        <br \/>Parent<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>:        <br \/>Exists<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>: True        <br \/>Root<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>: C:\\        <br \/>FullName<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>: C:\\test        <br \/>Extension<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>:        <br \/>CreationTime<span>&#160;&#160;&#160;&#160;&#160; <\/span>: 11\/19\/2008 10:53:02 AM        <br \/>CreationTimeUtc<span>&#160;&#160; <\/span>: 11\/19\/2008 3:53:02 PM        <br \/>LastAccessTime<span>&#160;&#160;&#160; <\/span>: 8\/28\/2009 2:47:06 PM        <br \/>LastAccessTimeUtc : 8\/28\/2009 6:47:06 PM        <br \/>LastWriteTime<span>&#160;&#160;&#160;&#160; <\/span>: 8\/28\/2009 2:19:19 PM        <br \/>LastWriteTimeUtc<span>&#160; <\/span>: 8\/28\/2009 6:19:19 PM        <br \/>Attributes<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/span>: Directory        <\/p>\n<p>     <\/font><\/span><\/p>\n<p>The C:\\test directory returns <b>true<\/b> for the <b>PSIsContainer<\/b> property. Because you are only interested in the value of the <b>PSIsContainer<\/b> property, you can select it directly by using property notation. This is seen here: <\/p>\n<p style=\"margin: 4pt 0in 7pt;background: #d9d9d9\" class=\"CodeBlock\"><span style=\"font-size: 9.5pt\"><font face=\"Lucida Sans Typewriter\">PS C:\\&gt; (Get-Item C:\\test\\__Chapter_Template.doc).psiscontainer       <\/p>\n<p>     <\/font><\/span><\/p>\n<p style=\"margin: 4pt 0in 7pt;background: #d9d9d9\" class=\"CodeBlock\"><span style=\"font-size: 9.5pt\"><font face=\"Lucida Sans Typewriter\">False       <\/p>\n<p>     <\/font><\/span><\/p>\n<p> <span>   <\/p>\n<p style=\"margin: 4pt 0in 7pt;background: #d9d9d9\" class=\"CodeBlock\"><span style=\"font-size: 9.5pt\"><font face=\"Lucida Sans Typewriter\">PS C:\\&gt;         <\/p>\n<p>       <\/font><\/span><\/p>\n<p> <\/span>  <\/p>\n<p>EM, we have now found the information we need to write your script. But before we start deleting everything, it is a good idea to perform a test run to see what might be deleted. To do this, pipeline the results to the <b>Select-Object<\/b> cmdlet and choose the <b>FullName<\/b> property. This is seen here:<\/p>\n<p style=\"margin: 4pt 0in 7pt;background: #d9d9d9\" class=\"CodeBlock\"><span style=\"font-size: 9.5pt\"><font face=\"Lucida Sans Typewriter\">Get-ChildItem -Path C:\\Test -Recurse -force |       <\/p>\n<p>     <\/font><\/span><\/p>\n<p style=\"margin: 4pt 0in 7pt;background: #d9d9d9\" class=\"CodeBlock\"><span style=\"font-size: 9.5pt\"><font face=\"Lucida Sans Typewriter\">Where-Object { -not ($_.psiscontainer) } |       <\/p>\n<p>     <\/font><\/span><\/p>\n<p style=\"margin: 4pt 0in 7pt;background: #d9d9d9\" class=\"CodeBlock\"><span style=\"font-size: 9.5pt\"><font face=\"Lucida Sans Typewriter\">Select-Object FullName       <\/p>\n<p>     <\/font><\/span><\/p>\n<p>When the command is run, an output similar to the following is displayed. You will notice that files in the root directory are deleted as well as files in the subfolders:<\/p>\n<p><img decoding=\"async\" style=\"width: 600px;height: 481px\" title=\"Image of output of the command\" alt=\"Image of output of the command\" src=\"http:\/\/img.microsoft.com\/library\/media\/1033\/technet\/images\/scriptcenter\/qanda\/hsg\/2009\/september\/hey0908\/hsg-09-08-09-03.jpg\" width=\"600\" height=\"481\" \/><\/p>\n<p>The single command to clean up all the files from the folders is seen here:<\/p>\n<p style=\"margin: 4pt 0in 7pt;background: #d9d9d9\" class=\"CodeBlock\"><span style=\"font-size: 9.5pt\"><font face=\"Lucida Sans Typewriter\">Get-ChildItem -Path C:\\Test -Recurse -force |        <\/p>\n<p>     <\/font><\/span><\/p>\n<p style=\"margin: 4pt 0in 7pt;background: #d9d9d9\" class=\"CodeBlock\"><span style=\"font-size: 9.5pt\"><font face=\"Lucida Sans Typewriter\">Where-Object { -not ($_.psiscontainer) } |        <\/p>\n<p>     <\/font><\/span><\/p>\n<p style=\"margin: 4pt 0in 7pt;background: #d9d9d9\" class=\"CodeBlock\"><span style=\"font-size: 9.5pt\"><font face=\"Lucida Sans Typewriter\">Remove-Item \u2013Force       <\/p>\n<p>     <\/font><\/span><\/p>\n<p>The <b>recurse<\/b> switched parameter is used to cause the <b>Get-ChildItem<\/b> cmdlet to work its way through all the subfolders. The <b>force<\/b> switched parameter is used to cause the hidden and system files to be visible to the <b>Get-ChildItem<\/b> cmdlet. The <b>Where-Object<\/b> cmdlet is used to filter items that are not PSIsContainers (in other words, files). The <b>Remove-Item<\/b> cmdlet is used to delete the files. The <b>force<\/b> switched parameter is required because some of the files to be deleted might be read-only files. <\/p>\n<p>If you put the Windows PowerShell command on a single line (I use Notepad to do this) and call that command by the Windows PowerShell executable while passing the command switch and a script block, you have a format you can use directly inside a scheduled task. Before you go to the trouble of creating a scheduled task, paste the command into the <b>Run<\/b> dialog box to see if it works. If it does, you can paste the command into the Scheduled Task tool when create a scheduled task. You will never have to wake up at midnight to delete files again. The syntax would look like this\u2014remember it is really a single line:<\/p>\n<p> <span style=\"font-size: 9.5pt\"><font face=\"Lucida Sans Typewriter\">     <\/p>\n<p style=\"margin: 4pt 0in 7pt;background: #d9d9d9\" class=\"CodeBlock\"><span style=\"font-size: 9.5pt\">PowerShell -command &amp;{ Get-ChildItem -Path C:\\Test -Recurse -force | Where-Object { -not ($_.psiscontainer) } | Remove-Item -Force }         <\/p>\n<p>       <\/span><\/p>\n<p>   <\/font><\/span>  <\/p>\n<p>After you have completed the Scheduled Task wizard, you can open the scheduled task and examine its properties. This is seen here:<\/p>\n<p><img decoding=\"async\" style=\"width: 406px;height: 448px\" title=\"Image of properties of scheduled task\" alt=\"Image of properties of scheduled task\" src=\"http:\/\/img.microsoft.com\/library\/media\/1033\/technet\/images\/scriptcenter\/qanda\/hsg\/2009\/september\/hey0908\/hsg-09-08-09-04.jpg\" width=\"406\" height=\"448\" \/><\/p>\n<p>Of course, you can write a Windows PowerShell script to <a href=\"http:\/\/blogs.technet.com\/heyscriptingguy\/search.aspx?q=scheduled+task&amp;p=1\">create scheduled tasks<\/a> as well, but for a single scheduled job like this, I personally would use the GUI tool to create the task. <\/p>\n<p>EM, thank you for your question you sent to <a href=\"mailto:scripter@microsoft.Com\">scripter@microsoft.com<\/a>. It was a great question, especially because it had already been answered in the Official Scripting Guys Forum. Join us tomorrow as Forum Week continues. <\/p>\n<p>If you want to know exactly what we will be looking at tomorrow, follow us on <a href=\"http:\/\/www.twitter.com\/scriptingguys\/\">Twitter<\/a> or <a href=\"http:\/\/www.facebook.com\/group.php?gid=5901799452\">Facebook<\/a>. If you have any questions, send e-mail to us at <a 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, keep on scripting. <\/p>\n<p><b>Ed Wilson and Craig Liebendorfer, Scripting Guys<\/b><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Share this post: Hey, Scripting Guy! At work we have a series of folders that are used to store files for a month. At the end of the month, we need to delete all of the files that are in the folders and start over. The folder structure is very nested; therefore, I do not [&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":[11,3,12,45],"class_list":["post-52513","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-scripting","tag-folders","tag-scripting-guy","tag-storage","tag-windows-powershell"],"acf":[],"blog_post_summary":"<p>Share this post: Hey, Scripting Guy! At work we have a series of folders that are used to store files for a month. At the end of the month, we need to delete all of the files that are in the folders and start over. The folder structure is very nested; therefore, I do not [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/52513","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=52513"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/52513\/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=52513"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/categories?post=52513"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/tags?post=52513"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}