Doing EXE in $ PATH that starts with a numeric value in Powershell?

So, 7z.exe is in the $ PATH environment variable.

PS C:\Users\jimmeh> 7z.exe
Bad numeric constant: 7.
At line:1 char:2
+ 7 <<<< z.exe
    + CategoryInfo          : ParserError: (7:String) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : BadNumericConstant

Besides renaming an exe, is there a way to do this, or is it a bug in Powershell?

+3
source share
2 answers

It works like

& '.\7z.exe'

if you want to specify the archive to extract

& '. \ 7z.exe' e your.zip

+6
source

This is no longer a problem with Powershell 4.0

http://www.microsoft.com/en-us/download/details.aspx?id=40855

0
source

Source: https://habr.com/ru/post/1780280/


All Articles