回答編集履歴

1

追記

2019/07/27 00:40

投稿

Zuishin
Zuishin

スコア28660

test CHANGED
@@ -11,3 +11,21 @@
11
11
 
12
12
 
13
13
  BOM 無しの Encoding は https://docs.microsoft.com/ja-jp/dotnet/api/system.text.utf8encoding.-ctor?view=netframework-4.8#System_Text_UTF8Encoding__ctor_System_Boolean_ を false で作ってください。
14
+
15
+
16
+
17
+ # 追記
18
+
19
+
20
+
21
+ ```ps1
22
+
23
+ $encoding = New-Object System.Text.UTF8Encoding $false
24
+
25
+ [System.IO.File]::WriteAllLines($outfile, (go run "tree.go"), $encoding)
26
+
27
+ ```
28
+
29
+
30
+
31
+ なお $outfile をフルパスで指定しなければ思わぬところに保存されるかもしれません。そうでない場合は `Convert-Path` を使ってフルパスに直してください。