{"id":3897,"date":"2022-10-10T04:23:37","date_gmt":"2022-10-09T19:23:37","guid":{"rendered":"https:\/\/1bed.allright.life\/?p=3897"},"modified":"2022-10-10T04:23:37","modified_gmt":"2022-10-09T19:23:37","slug":"post-3897","status":"publish","type":"post","link":"https:\/\/1bed.allright.life\/?p=3897","title":{"rendered":"PowerShell 7.2.6 \u3067 ClosedXML \u3092\u4f7f\u3046\u524d\u306e\u6e96\u5099"},"content":{"rendered":"<h2>\u7d4c\u7def<\/h2>\n<p>6, 7 \u5e74\u307e\u3048\u3050\u3089\u3044\u306b\u3001ClosedXML \u3092\u5c11\u3057\u89e6\u3063\u305f\u3053\u3068\u304c\u3042\u308a\u307e\u3057\u305f<\/p>\n<p><a href=\"https:\/\/1bed.allright.life\/?p=2206\">PowerShell \u3067 ClosedXML \u3092\u4f7f\u3063\u3066 Excel \u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3059\u308b<\/a><\/p>\n<p>\u305d\u308c\u304b\u3089\u6642\u4ee3\u306f\u5909\u308f\u3063\u3066\u3044\u304d\u3001\u4eca\u306f PowerShell Core \u5168\u76db\u6642\u4ee3\u307f\u305f\u3044\u3067\u3059<\/p>\n<p>\u3069\u3046\u305b\u306a\u3089 PowerShell Core \u3067 ClosedXML \u3092\u5229\u7528\u3057\u3066\u307f\u3088\u3046\u3068\u601d\u3044\u3001\u74b0\u5883\u69cb\u7bc9\u3092\u884c\u3063\u3066<br \/>\n\u3044\u307e\u3057\u305f\u304c\u52d8\u9055\u3044\u3082\u6709\u308a\u30cf\u30de\u3063\u3066\u3057\u307e\u3063\u305f\u306e\u3067\u3001\u307e\u305f\u540c\u3058\u3053\u3068\u3092\u8d77\u3053\u3055\u306a\u3044\u3088\u3046\u306b\u3068\u3044\u3046\u30e1\u30e2\u3067\u3059<\/p>\n<p>\u3061\u306a\u307f\u306b\u3001\u5f53\u521d NuGet \u3067\u4f5c\u3063\u3066\u3044\u305f\u306e\u3067\u3059\u304c\u3001\u8272\u3005\u8003\u3048\u3066\u7d50\u5c40\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u3066\u3001<br \/>\nDLL \u3060\u3051\u3092\u4f7f\u3046\u65b9\u6cd5\u306b\u3057\u307e\u3057\u305f<\/p>\n<h2>\u74b0\u5883<\/h2>\n<ul>\n<li>Windows 10 Pro<\/li>\n<li>PowerShell 7.2.6<\/li>\n<\/ul>\n<h2>\u69cb\u7bc9\u624b\u9806<\/h2>\n<h3>\u5404\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9<\/h3>\n<p>2022\u5e7410\u670810\u65e5\u73fe\u5728\u3067\u3001ClosedXML \u306e\u6700\u65b0\u30d0\u30fc\u30b8\u30e7\u30f3\u306f 0.96.0 \u3067\u3059<\/p>\n<p>\u4f9d\u5b58\u95a2\u4fc2\u306f <a href=\"https:\/\/www.nuget.org\/packages\/ClosedXML\/#dependencies-body-tab\">Dependencies<\/a> \u3067\u78ba\u8a8d\u3067\u304d\u3001\u5229\u7528\u3059\u308b\u306e\u306f .NETStandard 2.0 \u3067\u3059<\/p>\n<p>DocumentFormat.OpenXml \u306f\u66f4\u306b\u4f9d\u5b58\u95a2\u4fc2\u304c\u3042\u3063\u305f\u306e\u3067\u3001\u4e0b\u8a18\u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3059\u308c\u3070 OK \u3067\u3057\u305f<\/p>\n<ul>\n<li>ClosedXML: 0.96.0 -&gt; <a href=\"https:\/\/www.nuget.org\/api\/v2\/package\/ClosedXML\/0.96.0\">DownLoad<\/a>\n<ul>\n<li>DocumentFormat.OpenXml: 2.16.0 -&gt; <a href=\"https:\/\/www.nuget.org\/api\/v2\/package\/DocumentFormat.OpenXml\/2.16.0\">DownLoad<\/a><\/li>\n<li>System.IO.Packaging: 4.7.0 -&gt; <a href=\"https:\/\/www.nuget.org\/api\/v2\/package\/System.IO.Packaging\/4.7.0\">DownLoad<\/a><\/li>\n<li>ExcelNumberFormat: 1.1.0 -&gt; <a href=\"https:\/\/www.nuget.org\/api\/v2\/package\/ExcelNumberFormat\/1.1.0\">DownLoad<\/a><\/li>\n<li>Microsoft.CSharp: 4.7.0 -&gt; <a href=\"https:\/\/www.nuget.org\/api\/v2\/package\/Microsoft.CSharp\/4.7.0\">DownLoad<\/a><\/li>\n<li>System.Drawing.Common: 4.5.0 -&gt; <a href=\"https:\/\/www.nuget.org\/api\/v2\/package\/System.Drawing.Common\/4.5.0\">DownLoad<\/a><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h3>\u4fdd\u8b77\u306e\u89e3\u9664\u3068 DLL \u306e\u53d6\u308a\u51fa\u3057<\/h3>\n<p>\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u305f\u30d5\u30a1\u30a4\u30eb\u306f\u4fdd\u8b77\u3055\u308c\u3066\u3044\u308b\u305f\u3081\u3001\u89e3\u9664\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059<br \/>\nnupkg \u30d5\u30a1\u30a4\u30eb\u3092\u53f3\u30af\u30ea\u30c3\u30af\u3057\u3066\u3001\u30d7\u30ed\u30d1\u30c6\u30a3\u3092\u958b\u304d\u3001\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u3067 <strong>[\u8a31\u53ef\u3059\u308b]<\/strong> \u306b\u30c1\u30a7\u30c3\u30af\u3092\u5165\u308c\u3066\u3001[ OK ] \u30dc\u30bf\u30f3\u3092\u62bc\u3057\u307e\u3059<\/p>\n<p><a href=\"https:\/\/1bed.allright.life\/wp-content\/uploads\/2022\/10\/20221010_01.png\" data-rel=\"lightbox-image-0\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img decoding=\"async\" src=\"https:\/\/1bed.allright.life\/wp-content\/uploads\/2022\/10\/20221010_01.png\" alt=\"\" \/><\/a><\/p>\n<p>\u6b21\u306b\u3001\u62e1\u5f35\u5b50\u3092 zip \u306b\u5909\u3048\u3066\u5c55\u958b\u3057\u3066\u3001 <code>lib\\netstandard2.0<\/code> \u306e\u4e2d\u306b\u3042\u308b DLL \u30d5\u30a1\u30a4\u30eb\u3092\u53d6\u5f97\u3057\u307e\u3059<\/p>\n<p>\u3053\u308c\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u305f\u30d5\u30a1\u30a4\u30eb\u5168\u3066\u3067\u304a\u3053\u306a\u3044\u307e\u3059<\/p>\n<h3>\u52d5\u4f5c\u78ba\u8a8d<\/h3>\n<p>\u5148\u306b\u53d6\u5f97\u3057\u305f DLL \u3092\u30d5\u30a9\u30eb\u30c0\u306b\u5165\u308c\u3066\u3001\u305d\u3053\u306b example.ps1 \u3092\u4f5c\u6210\u3057\u3066\u4fdd\u5b58\u3001<br \/>\nPowerShell 7.2.6 \u3067\u5b9f\u884c\u3057\u307e\u3059<\/p>\n<pre><code class=\"language-powershell\">Add-Type -Path &quot;$PSScriptRoot\\ClosedXML.dll&quot;\nAdd-Type -Path &quot;$PSScriptRoot\\DocumentFormat.OpenXml.dll&quot;\nAdd-Type -Path &quot;$PSScriptRoot\\System.IO.Packaging.dll&quot;\nAdd-Type -Path &quot;$PSScriptRoot\\ExcelNumberFormat.dll&quot;\nAdd-Type -Path &quot;$PSScriptRoot\\Microsoft.CSharp.dll&quot;\nAdd-Type -Path &quot;$PSScriptRoot\\System.Drawing.Common.dll&quot;\n\n$workBook = New-Object ClosedXML.Excel.XLWorkbook\n\n$workSheet = $workBook.Worksheets.Add(&quot;Sheet1&quot;)\n$workSheet.Cell(&quot;A1&quot;).Value = &quot;Hello world&quot;;\n$workBook.SaveAs(&quot;$PSScriptRoot\\helloworld.xlsx&quot;)\n\n$workSheet = $null\n$workBook = $null<\/code><\/pre>\n<p>\u4f5c\u6210\u3055\u308c\u305f Excel \u3092\u958b\u304f\u3068\u3001A1 \u306e\u30bb\u30eb\u306b Hello world \u3068\u8868\u793a\u3055\u308c\u3066\u3044\u307e\u3059<br \/>\n<a href=\"https:\/\/1bed.allright.life\/wp-content\/uploads\/2022\/10\/20221010_2.png\" data-rel=\"lightbox-image-1\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img decoding=\"async\" src=\"https:\/\/1bed.allright.life\/wp-content\/uploads\/2022\/10\/20221010_2.png\" alt=\"\" \/><\/a><\/p>\n<h2>\u8003\u5bdf<\/h2>\n<p>\u4eca\u898b\u308b\u3068\u3001\u3069\u3053\u3067\u5f15\u3063\u304b\u304b\u3063\u305f\u3093\u3060\u3088&#8230; \u3063\u3066\u30ec\u30d9\u30eb\u3067\u5358\u7d14\u3067\u6065\u305a\u304b\u3057\u3044\u3067\u3059\u304c\u3001<br \/>\n\u3053\u308c\u3067\u74b0\u5883\u304c\u4f5c\u308c\u305f\u306e\u3067\u6b21\u306b\u9032\u3093\u3067\u6c5a\u540d\u633d\u56de\u3092\u56f3\u308a\u307e\u3059\uff08\u8ab0\u306b\uff1f\uff09<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u7d4c\u7def 6, 7 \u5e74\u307e\u3048\u3050\u3089\u3044\u306b\u3001ClosedXML \u3092\u5c11\u3057\u89e6\u3063\u305f\u3053\u3068\u304c\u3042\u308a\u307e\u3057\u305f PowerShell \u3067 ClosedXML \u3092\u4f7f\u3063\u3066 Excel \u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3059\u308b \u305d\u308c\u304b\u3089\u6642\u4ee3\u306f\u5909\u308f\u3063\u3066\u3044\u304d\u3001\u4eca\u306f PowerShe [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[98,97,62],"class_list":["post-3897","post","type-post","status-publish","format-standard","hentry","category-program","tag-closedxml","tag-excel","tag-powershell"],"_links":{"self":[{"href":"https:\/\/1bed.allright.life\/index.php?rest_route=\/wp\/v2\/posts\/3897","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/1bed.allright.life\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/1bed.allright.life\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/1bed.allright.life\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/1bed.allright.life\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3897"}],"version-history":[{"count":1,"href":"https:\/\/1bed.allright.life\/index.php?rest_route=\/wp\/v2\/posts\/3897\/revisions"}],"predecessor-version":[{"id":3900,"href":"https:\/\/1bed.allright.life\/index.php?rest_route=\/wp\/v2\/posts\/3897\/revisions\/3900"}],"wp:attachment":[{"href":"https:\/\/1bed.allright.life\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3897"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/1bed.allright.life\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3897"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/1bed.allright.life\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3897"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}