04.07.2013 Views

Windows PowerShell 3.0 Step by Step - Cdn.oreilly.com - O'Reilly

Windows PowerShell 3.0 Step by Step - Cdn.oreilly.com - O'Reilly

Windows PowerShell 3.0 Step by Step - Cdn.oreilly.com - O'Reilly

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>Windows</strong> <strong>PowerShell</strong><br />

Copyright (C) 2012 Microsoft Corporation. All rights reserved.<br />

PS C:\Users\administrator> cd c:\<br />

PS C:\> dir<br />

Directory: C:\<br />

Mode LastWriteTime Length Name<br />

---- ------------- ------ ----<br />

d---- 3/22/2012 4:03 AM PerfLogs<br />

d-r-- 3/22/2012 4:24 AM Program Files<br />

d-r-- 3/23/2012 6:02 PM Users<br />

d---- 3/23/2012 4:59 PM <strong>Windows</strong><br />

-a--- 3/22/2012 4:33 AM 24 autoexec.bat<br />

-a--- 3/22/2012 4:33 AM 10 config.sys<br />

PS C:\><br />

You can also <strong>com</strong>bine traditional CMD interpreter <strong>com</strong>mands with some of the newer utilities, such<br />

as fsutil. This is shown here:<br />

PS C:\> md c:\test<br />

Directory: C:\<br />

Mode LastWriteTime Length Name<br />

---- ------------- ------ ----<br />

d---- 4/22/2012 5:01 PM test<br />

PS C:\> fsutil file createnew C:\test\mynewfile.txt 1000<br />

File C:\test\mynewfile.txt is created<br />

PS C:\> cd c:\test<br />

PS C:\test> dir<br />

Directory: C:\test<br />

Mode LastWriteTime Length Name<br />

---- ------------- ------ ----<br />

-a--- 4/22/2012 5:01 PM 1000 mynewfile.txt<br />

PS C:\test><br />

2 <strong>Windows</strong> <strong>PowerShell</strong> 3 <strong>Step</strong> <strong>by</strong> <strong>Step</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!