简体   繁体   English

Windows PowerShell将在Windows 10上安装NativeScript

[英]Windows PowerShell to install NativeScript on Windows 10

I try to install NativeScript on Windows 10 from Admin PowerShell console. 我尝试从Admin PowerShell控制台在Windows 10上安装NativeScript。

https://docs.nativescript.org/start/ns-setup-win https://docs.nativescript.org/start/ns-setup-win

I type this command and obtain the following error: 我键入此命令并获得以下错误:

@powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((new-object net.webclient).DownloadString('https://nativescript.org/setup/win-avd'))"

10

You're running the command from PowerShell when you need to run it from CMD command prompt. 需要从CMD命令提示符运行命令时,您正在从PowerShell运行命令。

Run this from CMD: 从CMD运行此命令:

@powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((new-object net.webclient).DownloadString('https://nativescript.org/setup/win-avd'))"

Here, @powershell means "don't echo the command and run powershell.exe". 在这里, @powershell意思是“不要回显命令并运行powershell.exe”。 It means something completely different in PowerShell itself, where @powershell means "search the path and execute a program with the literal name @powershell before the extension" or "use the variable $powershell as a splat variable" depending on your PowerShell version. 这意味着PowerShell本身完全不同,其中@powershell意思是“搜索路径并以扩展名之前的文本名称@powershell执行程序”或“将$powershell变量用作splat变量”,具体取决于您的PowerShell版本。

If you're running it in Powershell, you'll need to run just: 如果您在Powershell中运行它,则只需运行:

iex ((new-object net.webclient).DownloadString('https://nativescript.org/setup/win-avd'))

As always, be extremely careful about running these commands that download arbitrary code and execute it immediately. 与往常一样,在运行这些命令时要格外小心,这些命令会下载任意代码并立即执行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM