Powershell: добавить функцию в командную строку без переменной - PullRequest
0 голосов
/ 04 августа 2020

Возможно ли как-то в PowerShell пропустить переменные и включить функцию буквенного обозначения непосредственно в путь выполнения команды?

. (Get-Volume -FileSystemLabel myHDD).DriveLetter:\temp\ps.ps1

Команда должна выглядеть так:

. D: \ temp \ ps.ps1

Когда я запускаю его в PowerShell, я получаю эту ошибку:

. : The term 'D' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

В строке: 1 символ: 3

  • . (Get-Volume -FileSystemLabel myHDD) .DriveLetter: \ temp ...
  • + CategoryInfo          : ObjectNotFound: (D:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException
    
    

Спасибо за вашу помощь!

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...