Quantcast
Channel: Active questions tagged nuget-package - Stack Overflow
Viewing all articles
Browse latest Browse all 3067

NuGet add within Powershell

$
0
0

I'm trying to execute the following NuGet add command via a PowerShell script:

Invoke-Expression "'C:\Program Files\NuGet\nuget.exe' add '\packageName.1.1.0.nupkg' -Source '\\file-server\My Nuget Packages'"

However, I keep running into the following errors:

Invoke-Expression : At line:1 char:36
+ 'C:\Program Files\NuGet\nuget.exe' add '\packageName.1.1.0.nupkg' -Source '\\fil ...
+                                    ~~~
Unexpected token 'add' in expression or statement.
At line:3 char:1
+ Invoke-Expression "'C:\Program Files\NuGet\nuget.exe' add '\packageName.1.1.0.nu ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ParserError: (:) [Invoke-Expression], ParseException
    + FullyQualifiedErrorId : UnexpectedToken,Microsoft.PowerShell.Commands.InvokeExpressionCommand

Is there a way to call the Nuget add script from within Powershell? If so, how would I do so?


Viewing all articles
Browse latest Browse all 3067

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>