Chapter 3 Quick Reference

To

Do This

Produce a listing of all variables defined in a Windows PowerShell session

Use the Set-Location cmdlet to change location to the variable PSDrive, then use the Get-ChildItem cmdlet

Obtain a listing of all the aliases

Use the Set-Location cmdlet to change location to the alias PSDrive, then use the Get-ChildItem cmdlet to produce a listing of aliases. Pipeline the resulting object into the Where-Object cmdlet and filter on the name property for the appropriate value

Delete a directory that is empty

Use the Remove-Item cmdlet and supply the name of the directory

Delete a directory that contains other items

Use the Remove-Item cmdlet and supply the name of the directory and specify the recurse argument

Create a new text ...

Get Microsoft® Windows PowerShell™ Step By Step now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.