GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — add ability to package all of powershell core as a NuGet Package by TravisEz13 · Pull Request #4363 · PowerShell/PowerShell

Conversation

@TravisEz13

@TravisEz13 Travis Plunk (TravisEz13) commented Jul 27, 2017 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Example usage

function Update-Powershell 
{
    param([string]$target='~/powershell')

    if(!(Get-PackageSource -Name powershell -ErrorAction SilentlyContinue))
    {
        Register-PackageSource -Name powershell -Location https://powershell.myget.org/F/powershell-core-daily  -ProviderName nuget -Trusted
    }

    if($ismacos){
        $package = 'powershell-osx.10.12-x64'
    }
    elseif($iswindows)
    {
        $package = 'powershell-win-x64-win7-x64'
    }
    elseif($islinux)
    {
        $package = 'powershell-linux-x64'
    }

    if(!(test-path $target))
    {
        md $target
    }

    find-package -Source powershell -AllowPrereleaseVersions -name $package |Install-Package -Destination $target -ExcludeVersion
    if(!$isWindows){
        chmod a+x "$target/$package/content/pwsh"
    }
    &"$target/$package/content/pwsh"
}

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@msftclas Microsoft Contribution License Agreements (msftclas) added the cla-already-signed label Jul 27, 2017
@TravisEz13 Travis Plunk (TravisEz13) assigned Dongbo Wang (daxian-dbw) Jul 27, 2017
daxian-dbw
Dongbo Wang (daxian-dbw) reviewed Jul 27, 2017
View reviewed changes
Comment thread tools/packaging/packaging.psm1 Outdated

@daxian-dbw Dongbo Wang (daxian-dbw) Jul 27, 2017

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe change the name to 'content'

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@TravisEz13
Travis Plunk (TravisEz13) requested a review from Aditya Patwardhan (adityapatwardhan) July 27, 2017 22:44
iSazonov
Ilya (iSazonov) reviewed Jul 28, 2017
View reviewed changes
Comment thread tools/packaging/project/powershell.nuspec Outdated

@iSazonov Ilya (iSazonov) Jul 28, 2017

Copy link
Copy Markdown
Collaborator

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems we never use "CLI". Maybe <title>PowerShell Core $runtime$</title>.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@daxian-dbw Dongbo Wang (daxian-dbw) Jul 28, 2017

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or just PowerShell for $runtime$ :)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@TravisEz13 Travis Plunk (TravisEz13) Jul 28, 2017

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update to PowerShell Core

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread tools/packaging/project/powershell.nuspec Outdated

@iSazonov Ilya (iSazonov) Jul 28, 2017

Copy link
Copy Markdown
Collaborator

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have #4352 under review - should we use "Microsoft" in community project?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@TravisEz13 Travis Plunk (TravisEz13) Jul 28, 2017

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove microsoft

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
daxian-dbw
Dongbo Wang (daxian-dbw) reviewed Jul 28, 2017
View reviewed changes
Comment thread build.psm1 Outdated

@daxian-dbw Dongbo Wang (daxian-dbw) Jul 28, 2017

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better use the verb Sync, as Get- usually indicates result(s) will be returned while Sync is an action.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread build.psm1 Outdated

@daxian-dbw Dongbo Wang (daxian-dbw) Jul 28, 2017

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about return (git tag --list --sort=-v:refname | Select-Object -First 1)?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@TravisEz13 Travis Plunk (TravisEz13) Jul 28, 2017

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your proposed implementation depends on version sorting.
The code I wrote gets the latest commit which is a tag, then gets the name.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@TravisEz13 Travis Plunk (TravisEz13) Jul 28, 2017

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

discussed offline and git describe --abbrev=0 does what you intended.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread build.psm1 Outdated

@daxian-dbw Dongbo Wang (daxian-dbw) Jul 28, 2017

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo: in -> if

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@TravisEz13 Travis Plunk (TravisEz13) Jul 28, 2017

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread build.psm1 Outdated

@daxian-dbw Dongbo Wang (daxian-dbw) Jul 28, 2017

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

git describe --dirty causes git to crash on my machine. No idea why is that.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@TravisEz13 Travis Plunk (TravisEz13) Jul 28, 2017

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perhaps it could not find the git-dir. I'll update all the commands to specify it.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread tools/packaging/project/powershell.nuspec Outdated

@daxian-dbw Dongbo Wang (daxian-dbw) Jul 28, 2017

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or just PowerShell for $runtime$ :)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread tools/packaging/packaging.psm1 Outdated

@daxian-dbw Dongbo Wang (daxian-dbw) Jul 28, 2017

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: there are trailing spaces in this line.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@TravisEz13 Travis Plunk (TravisEz13) Jul 28, 2017

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#resolved

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread tools/packaging/packaging.psm1 Outdated

@daxian-dbw Dongbo Wang (daxian-dbw) Jul 28, 2017

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: same here.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@TravisEz13 Travis Plunk (TravisEz13) Jul 28, 2017

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#resolved

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread tools/packaging/project/package.csproj Outdated

@daxian-dbw Dongbo Wang (daxian-dbw) Jul 28, 2017

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This description needs to be updated

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@TravisEz13 Travis Plunk (TravisEz13) Jul 28, 2017

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#resloved

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread tools/packaging/project/powershell.nuspec Outdated

@daxian-dbw Dongbo Wang (daxian-dbw) Jul 28, 2017

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PowerShell CLI

