Created
May 1, 2022 08:47
-
-
Save froop/76e276748b7f75264c881790b0a8a397 to your computer and use it in GitHub Desktop.
[Windows][PowerShell] 大量行テキスト出力
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[string]$FilePath = 'C:\work\dummy10m.txt' | |
[long]$FileSize = 10485760 | |
$ErrorActionPreference = 'Stop' | |
Add-type -AssemblyName System.Web | |
[long]$WriteSize = 0 | |
$file = New-Object System.IO.StreamWriter($FilePath, $false) | |
while($WriteSize -lt $FileSize){ | |
$String = "this is dummy row`r`n" | |
$file.Write($String) | |
$WriteSize = $WriteSize + $String.Length | |
} | |
$file.Close() | |
# [参考] | |
# 【Windows】ダミーファイルを任意のサイズで作成する | とあるオタクの徒然日記 | |
# https://tsuredurediary.com/archives/windows-dummy-file.html |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment