【问题标题】:Windows PowerShell to install NativeScript on Windows 10Windows PowerShell 在 Windows 10 上安装 NativeScript
【发布时间】:2018-11-04 21:00:29
【问题描述】:

我尝试通过 Admin PowerShell 控制台在 Windows 10 上安装 NativeScript。

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

我输入此命令并获得以下错误:

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

【问题讨论】:

  • 你能把错误翻译成英文吗?这样可以更轻松地为您提供帮助。
  • 我阅读了您粘贴的文档。只需在 CMD 而不是 powershell 中运行它。如果你要在 powershell 中运行它,你需要做的就是(new-object net.webclient).DownloadString('https://nativescript.org/setup/win-avd')
  • 感谢@ArcSet!我不知道读:)

标签: powershell nativescript


【解决方案1】:

当您需要从 CMD 命令提示符运行命令时,您正在从 PowerShell 运行命令。

从 CMD 运行:

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

这里,@powershell 的意思是“不要回显命令并运行 powershell.exe”。它在 PowerShell 本身中意味着完全不同的东西,其中 @powershell 表示“搜索路径并在扩展之前执行具有文字名称 @powershell 的程序”或“使用变量 $powershell 作为 splat 变量”,具体取决于您的 PowerShell版本。

如果你在 Powershell 中运行它,你只需要运行:

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

与往常一样,非常小心运行这些下载任意代码并立即执行的命令。

【讨论】:

    猜你喜欢
    • 2020-07-31
    • 1970-01-01
    • 2017-06-14
    • 2021-03-15
    • 2018-03-22
    • 2018-06-19
    • 2020-05-18
    • 2018-07-18
    • 2020-06-23
    相关资源
    最近更新 更多