create_package.ps1 627 B

1234567891011121314151617
  1. # Generate Nuget package from this folder (find *.nuspec files at this level)
  2. # Set up initial variables, paths, constants
  3. Set-ExecutionPolicy -Scope Process -ExecutionPolicy Unrestricted
  4. Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy Unrestricted
  5. $nuget = "$env:LOCALAPPDATA\Nuget\Nuget.exe"
  6. $current = (Get-Location).Path
  7. Set-Alias nuget $nuget
  8. $nuspecFiles = Get-ChildItem -Path $current | Where-Object {
  9. $_.FullName -like "*.nuspec"} | Select-Object
  10. foreach($file in $nuspecFiles){
  11. nuget pack $file.FullName
  12. Write-Host ("Generated nuget package from {0}" -f $file.FullName) -ForegroundColor White
  13. }