Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/powershell/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Powershell 路径中的非法字符在哪里?_Powershell - Fatal编程技术网

Powershell 路径中的非法字符在哪里?

Powershell 路径中的非法字符在哪里?,powershell,Powershell,我有以下脚本通过nuget安装sql server模块(从Chockoley安装nuget) $Check=Get模块-ListAvailable SqlServer 如果($Check-eq$null) { 写入主机“`r`nSqlServer模块未找到-正在安装…” #安装巧克力 &“\installchocolate.ps1” #安装SqlServer模块 启动powershell{ choco安装nuget.commandline–预安装 安装模块-名称SqlServer-确认:$fal

我有以下脚本通过nuget安装sql server模块(从Chockoley安装nuget)

$Check=Get模块-ListAvailable SqlServer
如果($Check-eq$null)
{
写入主机“`r`nSqlServer模块未找到-正在安装…”
#安装巧克力
&“\installchocolate.ps1”
#安装SqlServer模块
启动powershell{
choco安装nuget.commandline–预安装
安装模块-名称SqlServer-确认:$false-AllowClobber
读主机
}
写入主机“`r`n$Check installed!”
}
else{write host“`r`n$Check installed!”)
当我运行脚本时

我发现以下错误:

Chocolatey v0.10.13
Installing the following packages:
nuget.commandline;â?pre -y
 Install-Module -Name SqlServer <# â?Scope;AllUsers
By installing you accept licenses for the packages.
nuget.commandline v5.0.2 already installed.
 Use --force to reinstall, specify a version to install, or try upgrade.

Chocolatey installed 0/0 packages.
 See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).

Illegal characters in path.
巧克力v0.10.13
安装以下软件包:
命令行;–pre-y
安装模块-Name SqlServer解决了这个问题

pre(
--pre
)之前的破折号长度与常规破折号不同;
同样适用于
-Scope

哦,我想我知道了!pre之前的破折号与-y的破折号长度不同
Chocolatey v0.10.13
Installing the following packages:
nuget.commandline;â?pre -y
 Install-Module -Name SqlServer <# â?Scope;AllUsers
By installing you accept licenses for the packages.
nuget.commandline v5.0.2 already installed.
 Use --force to reinstall, specify a version to install, or try upgrade.

Chocolatey installed 0/0 packages.
 See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).

Illegal characters in path.