Set-Location - PowerShell


 

Sets the current working location to a specified location. (Set-Location)

   

# NAME
Set-Location

# SYNOPSIS
Sets the current working location to a specified location.

# SYNTAX
Set-Location [-LiteralPath] <string> [-PassThru] [-UseTransaction] [<CommonParameters>]

Set-Location [[-Path] <string>] [-PassThru] [-UseTransaction] [<CommonParameters>]

Set-Location [-StackName <string>] [-PassThru] [-UseTransaction] [<CommonParameters>]

# DESCRIPTION
The Set-Location cmdlet sets the working location to a specified location. That location could be a directory, a sub-directory, a registry location, or another location stack.

# PARAMETERS
-LiteralPath <string>
Specifies a path to the location. The value of the LiteralPath parameter is used exactly as it is typed. No characters are interpreted as wildcards. If the path includes escape characters, enclose it in single quotation marks. Single quotation marks tell Windows PowerShell not to interpret any characters as escape sequences.

Required? true
Position? 1
Default value
Accept pipeline input? true (ByPropertyName)
Accept wildcard characters? false

-PassThru [<SwitchParameter>]
Passes an object representing the location to the pipeline. By default, this cmdlet does not generate any output.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-Path <string>
This parameter is used to specify the path to a new working location.

Required? false
Position? 1
Default value
Accept pipeline input? true (ByValue, ByPropertyName)
Accept wildcard characters? false

-StackName <string>
The name of the stack to which the location is being set.

Required? false
Position? named
Default value
Accept pipeline input? true (ByPropertyName)
Accept wildcard characters? false

-UseTransaction [<SwitchParameter>]
Includes the command in the active transaction. This parameter is valid only when a transaction is in progress. For more information, see about_Transactions.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer and OutVariable. For more information, type,
"get-help about_commonparameters".

# INPUTS
System.String
You can pipe a string that contains a path (but not a literal path) to Set-Location.

# OUTPUTS
None or System.Management.Automation.PathInfo
When you use the PassThru parameter, Set-Location generates a System.Management.Automation.PathInfo object that represents the location. Otherwise, this cmdlet does not generate any output.

# NOTES

The Set-Location cmdlet is designed to work with the data exposed by any provider. To list the providers available in your session, type "Get-PSProvider". For more information, see about_Providers.

# EXAMPLE 1

C:\PS>set-location HKLM:

# Description
-----------
This will set the current location to the one specified; in this case, it is the HKLM provider.

# EXAMPLE 2

C:\PS>set-location env: -passthru

Path
----
Env:\

# Description
-----------
This will set the current location to the one specified; in this case, it is the environment variable provider.

# EXAMPLE 3

C:\PS>set-location C:

# Description
-----------
This will set the current location to the one specified; in this case, it is the C: drive in the file system provider.

RELATED LINKS
Online version: http://go.microsoft.com/fwlink/?LinkID=113397
about_Providers
Get-Location
Pop-Location
Push-Location

C:\Windows>powershell get-help Push-Location -full

ColorConsole [Version 1.7.1000] PowerShell 2.0-Export
Microsoft Windows [Version 6.1.7600]
Copyright (c) 2014 Microsoft Corporation.

OS: Windows 10, 8.1, 8, 7, Vista / Windows Server 2016, 2012, 2008
»»»» ColorConsole








Windows-10





Windows-10

... facebook.de
... Windows-10 FAQ
... Windows-10 Info


Become a Sponsor
... Your button here?





PowerShell: Sets the current working location to a specified location.

HTTP: ... PS_Windows/en/Set-Location.htm
0.202
12314

What is Invisalign?

 /

Use multiple clipboards under Windows!

 /

Turn off touchscreen on Windows 10 and 8.1, can I turn off?

 /

Was ist Base64?

 /

Auch als Fußball macht das elastische Maus-Band Freude!

 /

Windows-8.1 / 10 on-screen keyboard, (find, start, run)?

 /

Can I teach your handwriting style on Windows-10 and the recognizer?

 /

There is also a configurable timer function to shut down!

 /

Show Image Preview or Show Preview and Browser!

 /

Was ist eine Datenträgerverwaltung?

 /

How to add to Explorer context menu (Windows 7, 8.1, 10)?

 /

Hard disk does not start, clicks are heard?

 /