Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install PowerShell7 resource #417

Open
SteveL-MSFT opened this issue Apr 22, 2024 · 4 comments
Open

Install PowerShell7 resource #417

SteveL-MSFT opened this issue Apr 22, 2024 · 4 comments
Labels
Issue-Enhancement The issue is a feature or idea Needs Triage

Comments

@SteveL-MSFT
Copy link
Member

Summary of the new feature / enhancement

A resource that simply installs PowerShell7 (if not already installed, so test should be implemented probably). This solves some bootstrapping scenarios and only require dsc to then get PS7. This would be cross-platform abstracting install of msi/appx/rpm/deb/brew. On non-Windows, it would need to be a Bash script while on Windows, we could still rely on Windows PowerShell.

What we don't support is a way (without an exe) to call different scripts based on the OS. So we either need a small exe that just calls a script appropriate for the OS or add a capability in the resource manifest to do different commands based on the OS (seems like the latter would create more problems to handle many edge cases).

Proposed technical implementation details (optional)

No response

@SteveL-MSFT SteveL-MSFT added Issue-Enhancement The issue is a feature or idea Needs Triage labels Apr 22, 2024
@michaeltlombardi
Copy link
Collaborator

I would prefer that DSC not try to handle multi-platform behavior from the manifest, both because is can lead to substantially more complicated manifests and edge case errors, and because I think the better practice and pattern is to use a small executable to select the correct shell script.

Should this resource handle versions, or just always grab the latest stable release? Are there other considerations to account for in the install, like path, or should it just use the defaults?

@SteveL-MSFT
Copy link
Member Author

Was thinking about this and if this resource ships with DSC, then the individual packages (Windows, Linux, macOS) would have their own versions so we don't need to dynamically choose and ship all OS support to every OS. Basically the choice would be in our build process dependent on the host OS.

I think we want channel support (stable, preview, and LTS) but always the latest and probably not support specific version (we can revisit in the future). Initial scenario is for bootstrapping a VM, so we can defer scope (currentUser, allUsers) later.

@kilasuit
Copy link

Could this not make use of the install-powershell scripts in the PowerShell repo?

@SteveL-MSFT
Copy link
Member Author

Could this not make use of the install-powershell scripts in the PowerShell repo?

Those scripts were designed for our CI system when PS7 wasn't readily available so not ever intended to be used outside of that environment. At this time, it's probably easier to write the resource from scratch to be honest.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Enhancement The issue is a feature or idea Needs Triage
Projects
None yet
Development

No branches or pull requests

3 participants