したいこと
Get-ChildItemコマンドの検索結果をtxtファイルに出力
テキストファイルに出力されたファイルをCompress-Archiveコマンドで圧縮したい
powershell
1$today = (Get-Date).AddDays(-5).ToString("yyMMdd") 2$dir = echo C:\daichi\temp\test\ 3Get-ChildItem -Recurse $dir -Include "u_ex$today.log" | 4 Where-Object { $_.LastWriteTime -ge [DateTime]::Today.AddDays(-100) } | 5 Where-Object { !$_.PSIsContainer } | 6 Foreach-Object { $_.FullName } > C:\test.txt
test.txtファイルの中身
C:\daichi\temp\test\u_ex170421.log
このファイルをCompress-ArchiveのPathにして、DestinationPathをC:\daichi\temp\test\u_ex170421.log.zipにしたいのですが、どうすればよろしいでしょうか?
以上何卒よろしくお願いいたします。

回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2017/04/26 00:13
2017/04/26 00:14
2017/04/26 00:17
2017/04/26 00:27