{"id":1590,"date":"2025-03-02T16:18:02","date_gmt":"2025-03-02T07:18:02","guid":{"rendered":"https:\/\/hi3103.net\/notes\/?p=1590"},"modified":"2025-03-02T16:18:02","modified_gmt":"2025-03-02T07:18:02","slug":"windows-powershell-%e3%82%925%e7%b3%bb%e3%81%8b%e3%82%897%e7%b3%bb%e3%81%ab%e3%82%a2%e3%83%83%e3%83%97%e3%83%87%e3%83%bc%e3%83%88%e3%81%99%e3%82%8b","status":"publish","type":"post","link":"https:\/\/hi3103.net\/notes\/windows\/1590","title":{"rendered":"Windows Powershell \u30925\u7cfb\u304b\u30897\u7cfb\u306b\u30a2\u30c3\u30d7\u30c7\u30fc\u30c8\u3059\u308b"},"content":{"rendered":"<h3>\u6982\u8981<\/h3>\n<ul>\n<li>PowerShell \u3067\u306e\u30b3\u30de\u30f3\u30c9\u64cd\u4f5c\u3067 <code>-Encoding UTF8<\/code> \u3068\u3044\u3046\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u4f7f\u3044\u305f\u3044\u5834\u9762\u304c\u3067\u3066\u304d\u305f<\/li>\n<li>\u4e0a\u8a18\u306f5\u7cfb\u3060\u3068\u4f7f\u3048\u306a\u3044\u306e\u3067\u3001\u6700\u65b0\u306e7\u7cfb\u306b\u30a2\u30c3\u30d7\u30c7\u30fc\u30c8\u3092\u884c\u3046<\/li>\n<\/ul>\n<h3>\u53c2\u8003<\/h3>\n<ul>\n<li><a href=\"https:\/\/learn.microsoft.com\/ja-jp\/powershell\/scripting\/whats-new\/migrating-from-windows-powershell-51-to-powershell-7?view=powershell-7.4\">Windows PowerShell 5.1 \u304b\u3089 PowerShell 7 \u3078\u306e\u79fb\u884c &#8211; PowerShell | Microsoft Learn<\/a><\/li>\n<li><a href=\"https:\/\/learn.microsoft.com\/ja-jp\/powershell\/scripting\/install\/installing-powershell-on-windows?view=powershell-7.4#winget\">Windows \u3078\u306e PowerShell \u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb &#8211; PowerShell | Microsoft Learn<\/a><\/li>\n<\/ul>\n<p><!--more--><\/p>\n<h3>\u4f5c\u696d\u30ed\u30b0<\/h3>\n<h4>\u73fe\u884c\u30d0\u30fc\u30b8\u30e7\u30f3\u78ba\u8a8d<\/h4>\n<p>PowerShell \u3092\u8d77\u52d5\u3057\u3066\u4ee5\u4e0b\u3092\u5b9f\u884c\u3002<\/p>\n<pre><code class=\"language-yaml\">$PSVersionTable<\/code><\/pre>\n<p>\u73fe\u884c\u30d0\u30fc\u30b8\u30e7\u30f3\u306f <code>5.1.22621.4391<\/code> \u3068\u306a\u3063\u3066\u3044\u308b\u3002<\/p>\n<pre><code class=\"language-powershell\">Name                           Value\n----                           -----\nPSVersion                      5.1.22621.4391\nPSEdition                      Desktop\nPSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}\nBuildVersion                   10.0.22621.4391\nCLRVersion                     4.0.30319.42000\nWSManStackVersion              3.0\nPSRemotingProtocolVersion      2.3\nSerializationVersion           1.1.0.1<\/code><\/pre>\n<h4>\u914d\u5e03\u4e2d\u306e\u6700\u65b0\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u78ba\u8a8d<\/h4>\n<p>\u4ee5\u4e0b\u3092\u5b9f\u884c\u3002<\/p>\n<pre><code class=\"language-yaml\">winget search Microsoft.PowerShell<\/code><\/pre>\n<p>\u5b89\u5b9a\u7248\u306f 7.5 \u304c\u6700\u65b0\u306e\u3082\u3088\u3046\u3002<\/p>\n<pre><code class=\"language-powershell\">\u540d\u524d               ID                           \u30d0\u30fc\u30b8\u30e7\u30f3 \u30bd\u30fc\u30b9\n------------------------------------------------------------------\nPowerShell         Microsoft.PowerShell         7.5.0.0    winget\nPowerShell Preview Microsoft.PowerShell.Preview 7.6.0.3    winget<\/code><\/pre>\n<h4>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h4>\n<p>\u4ee5\u4e0b\u3092\u5b9f\u884c\u3002<\/p>\n<pre><code class=\"language-powershell\">winget install --id Microsoft.PowerShell --source winget<\/code><\/pre>\n<p>\u30a4\u30f3\u30b9\u30c8\u30fc\u30e9\u30fc\u304c\u52d5\u4f5c\u3059\u308b\u306e\u3067\u3001\u8a31\u53ef\u64cd\u4f5c\u306a\u3069\u3092\u884c\u3044\u3057\u3070\u3057\u5f85\u3064\u3068\u5b8c\u4e86\u3059\u308b\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/hi3103.net\/notes\/img\/uploads\/2025\/03\/2503-powershell7_install-1.png\" alt=\"\" width=\"510\" height=\"165\"  \/><\/p>\n<pre><code class=\"language-powershell\">\u898b\u3064\u304b\u308a\u307e\u3057\u305f PowerShell [Microsoft.PowerShell] \u30d0\u30fc\u30b8\u30e7\u30f3 7.5.0.0\n\u3053\u306e\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306f\u6240\u6709\u8005\u304b\u3089\u30e9\u30a4\u30bb\u30f3\u30b9\u4f9b\u4e0e\u3055\u308c\u307e\u3059\u3002\nMicrosoft \u306f\u30b5\u30fc\u30c9\u30d1\u30fc\u30c6\u30a3\u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u306b\u5bfe\u3057\u3066\u8cac\u4efb\u3092\u8ca0\u308f\u305a\u3001\u30e9\u30a4\u30bb\u30f3\u30b9\u3082\u4ed8\u4e0e\u3057\u307e\u305b\u3093\u3002\n\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u4e2d https:\/\/github.com\/PowerShell\/PowerShell\/releases\/download\/v7.5.0\/PowerShell-7.5.0-win-x64.msi\n  \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588   107 MB \/  107 MB\n\u30a4\u30f3\u30b9\u30c8\u30fc\u30e9\u30fc\u30cf\u30c3\u30b7\u30e5\u304c\u6b63\u5e38\u306b\u691c\u8a3c\u3055\u308c\u307e\u3057\u305f\n\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3092\u958b\u59cb\u3057\u3066\u3044\u307e\u3059...\n\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304c\u5b8c\u4e86\u3057\u307e\u3057\u305f<\/code><\/pre>\n<h4>\u52d5\u4f5c\u30c1\u30a7\u30c3\u30af<\/h4>\n<p>PowerShell 5\u7cfb\u30687\u7cfb\u306f\u5225\u306e\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3068\u306a\u3063\u3066\u3044\u308b\u3002<\/p>\n<p>\u30a2\u30d7\u30ea\u306e\u691c\u7d22\u3067 <code>PowerShell 7<\/code>  \u3092\u3044\u308c\u3066\u7d50\u679c\u306b\u51fa\u3066\u304f\u308c\u3070OK\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/hi3103.net\/notes\/img\/uploads\/2025\/03\/2503-powershell7_install-2.png\" alt=\"\" width=\"752\" height=\"417\"  \/><\/p>\n<p>\u8d77\u52d5\u3057\u3066\u30d0\u30fc\u30b8\u30e7\u30f3\u30c1\u30a7\u30c3\u30af \u2192 \u6700\u65b0\u306e 7.5 \u304c\u843d\u3068\u305b\u3066\u3044\u308b\u3002<\/p>\n<pre><code class=\"language-powershell\">Name                           Value\n----                           -----\nPSVersion                      7.5.0\nPSEdition                      Core\nGitCommitId                    7.5.0\nOS                             Microsoft Windows 10.0.22631\nPlatform                       Win32NT\nPSCompatibleVersions           {1.0, 2.0, 3.0, 4.0\u2026}\nPSRemotingProtocolVersion      2.3\nSerializationVersion           1.1.0.1\nWSManStackVersion              3.0<\/code><\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/hi3103.net\/notes\/img\/uploads\/2025\/03\/2503-powershell7_install-3.png\" alt=\"\" width=\"564\" height=\"316\"  \/><\/p>\n<h4>\u5404\u7a2e\u8a2d\u5b9a\u306e\u66f4\u65b0<\/h4>\n<h5>\u30bf\u30fc\u30df\u30ca\u30eb\u306e\u8a2d\u5b9a<\/h5>\n<p>PowerShell \u306f\u666e\u6bb5\u30bf\u30fc\u30df\u30ca\u30eb\u7d4c\u7531\u3067\u4f7f\u3063\u3066\u3044\u308b\u306e\u3067\u3001\u65e2\u5b9a\u306e\u30d7\u30ed\u30d5\u30a1\u30a4\u30eb\u3092 PowerShell 7 \u306b\u5909\u66f4\u3057\u3066\u304a\u304f\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/hi3103.net\/notes\/img\/uploads\/2025\/03\/2503-powershell7_install-4.png\" alt=\"\u30bf\u30fc\u30df\u30ca\u30eb\u8a2d\u5b9a\u753b\u9762\u306e\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8\u3002\u300c\u30b9\u30bf\u30fc\u30c8\u30a2\u30c3\u30d7\u300d\u30bf\u30d6\u304b\u3089\u3001\u300c\u65e2\u5b9a\u306e\u30d7\u30ed\u30d5\u30a1\u30a4\u30eb\u300d\u306e\u30d7\u30eb\u30c0\u30a6\u30f3\u3067 PowerShell \u3092\u9078\u629e\u3057\u3001\u300c\u4fdd\u5b58\u300d\u30dc\u30bf\u30f3\u3092\u62bc\u3059\u3002\" width=\"1115\" height=\"628\"  \/><\/p>\n<h5>$PROFILE \u306e\u8a2d\u5b9a<\/h5>\n<p>PowerShell \u306e\u8d77\u52d5\u6642\u306b\u5b9f\u884c\u3055\u308c\u3066\u3044\u308b\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u306b\u3064\u3044\u3066\u3082\u30015\u7cfb\u30687\u7cfb\u3060\u3068\u305d\u308c\u305e\u308c\u5225\u306b\u306a\u3063\u3066\u3044\u308b\u306e\u3067\u79fb\u884c\u3057\u3066\u304a\u304f\u3002<\/p>\n<p>5\u306e\u307b\u3046\u3067\u4ee5\u4e0b\u3092\u5b9f\u884c\u3002\u8d77\u52d5\u3057\u305f\u30e1\u30e2\u5e33\u306e\u307b\u3046\u3067\u4e2d\u8eab\u3092\u30b3\u30d4\u30fc\u3002<\/p>\n<pre><code class=\"language-powershell\">notepad $PROFILE<\/code><\/pre>\n<p>7\u306e\u307b\u3046\u3067\u3082\u4e0a\u8a18\u3092\u5b9f\u884c\u3002\u30d5\u30a1\u30a4\u30eb\u3092\u65b0\u898f\u4f5c\u6210\u3059\u308b\u30c0\u30a4\u30a2\u30ed\u30b0\u304c\u3067\u305f\u3089\u8a31\u53ef\u3057\u3001\u30da\u30fc\u30b9\u30c8\u3057\u3066\u4fdd\u5b58\u3002<\/p>\n<h5>\u53cd\u6620\u3055\u308c\u305f\u304b\u78ba\u8a8d<\/h5>\n<p>\u4e00\u5ea6\u30bf\u30fc\u30df\u30ca\u30eb\u3092\u7d42\u4e86\u3057\u3066\u518d\u8d77\u52d5\u3057\u3001\u4ee5\u4e0b\u3092\u78ba\u8a8d\u3059\u308b\u3002<\/p>\n<ul>\n<li>\u30c7\u30d5\u30a9\u30eb\u30c8\u3067 PowerShell 7\u304c\u958b\u304f\u304b<\/li>\n<li>$PROFILE \u306b\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u308b\u5185\u5bb9\u304c\u53cd\u6620\u3055\u308c\u3066\u3044\u308b\u304b<\/li>\n<\/ul>\n<p>\u5f8c\u8005\u306b\u3064\u3044\u3066\u306f\u3001\u81ea\u5206\u306e\u5834\u5408\u306f\u4ee5\u4e0b\u3092\u8a18\u8ff0\u3057\u3066\u3042\u308b\u306e\u3067\u3001\u6587\u5b57\u30b3\u30fc\u30c9\u3092\u78ba\u8a8d\u3057\u3066UTF-8\u306e\u5024\u304c\u3067\u3066\u3044\u308c\u3070OK\u3002<\/p>\n<pre><code class=\"language-powershell\"># \u30b3\u30f3\u30bd\u30fc\u30eb\u306e\u6587\u5b57\u30b3\u30fc\u30c9\u3092UTF-8\u306b\u8a2d\u5b9a\nchcp 65001<\/code><\/pre>\n<p>\u6587\u5b57\u30b3\u30fc\u30c9\u306f\u540c\u3058 <code>chcp<\/code> \u30b3\u30de\u30f3\u30c9\u3092\u305d\u306e\u307e\u307e\u53e9\u3051\u3070\u78ba\u8a8d\u3067\u304d\u308b\u3002<\/p>\n<pre><code class=\"language-powershell\">&gt; chcp\nActive code page: 65001<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u6982\u8981 PowerShell \u3067\u306e\u30b3\u30de\u30f3\u30c9\u64cd\u4f5c\u3067 -Encoding UTF8 \u3068\u3044\u3046\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u4f7f\u3044\u305f\u3044\u5834\u9762\u304c\u3067\u3066\u304d\u305f \u4e0a\u8a18\u306f5\u7cfb\u3060\u3068\u4f7f\u3048\u306a\u3044\u306e\u3067\u3001\u6700\u65b0\u306e7\u7cfb\u306b\u30a2\u30c3\u30d7\u30c7\u30fc\u30c8\u3092\u884c\u3046 \u53c2\u8003 Windows PowerShel [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[58],"tags":[101,103],"class_list":["post-1590","post","type-post","status-publish","format-standard","hentry","category-windows","tag-powershell","tag-windows-11"],"_links":{"self":[{"href":"https:\/\/hi3103.net\/notes\/wp-json\/wp\/v2\/posts\/1590","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hi3103.net\/notes\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hi3103.net\/notes\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hi3103.net\/notes\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hi3103.net\/notes\/wp-json\/wp\/v2\/comments?post=1590"}],"version-history":[{"count":0,"href":"https:\/\/hi3103.net\/notes\/wp-json\/wp\/v2\/posts\/1590\/revisions"}],"wp:attachment":[{"href":"https:\/\/hi3103.net\/notes\/wp-json\/wp\/v2\/media?parent=1590"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hi3103.net\/notes\/wp-json\/wp\/v2\/categories?post=1590"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hi3103.net\/notes\/wp-json\/wp\/v2\/tags?post=1590"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}