0

Windows に ASP.Net DNX をインストールしようとしています。https://github.com/aspnet/home#cmdの指示に従いました。

問題は。これを実行すると、次のエラーが表示されます。

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\Users\parsonsjm0818\Desktop>@powershell -NoProfile -ExecutionPolicy unrestric
ted -Command "&{$Branch='dev';iex ((new-object net.webclient).DownloadString('ht
tps://raw.githubusercontent.com/aspnet/Home/dev/dnvminstall.ps1'))}"
Using temporary directory: C:\Users\PARSON~1\AppData\Local\Temp\dnvminstall
Downloading DNVM.ps1 to
Downloading DNVM.cmd to
Installing DNVM
The script 'dnvm.ps1' cannot be run because it contained a "#requires" statemen
t at line 2 for Windows PowerShell version 3.0. The version required by the scr
ipt does not match the currently running version of Windows PowerShell version
2.0.
At line:1 char:191
+ [System.Threading.Thread]::CurrentThread.CurrentCulture = ''; [System.Threadi
ng.Thread]::CurrentThread.CurrentUICulture = '';$CmdPathFile='C:\Users\parsonsj
m0818\.dnx\temp-set-envvars.cmd';& <<<<  'C:\Users\PARSON~1\AppData\Local\Temp\
dnvminstall\dnvm.ps1' setup
    + CategoryInfo          : ResourceUnavailable: (dnvm.ps1:String) [], Scrip
   tRequiresException
    + FullyQualifiedErrorId : ScriptRequiresUnmatchedPSVersion


C:\Users\parsonsjm0818\Desktop>

Powershell 2.0 だけで DNX をインストールできますか、それとも 3.0 にアップグレードする必要がありますか?

4

1 に答える 1

2

The script 'dnvm.ps1' cannot be run because it contained a "#requires" statemen t at line 2 for Windows PowerShell version 3.0.

スクリプトが確実に機能するようにするには、Powershell v3.0 を使用する必要があります。スクリプトを変更して要件を削除することは確かに可能ですが、おそらくそれには正当な理由があります。要件が削除された場合に実際に機能するかどうかは、サイコロのロールにすぎません。

于 2015-05-08T16:39:59.743 に答える