Set-Location
- Description
- Sets the current working location to a specified location.
- Syntax
Set-Location [-Path] <String> [-PassThru]
- Example
Set-Location -Path 'C:\Users\Documents'
- Parameters
- Path: Required. Specifies the path of a new working locationPassThru: Optional. Returns a PathInfo object representing the location
- Return type
- None or System.Management.Automation.PathInfo
- Aliases
- sl, cd, chdir
- Supported Windows versions
- Windows PowerShell 2.0 and laterWindows 7Windows 8Windows 10Windows 11Windows Server 2008 R2 and later