Cataster
Cataster

Reputation: 3481

Where are the Illegal characters in path?

I have the following script to install sql server module through nuget (install nuget from chocolatey)

$Check = Get-Module -ListAvailable SqlServer

if ($Check -eq $null)
{
    write-host "`r`nSqlServer Module Not Found - Installing..."

    #Installing Chocolatey
    & ".\InstallChocolatey.ps1"

    #installing SqlServer Module
    start powershell { 
    choco install nuget.commandline –pre -y 
    Install-Module -Name SqlServer <# –Scope AllUsers #> -Confirm:$false -AllowClobber
    Read-Host
    }

    write-host "`r`n  $Check installed!"
}
else {  write-host "`r`n  $Check installed!" }

when i run the script

I get these errors:

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.

Where are these illegal characters coming from??

Upvotes: 1

Views: 1017

Answers (1)

Cataster
Cataster

Reputation: 3481

Figured it out

the dash length before pre (--pre) is not the same as a regular dash; same for -Scope

Upvotes: 1

Related Questions