lastwritetimeは、PowerShellを使用し2010年3月26日午後9時を-geファイルをコピーします。

StackOverflow https://stackoverflow.com/questions/2633505

  •  26-09-2019
  •  | 
  •  

質問

私はlastwritetimeがより大きいまたは2010年3月26日午後9時と同じである別のディレクトリにあるディレクトリ内のファイルをコピーする必要があります。 I使用しています:

Get-ChildItem C:\pstest\hlstore\folder1\data | where-object {$i.lastwritetime -ge “3/26/2010 9:00 PM”} | Copy-Item -destination c:\pstest\hlstore2\folder1\data

しかし、何も起こらない...

すべてのヘルプをいただければ幸いです。

ありがとうございます。

エモ

役に立ちましたか?

解決

これを試してみてください

Get-ChildItem C:\pstest\hlstore\folder1\data | where-object {$_.lastwritetime -ge "3/26/2010 9:00 PM"} | Copy-Item -destination c:\pstest\hlstore2\folder1\data

"それは" where-objectにおける変数である$_の名前ではなく、$iます。

あなたが使用している場合、また、これらの引用符ではなく“”""、私はそれがまた失敗するだろうと思います。

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top