既存のフォルダ名をクリップボードにコピーする。
# PowerShell 5.1, Windows 10 (Get-ChildItem -Directory).Name | Set-Clipboard
コピーしたフォルダ名を here-string として貼り付ける。
# PowerShell 5.1, Windows 10 $dirNames = @' 新しいフォルダー 01 新しいフォルダー 02 新しいフォルダー 03 '@ -split "`n" foreach ($dirName in $dirNames) { $d = New-Item -ItemType "Directory" -Name $dirName $d | Set-ItemProperty -Name "CreationTime" -Value "2020/04/01 09:00:00" $d | Set-ItemProperty -Name "LastWriteTime" -Value "2020/4/01 15:00:00" }