<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>PowerShell on Eason Yang&#39;s Blog</title>
    <link>https://easonyang.com/tags/powershell/</link>
    <description>Recent content in PowerShell on Eason Yang&#39;s Blog</description>
    <generator>Hugo</generator>
    <language>zh-cn</language>
    <lastBuildDate>Sun, 03 Jul 2016 14:36:50 +0000</lastBuildDate>
    <atom:link href="https://easonyang.com/tags/powershell/atom.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>使用PowerShell及Shell实现将子目录中的所有指定类型文件批量复制到其他目录</title>
      <link>https://easonyang.com/2016/07/03/automatically-copy-files-from-various-subdirectory-with-shell-and-powershell/</link>
      <pubDate>Sun, 03 Jul 2016 14:36:50 +0000</pubDate>
      <guid>https://easonyang.com/2016/07/03/automatically-copy-files-from-various-subdirectory-with-shell-and-powershell/</guid>
      <description>&lt;p&gt;最近有个小需求，需要在 windows 系统下，把 mobi 格式的电子书文件从不同子目录里拷贝到同一目录中，由于微软的 Bash for windows 还没出正式版，所以这里先用 PowerShell 解决。&lt;/p&gt;&#xA;&lt;p&gt;首先用 Dir 命令遍历所有子目录获取 mobi 文件：&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;$data = Dir C:\data -filter *.mobi -recurse&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;-recurse 参数会递归地遍历 C:\data 下的子目录，寻找 -filter 所定义的所有以 mobi 为后缀的文件，将结果存入变量 data 中。&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
