1
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?

More than 3 years have passed since last update.

Windows PowerShell ログの取り方

1
Last updated at Posted at 2021-10-09

前書き

ども、こんにちは。そこいらにいるぺーぺーのインフラエンジニアです。
まあググれば、すぐ出てくるけど、ここに書置きしてても別に問題はないかなといった経緯です。

ログ取得開始

PowerShell
# [C:\work\logs\testtest.txt]はログ保存したい場所と保存したいファイル名を指定している。
Start-Transcript  C:\work\logs\testlog.txt -Append

ログ取得開始【日付あり】

PowerShell
# 日付を定義
$time = Get-Date -Format "yyyyMMdd-HHmm"
Start-Transcript -Path  " C:\work\logs\$time.log" -Append

ログ取得終了

PowerShell
Stop-Transcript

あとがき

おつかれさまなのだ!(๑╹ω╹๑ )
見やすい、分かりやすい方を見ればいいと思うのだ。(๑╹ω╹๑ )!!

参考

1
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
1
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?