Skip to content

Adds PSU Install Option to Environment#313

Open
JPRuskin wants to merge 2 commits intochocolatey:mainfrom
JPRuskin:psu
Open

Adds PSU Install Option to Environment#313
JPRuskin wants to merge 2 commits intochocolatey:mainfrom
JPRuskin:psu

Conversation

@JPRuskin
Copy link
Copy Markdown
Member

Description Of Changes

Adds Start-C4bPsuSetup.ps1 to the install scripts available in the root of the repository.

Motivation and Context

We have a lot of excellent ideas that we can implement by helping customers utilize PowerShell Universal. We need to have a method for installing everything in that case.

Testing

  1. Download repository
  2. Comment out Jenkins install in initialize script
  3. Run through init script
  4. Manually trigger Start-C4bPsuSetup.ps1 with any args (e.g. thumbprint)

Operating Systems Testing

  • Windows 2022

Change Types Made

  • [ ] Bug fix (non-breaking change).
  • Feature / Enhancement (non-breaking change).
  • [ ] Breaking change (fix or feature that could cause existing functionality to change).
  • [ ] Documentation changes.
  • PowerShell code changes.

Change Checklist

  • [ ] Requires a change to the documentation.
  • [ ] Documentation has been updated.
  • Tests to cover my changes, have been added.
  • All new and existing tests passed?
  • [ ] PowerShell code changes: PowerShell v3 compatibility checked?
  • [ ] All items are complete on the Definition of Done.

JPRuskin added 2 commits March 2, 2026 13:33
This should help us maintain consistency across the codebase.
@JPRuskin JPRuskin requested a review from ryanrichter94 March 31, 2026 15:05
Comment thread Start-C4bPsuSetup.ps1
$ErrorActionPreference = 'Stop'
Start-Transcript -Path "$env:SystemDrive\choco-setup\logs\Start-C4bPsuSetup-$(Get-Date -Format 'yyyyMMdd-HHmmss').txt"

Invoke-Choco upgrade powershelluniversal-remove-default-listener.hook --confirm --no-progress
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Where is this?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why is it ran before PowerShell Universal is installed? What listener is it removing?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

It's a hook package, so (unless written to run on install as well as a hook) it needs to be in place before the main package is installed. Though thinking about it, this one is fine to move to after, we're making the adjustment in the setup script... so I can move it to after. Easy!

The listener it's removing is the http :5000 from one of the multiple configuration files, so that we can use it ourselves (and so that we don't have an additional http listener that we don't want to have available).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If this stays as a package, it will need to be added to the chocolatey.json file for the packages used by the guide.

Comment thread Start-C4bPsuSetup.ps1
Comment thread Start-C4bPsuSetup.ps1
}

# Deploy jobs and dashboards
Invoke-Choco upgrade chocolatey-licensed-psu-environment --confirm --no-progress
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Where is the PR for this?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The chocolatey-licensed-psu-environment package must also be added to the chocolatey.json file. Please link to a PR for this package to review or pull down for testing.

Comment thread Start-C4bPsuSetup.ps1
Comment thread Start-C4bPsuSetup.ps1
Invoke-Choco upgrade powershelluniversal-remove-default-listener.hook --confirm --no-progress

# Install PowerShell Universal
Invoke-Choco upgrade powershelluniversal --confirm --no-progress --install-args="STARTSERVICE=0$(if ($ConnectionString) {" CONNECTIONSTRING=$ConnectionString DATABASETYPE=SQL"})"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The PowerShellUniversal CCR package needs to be added to the chocolatey.json file to enable offline installations.

Comment thread Start-C4bPsuSetup.ps1
$CurrentConfiguration = Get-Content $ConfigurationFile | ConvertFrom-Json

if ($Thumbprint) {
$PSUPort = 5000
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should we allow the individual running the guide to select the TCP port for their PSU instance? If not in this initial PR, an issue should be raised to support this customization in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants