Sunday, January 18, 2009

create a directory and file

[] to create a new directory named 'new.directory' in the 'r:\temp' directory

PS> new-item -path r:\temp\new.directory -itemtype directory

[] to create a file named 'file1.log' in the 'r:\temp' directory

PS> new-item -path r:\temp\file1.log -itemtype file


Directory: Microsoft.PowerShell.Core\FileSystem::R:\temp


Mode LastWriteTime Length Name
---- ------------- ------ ----
-a--- 2008-Dec-10 7:39 PM 0 file1.log <--- empty content

No comments:

Post a Comment