Contact Info

Crumbtrail

ActiveXperts.com » Administration » Powershell » Powershell 2.0 » Push-Location

Push-Location - Powershell 2.0 CmdLet

Microsoft Windows PowerShell is a command-line shell and scripting tool based on the Microsoft .NET Framework. It is designed for system administrators, engineers and developers to control and automate the administration of Windows and applications.

More than hundred command-line tools (so called "cmdlets") can be used to perform system administration tasks and Windows Management Instrumentation (WMI). These cmdlets are easy to use, with standard naming conventions and common parameters, and standard tools for piping, sorting, filtering, and formatting data and objects.

Push-Location


Short description
Adds the current location to the top of a list of locations (a "stack").

Syntax
Push-Location [[-LiteralPath] <string>] [-PassThru] [-StackName <string>] [-UseTransaction] [<CommonParameters>]

Push-Location [[-Path] <string>] [-PassThru] [-StackName <string>] [-UseTransaction] [<CommonParameters>]

Description
The Push-Location cmdlet adds ("pushes") the current location to the top of a list of locations, called a "stack." 
You can push the current location onto a default stack or onto a stack that you create. If you specify a path, Push
-Location pushes the current location onto the stack and then changes the current location to the location specifie
d by the path. You cannot push a location onto the stack unless it is the current location.