Adds PSU Install Option to Environment#313
Conversation
| $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 |
There was a problem hiding this comment.
Why is it ran before PowerShell Universal is installed? What listener is it removing?
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
If this stays as a package, it will need to be added to the chocolatey.json file for the packages used by the guide.
There was a problem hiding this comment.
Why is this a package? This seems to be an unnecessarily complex way to solve this. I strongly suggest we look to do this as part of installing PSU in the setup script, and avoid making yet another package.
This should help us maintain consistency across the codebase.
3126c79 to
9c58097
Compare
ryanrichter94
left a comment
There was a problem hiding this comment.
Internal Error when running PSU setup script.
| $null = New-Item -Path $RepositoryDirectory\.universal\settings.ps1 -Value @' | ||
| $Parameters = @{ | ||
| EnhancedAppTokenSecurity = $true | ||
| ApiSecurityModel = $true |
There was a problem hiding this comment.
Start-C4bPsuSetup hung after successfully installing the chocolatey-licensed-psu-environment package. Started digging into logs
Got the following error in this log file C:\ProgramData\PowerShellUniversal\Logs\User
[15:21:33 ERR][Configuration][settings.ps1] Error deserializing C:\ProgramData\UniversalAutomation\Repository\.universal\settings.ps1. Cannot bind parameter 'ApiSecurityModel'. Cannot convert value "True" to type "PowerShellUniversal.ApiSecurityModel". Error: "Invalid cast from 'System.Boolean' to 'PowerShellUniversal.ApiSecurityModel'."
Removed the ApiSecurityModel section from the mentioned settings.ps1 in the error, and restarted the PowerShell Universal Windows Service. Was then presented with the first-run page when browsing to https://hostname:5000, with options to log in via a Devolutions account or perform initial setup.
ryanrichter94
left a comment
There was a problem hiding this comment.
Questions around when we invoke the c4b-enviornment.powershell package install.
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
Operating Systems Testing
Change Types Made
[ ] Bug fix (non-breaking change).[ ] Breaking change (fix or feature that could cause existing functionality to change).[ ] Documentation changes.Change Checklist
[ ] Requires a change to the documentation.[ ] Documentation has been updated.[ ] PowerShell code changes: PowerShell v3 compatibility checked?[ ] All items are complete on the Definition of Done.