boop
boop

Reputation: 7788

How to escape an asterisk?

When I try to do anything with the path HKCR:\* it just takes forever. So I assume it takes the asterisk as wildcard.

Test-Path -Path HKCR:\*

What I've tried

HKCR:\\*
HKCR:\`*
'HKCR:\*'

Upvotes: 2

Views: 1621

Answers (1)

Jason Boyd
Jason Boyd

Reputation: 7029

Use the LiteralPath parameter rather than the Path parameter to prevent characters from being interpreted as wildcards.

Test-Path -LiteralPath HKCR:\*

Upvotes: 3

Related Questions