-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Closed
Labels
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
test-path $nullExpected behavior
$falseActual behavior
Test-Path: Value cannot be null. (Parameter 'The provided Path argument was null or an empty collection.')Error details
Exception :
Type : System.ArgumentNullException
Message : Value cannot be null. (Parameter 'The provided Path argument was null or an empty collection.')
ParamName : The provided Path argument was null or an empty collection.
HResult : -2147467261
CategoryInfo : InvalidArgument: (:) [Test-Path], ArgumentNullException
FullyQualifiedErrorId : NullPathNotPermitted,Microsoft.PowerShell.Commands.TestPathCommand
InvocationInfo :
MyCommand : Test-Path
ScriptLineNumber : 1
OffsetInLine : 1
HistoryId : 1
Line : test-path $null
Statement : test-path $null
PositionMessage : At line:1 char:1
+ test-path $null
+ ~~~~~~~~~~~~~~~
InvocationName : test-path
CommandOrigin : Internal
ScriptStackTrace : at <ScriptBlock>, <No file>: line 1
PipelineIterationInfo :
0
1Environment data
PSVersion 7.4.5
PSEdition Core
GitCommitId 7.4.5
OS Microsoft Windows 10.0.27729
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0Visuals
No response
Metadata
Metadata
Assignees
Labels
WG-Cmdlets-Managementcmdlets in the Microsoft.PowerShell.Management modulecmdlets in the Microsoft.PowerShell.Management module