0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

PowerShellのMeasure-Commandでリダイレクトありの計測を行う

Posted at
mysql.exe -h host -u user -ppassword < dump.sql

というふうにMySQLのリストアを行う際に所要時間が知りたかった。PowerShellのMeasure-Commandで計測できるわけだが、リダイレクトのところで詰まった。
結論から言うと、-RedirectStandardInputを使えば良かった。
下のようにコマンドを叩けば良い。

Measure-Command { Start-Process "mysql.exe" -argumentList "-h host -u user -ppassword" -RedirectStandardInput dump.sql -Wait -NoNewWindow }
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?