Maybe just PowerShell

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@TravisEz13 Travis Plunk (TravisEz13) Jul 28, 2017

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed to PowerShell Core

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread build.psm1 Outdated

@daxian-dbw Dongbo Wang (daxian-dbw) Jul 28, 2017

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we continue to use git describe to get the commit id. It should work as long as we merge the release branch.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@TravisEz13 Travis Plunk (TravisEz13) Jul 28, 2017

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@TravisEz13
Travis Plunk (TravisEz13) force-pushed the AddNugetPackagingV2 branch from 3ab8281 to 4bf60fd Compare July 28, 2017 19:16
Travis Plunk (TravisEz13) added 16 commits July 28, 2017 13:19
@TravisEz13
ignore staging folders
34aa196
@TravisEz13
Add csproj for package of entire CLI
6d249a6
@TravisEz13
add nuspec for package of entire CLI
f8bedca
@TravisEz13
ignore nupkg packages
3bfe9e6
@TravisEz13
Move Get-PackageSemanticVersion to packaging.psm1
8d5b5ee
@TravisEz13
Add ability to package full PowerShell core using nuget
d2b561b
@TravisEz13
change folder in nupkg with PowerShell from tools to content
7976494
@TravisEz13
Add publishing to daily NuGet feed
6ca45e6
@TravisEz13
Give the packages a meaningful version that can be tied back to the C…
b47a933
…I build
@TravisEz13
make sure the CI systems always have the latest tags
8b9a81f
@TravisEz13
Add code to get the various forms of commitId and tag from the proper…
1122f6b
… place
@TravisEz13
update travis to use the build.psm1 code to get the lastest
8b620e6
@TravisEz13
add newline to end of file
de8218b
@TravisEz13
address PR feedback
4ce585b
@TravisEz13
make get-psLatestTag Get latest tag for the current branch
b7902a7
@TravisEz13
make appveyor version consistent with travis-ci
ac6c62a
@TravisEz13
Travis Plunk (TravisEz13) force-pushed the AddNugetPackagingV2 branch from 4bf60fd to ac6c62a Compare July 28, 2017 20:20
Travis Plunk (TravisEz13) added 2 commits July 29, 2017 13:07
@TravisEz13
Address PR Feedback
f65f48d
@TravisEz13
make sure errors are handled correctly for git commands
bfdece5
iSazonov
Ilya (iSazonov) reviewed Jul 30, 2017
View reviewed changes
Comment thread build.psm1
}
elseif(!$upstreamRemote)
{
Write-Error "Please add a remote to PowerShell\PowerShell. Example: git remote add $upstreamRemoteDefaultName $PowerShellRemoteUrl" -ErrorAction Stop

@iSazonov Ilya (iSazonov) Jul 30, 2017

Copy link
Copy Markdown
Collaborator

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we continue to execute the script after the error?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@TravisEz13 Travis Plunk (TravisEz13) Aug 1, 2017

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should not continue executing the script unless you have a remote to PowerShell as the error indicates. The script has always assumed you can fetch the tags. This is just adding a verification.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@TravisEz13 Travis Plunk (TravisEz13) Aug 1, 2017

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should only occur when someone manually runs the function and it cannot complete the action. So, returning an error and stopping is the correct thing to do.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread tools/packaging/project/package.csproj Outdated
-->
<PropertyGroup>
<AssemblyName>NotUsed</AssemblyName>
<Description>PowerShell Core nuget packag with .NET CLI host including everything needed to run it.</Description>

@iSazonov Ilya (iSazonov) Jul 30, 2017

Copy link
Copy Markdown
Collaborator

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo - "packag".

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@TravisEz13
fix typo in package
eeaad46
daxian-dbw
Dongbo Wang (daxian-dbw) approved these changes Aug 1, 2017
View reviewed changes

@daxian-dbw Dongbo Wang (daxian-dbw) left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM except for a minor comment.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread build.psm1
$dotnetCLIRequiredVersion = "2.0.0-preview2-006502"
$tagsUpToDate = $false

function Sync-PSTags

@daxian-dbw Dongbo Wang (daxian-dbw) Aug 1, 2017

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please add a comment to explain why we need to run Sync-PSTags before getting the version (tag) and commit ID? It will help people to understand.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@TravisEz13
add comments for new functions
a9a29db
@daxian-dbw
Dongbo Wang (daxian-dbw) merged commit e829053 into PowerShell:master Aug 1, 2017
@TravisEz13
Travis Plunk (TravisEz13) deleted the AddNugetPackagingV2 branch August 4, 2017 16:11
Thatgfsj (Thatgfsj) pushed a commit to Thatgfsj-contribs/PowerShell that referenced this pull request Aug 6, 2026
@TravisEz13 @daxian-dbw
Add ability to package all of powershell core as a NuGet Package (Pow…
6adfc6a
…erShell#4363)

So that PowerShell can be installed using PackageManagement cmdlets find-package and install-package.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@iSazonov Ilya (iSazonov) iSazonov left review comments
@daxian-dbw Dongbo Wang (daxian-dbw) daxian-dbw approved these changes
@adityapatwardhan Aditya Patwardhan (adityapatwardhan) Awaiting requested review from adityapatwardhan

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@daxian-dbw Dongbo Wang (daxian-dbw)

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@TravisEz13 @daxian-dbw @iSazonov @msftclas
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.