<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>munibus</author_name>
  <author_url>https://blog.hatena.ne.jp/munibus/</author_url>
  <blog_title>Muni Bus</blog_title>
  <blog_url>https://munibus.hatenablog.com/</blog_url>
  <categories>
    <anon>PowerShell（テキストファイルの入出力）</anon>
  </categories>
  <description>Get-ContentコマンドレットとSelect-Objectコマンドレットを組み合わせて使う。Select-Objectコマンドレットに-Firstオプションを付けて、取り出したい先頭からの行数を指定すればよい。以下は5行からなるテキストファイルhs.txtを作成して、先頭から3行だけ表示した例。 PS &gt; @&quot;&gt;&gt; ルアン・メェイ&gt;&gt; 帰忘の流離人&gt;&gt; キャストリス&gt;&gt; ホタル&gt;&gt; アグライア&gt;&gt; &quot;@ | Out-File -NoNewline hs.txtPS &gt; Get-Content .\hs.txtルアン・メェイ帰忘の流離人キャストリスホタルアグライアPS &gt; Get-Cont…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fmunibus.hatenablog.com%2Fentry%2F2026%2F01%2F06%2F235709&quot; title=&quot;【PowerShell】テキストファイルの先頭部分を取り出す - Muni Bus&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2026-01-06 23:57:09</published>
  <title>【PowerShell】テキストファイルの先頭部分を取り出す</title>
  <type>rich</type>
  <url>https://munibus.hatenablog.com/entry/2026/01/06/235709</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
