在Path環(huán)境變量加入一個(gè)在Program Files (x86)下的路徑后,Get-Command可以正常直接獲取該路徑下的程序,但執(zhí)行時(shí)會(huì)因?yàn)槁窂嚼锏摹皒86”而報(bào)錯(cuò)。如下所示:
C:> (Get-Command code).Source C:Program Files (x86)Microsoft VS Codeincode.cmd C:> code 警告: Could not find ssh-agent x86 : 無法將“x86”項(xiàng)識(shí)別為 cmdlet、函數(shù)、腳本文件或可運(yùn)行程序的名稱。請(qǐng)檢查名稱的拼寫,如果 包括路徑,請(qǐng)確保路徑正確,然后再試一次。 所在位置 行:1 字符: 19 + C:Program Files (x86)Microsoft VS Codeincode.cmd + ~~~ + CategoryInfo: ObjectNotFound: (x86:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundExceptionC:> $env:PATH C:ProgramDataOracleJavajavapath;C:Program Files (x86)InteliCLS Client;C:Program File sInteliCLS Client;C:Windowssystem32;C:Windows;C:WindowsSystem32Wbem;C:WindowsSyste m32WindowsPowerShellv1.0;C:Program Files (x86)IntelIntel(R) Management Engine Component sDAL;C:Program FilesIntelIntel(R) Management Engine ComponentsDAL;C:Program Files (x86) IntelIntel(R) Management Engine ComponentsIPT;C:Program FilesIntelIntel(R) Management E ngine ComponentsIPT;C:Program Files (x86)NVIDIA CorporationPhysXCommon;C:Program Files IntelWiFiin;C:Program FilesCommon FilesIntelWirelessCommon;C:WINDOWSsystem32;C:WI NDOWS;C:WINDOWSSystem32Wbem;C:WINDOWSSystem32WindowsPowerShellv1.0;C:Program Files odejs;C:Program Files (x86)scalain;C:Program FilesTortoiseGitin;C:WINDOWSsystem32 configsystemprofile.dnxin;C:Program FilesMicrosoft DNXDnvm;C:Program Files (x86)Win dows Kits8.1Windows Performance Toolkit;C:Program FilesMicrosoft SQL Server120ToolsBi nn;C:Program FilesMicrosoft SQL Server130ToolsBinn;C:Program FilesGitcmd;C:UsersD ustarAppDataLocalMicrosoftWindowsApps;C:UsersDustarAppDataRoamingpm;C:Program File s (x86)Microsoft VS Codein C:>
這個(gè)問題在cmd里并不會(huì)出現(xiàn)。
請(qǐng)問這是什么原因,該怎么解決?