aws / aws/aws-elastic-beanstalk-cli-setup
install-python.ps1 doesn't work properly in powershell 7.x.x
- Dominant language
- Python
- Stars
- 537
- Forks
- 226
- PR merge metrics
- No merged PRs in 30d
Description
**1. Please specify the following:**
- OS: Windows 10
- Shell: PowerShell 7.1.3
- [x] **I have reviewed the troubleshooting tips described [here](https://github.com/aws/aws-elastic-beanstalk-cli-setup/blob/master/README.md) and they do not solve my problem**
**2. Description**
Cmdlet `Get-WmiObject` used in function Get-PythonExecutable, is depracated in powershell 7.x and the install-python.ps1 script doesn't retrieve Python executable properly
Affected Cmdlet:
`Get-WmiObject -Namespace "root/cimv2" -Class Win32_Product -Filter "Name Like 'Python 3.7.3 Executables%'"`
Error:
`Get-WmiObject: The term 'Get-WmiObject' is not recognized as a name of a cmdlet, function, script file, or executable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.`
Suggested fix:
Try to change the script using
`Get-CimInstance -Namespace "root/cimv2" -Class Win32_Product -Filter "Name Like 'Python 3.7.3 Executables%'"`
Contributor guide
Research direction
Inspect install-python.ps1, especially Get-PythonExecutable and its Get-WmiObject call. Reproduce the failure under PowerShell 7.1.3 on Windows 10, then verify the script retrieves the Python executable successfully using the requested CIM-based lookup.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- powershell, python
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100