15.01.2024 Views

CompTIA A+ Certification All-in-One Exam Guide

  • No tags were found...

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

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

some amazing tasks. Figure 15-16 shows two commands that do the same

thing by default, show the contents of a directory: dir and Get-ChildItem.

Figure 15-16 Simple commands in PowerShell

With dir, you know you can search for items in a directory, such as “find

all the JPEG files in a folder” with this command:

dir *.jpg

PowerShell lets you dial it all the way to 11, though, with a few more

characters on a search string. The following command will find all the JPEG

files in the current directory, plus all the mentions of .jpg files in any

document format, such as Word, PowerPoint, and Acrobat:

Get-ChildItem . –Include *.jpg –Recurse –Force

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

Saved successfully!

Ooh no, something went wrong!