创建指定大小的文件
实现类似Linux下的dd命令:
$tempFile = "C:\test1.txt" $fs = New-Object System.IO.FileStream($tempFile,[System.IO.FileMode]::OpenOrCreate) $fs.Seek(2GB,[System.IO.SeekOrigin]::Begin) $fs.WriteByte(0) $fs.Close()
实现类似Linux下的dd命令:
$tempFile = "C:\test1.txt" $fs = New-Object System.IO.FileStream($tempFile,[System.IO.FileMode]::OpenOrCreate) $fs.Seek(2GB,[System.IO.SeekOrigin]::Begin) $fs.WriteByte(0) $fs.Close()