-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Closed
Labels
Resolution-DuplicateThe issue is a duplicate.The issue is a duplicate.WG-Cmdlets-Managementcmdlets in the Microsoft.PowerShell.Management modulecmdlets in the Microsoft.PowerShell.Management module
Description
Prerequisites
- Write a descriptive title.
- Make sure you are able to repro it on the latest released version
- Search the existing issues.
- Refer to the FAQ.
- Refer to Differences between Windows PowerShell 5.1 and PowerShell.
Steps to reproduce
mkdir "$HOME\[TEST] Directory"- Do "copy as path" from Windows Explorer on this directory.
- Do
cd "C:\Users\user\[TEST] Directory"
Expected behavior
Directory changed to "C:\Users\user\[TEST] Directory"Actual behavior
❯ cd "C:\Users\user\[TEST] Directory"
Set-Location: Cannot find path 'C:\Users\user\[TEST] Directory' because it does not exist.Error details
❯ Get-Error
Exception :
Type : System.Management.Automation.ItemNotFoundException
ErrorRecord :
Exception :
Type : System.Management.Automation.ParentContainsErrorRecordException
Message : Cannot find path 'C:\Users\user\[TEST] Directory' because it does not exist.
HResult : -2146233087
TargetObject : C:\Users\user\[TEST] Directory
CategoryInfo : ObjectNotFound: (C:\Users\user\[TEST] Directory:String) [], ParentContainsErrorRecordException
FullyQualifiedErrorId : PathNotFound
ItemName : C:\Users\user\[TEST] Directory
SessionStateCategory : Drive
TargetSite :
Name : SetLocation
DeclaringType : System.Management.Automation.SessionStateInternal, System.Management.Automation, Version=7.4.0.500, Culture=neutral, PublicKeyToken=31bf3856ad364e35
MemberType : Method
Module : System.Management.Automation.dll
Message : Cannot find path 'C:\Users\user\[TEST] Directory' because it does not exist.
Source : System.Management.Automation
HResult : -2146233087
StackTrace :
at System.Management.Automation.SessionStateInternal.SetLocation(String path, CmdletProviderContext context, Boolean literalPath)
at Microsoft.PowerShell.Commands.SetLocationCommand.ProcessRecord()
TargetObject : C:\Users\user\[TEST] Directory
CategoryInfo : ObjectNotFound: (C:\Users\user\[TEST] Directory:String) [Set-Location], ItemNotFoundException
FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.SetLocationCommand
InvocationInfo :
MyCommand : Set-Location
ScriptLineNumber : 1
OffsetInLine : 1
HistoryId : 10
Line : cd 'C:\Users\user\[TEST] Directory'
Statement : cd 'C:\Users\user\[TEST] Directory'
PositionMessage : At line:1 char:1
+ cd 'C:\Users\user\[TEST] Directory'
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
InvocationName : cd
CommandOrigin : Internal
ScriptStackTrace : at <ScriptBlock>, <No file>: line 1
PipelineIterationInfo :Environment data
❯ echo $PSVersionTable
Name Value
---- -----
PSVersion 7.4.0
PSEdition Core
GitCommitId 7.4.0
OS Microsoft Windows 10.0.22631
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0Visuals
Metadata
Metadata
Assignees
Labels
Resolution-DuplicateThe issue is a duplicate.The issue is a duplicate.WG-Cmdlets-Managementcmdlets in the Microsoft.PowerShell.Management modulecmdlets in the Microsoft.PowerShell.Management module
