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

Incorporating %USERNAME% Variable in PowerShell PS1 Script For Creating Nuget Packages

$
0
0
nuget pack C:\Users\%USERNAME%\Source\Repos\Common\Common\Common.nuspec -OutputDirectory D:\NugetFeed

The above code is what is in my nugetpack.ps1 file. It works perfectly when I directly enter my username is the path, but I need it to be able to work for multiple users. I entered the %USERNAME% username variable into the path but I get the following response:

Could not find a part of the path 'C:\Users\%USERNAME%\Source.....'.

How can I use the %USERNAME% variable in my path. I am new to PowerShell.


Viewing all articles
Browse latest Browse all 3067

Trending Articles



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