2017-05-09 13 views
0

Powershell経由でChocolateyをインストールする手順は、Windows 7 64bit PCでは動作しません。私はExecutionPolicyを確認していると、そのシステムパスが PowerShellを持ってhttps://chocolatey.org/install#install-from-powershell-v3Chocolateyがインストールされない

  • を以下のよ。

    PS C:\Users\a> Get-ExecutionPolicy 
    AllSigned 
    
    PS C:\Users\a> ($env:Path).split(';') 
    %SystemRoot%\system32\WindowsPowerShell\v1.0\ 
    C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common 
    C:\Program Files (x86)\Intel\iCLS Client\ 
    C:\Program Files\Intel\iCLS Client\ 
    C:\ProgramData\Oracle\Java\javapath 
    C:\Windows\system32 
    C:\Windows 
    C:\Windows\System32\Wbem 
    C:\Windows\System32\WindowsPowerShell\v1.0\ 
    C:\Program Files\Java\jre1.8.0_40\bin 
    C:\Program Files\Java\jdk1.8.0_40\bin 
    C:\Program Files (x86)\AMD\ATI.ACE\Core-Static 
    C:\Windows\System32\WindowsPowerShell\v1.0\ 
    C:\Program Files\Intel\Intel(R) Management Engine Components\DAL 
    C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL 
    C:\Program Files\Intel\Intel(R) Management Engine Components\IPT 
    C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT 
    C:\HashiCorp\Vagrant\bin 
    C:\Program Files (x86)\Git\bin 
    C:\Program Files (x86)\Skype\Phone\ 
    C:\Program Files (x86)\Git\bin 
    C:\Program Files (x86)\Git\libexec\git-core 
    
    C:\Program Files (x86)\Nmap 
    C:\Program Files\smartmontools\bin 
    
  • ここに私のエラーメッセージがあります。

    PS C:\Users\a> iwr https://chocolatey.org/install.ps1 -UseBasicParsing | iex 
    ???# : The term '???#' 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. 
    At line:1 char:1 
    + ???# ===================================================================== 
    + ~~~~ 
        + CategoryInfo   : ObjectNotFound: (???#:String) [], CommandNotFoundException 
        + FullyQualifiedErrorId : CommandNotFoundException 
    
    Getting latest version of the Chocolatey package for download. 
    Getting Chocolatey from https://chocolatey.org/api/v2/package/chocolatey/0.10.5. 
    !Test-Path : The term '!Test-Path' 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. 
    At line:188 char:11 
    + } elseif (!Test-Path $7zaExe) { 
    +   ~~~~~~~~~~ 
        + CategoryInfo   : ObjectNotFound: (!Test-Path:String) [], CommandNotFoundException 
        + FullyQualifiedErrorId : CommandNotFoundException 
    
    Extracting C:\Users\a\AppData\Local\Temp\chocolatey\chocInstall\chocolatey.zip to C:\Users\a\AppData\Local\Temp\chocolatey\chocInstall... 
    Exception calling "Start" with "0" argument(s): "The system cannot find the file specified" 
    At line:211 char:3 
    + $process.Start() | Out-Null 
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
        + CategoryInfo   : NotSpecified: (:) [], MethodInvocationException 
        + FullyQualifiedErrorId : Win32Exception 
    
    Exception calling "BeginOutputReadLine" with "0" argument(s): "StandardOut has not been redirected or the process hasn't started yet." 
    At line:212 char:3 
    + $process.BeginOutputReadLine() 
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
        + CategoryInfo   : NotSpecified: (:) [], MethodInvocationException 
        + FullyQualifiedErrorId : InvalidOperationException 
    
    Exception calling "WaitForExit" with "0" argument(s): "No process is associated with this object." 
    At line:213 char:3 
    + $process.WaitForExit() 
    + ~~~~~~~~~~~~~~~~~~~~~~ 
        + CategoryInfo   : NotSpecified: (:) [], MethodInvocationException 
        + FullyQualifiedErrorId : InvalidOperationException 
    
    Unable to unzip package using 7zip. Perhaps try setting $env:chocolateyUseWindowsCompression = 'true' and call install again. Error: 7-Zip signalled an unknown error (code) 
    At line:225 char:15 
    +  default { throw "$errorMessage 7-Zip signalled an unknown error (code $exitC ... 
    +    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
        + CategoryInfo   : OperationStopped: (Unable to unzip...n error (code):String) [], RuntimeException 
        + FullyQualifiedErrorId : Unable to unzip package using 7zip. Perhaps try setting $env:chocolateyUseWindowsCompression = 'true' and call install again. Error: 7-Zip signalled an unknown error (code) 
    
  • 私は最後の行

    Perhaps try setting $env:chocolateyUseWindowsCompression = 'true' 
    

    上のエラーメッセージの提案を試してみました。しかし、他のエラー

+0

AllSignedは、現在、我々はPowerShellチームに渡さPowerShellのいくつかの発見のバグが原因で仕事に行くのではありません。 0.10.6が出たときに再び動作します。その他の問題については、BOM以外のファイル(今日発見した2番目の問題)のUnicode文字でauthenticodeが失敗しないようにするためにBOMを導入しました。問題を修正して修正してください。 – ferventcoder

+0

https://github.com/chocolatey/choco(Bug install.ps1スクリプトの場合は、すでにallsignedに問題があり修正済みです)、https://github.com/chocolatey/chocolatey.orgありがとう! – ferventcoder

+0

私はhttps://github.com/chocolatey/chocolatey.org/issues/512 – ferventcoder

答えて

1
 
PS C:\admin\scripts>iwr https://chocolatey.org/install.ps1 -UseBasicParsing 


StatusCode  : 200 
StatusDescription : OK 
Content   : # ===================================================================== 
... 

の全シリーズで唯一の結果は、あなたがしていることUTF-8でエンコードされたファイルをダウンロードします(コンテンツはUTF-8で始まります)byte order mark )が、ASCIIテキストとして扱われています。

に加え:

私はhttps://chocolatey.org/install#install-from-powershell-v3を次のようです。

いいえ、そうではありません。あなたは、参照ウェブサイトでは、そのアプローチを使用する場合は、コンテンツからBOMを削除する必要があなたは

iwr https://chocolatey.org/install.ps1 -UseBasicParsing | iex 

を使用しようとしているのに対し、宣伝通りに動作し

iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) 

を使用するように説明しますInvoke-Expressionにそれをパイプする前に:

(iwr https://chocolatey.org/install.ps1 -UseBasicParsing).Content -replace '^' | iex 
+0

さらにオプションをクリックすると、彼がリンクしているものが表示されます。PowerShellがファイルを適切に処理して、それがUTF8 b/c BOMであることが期待されます(ただし、明らかではありません)。 – ferventcoder

+0

フロントページに機能するものがあるときは、「オプションを増やしたくない」傾向があります。 –

関連する問題