[Bug] install.ps1 fails via ssh/headless, windows server 2022, ansible
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 55/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Stale
- Tech stack
- powershell
- Domain
- cli
Research direction
Start in install.ps1 at the Write-InstallInfo function and the Install-Scoop call around line 555. Reproduce the failure with PowerShell 5.1 on Windows Server 2022 through SSH or a headless session, then verify installation completes without the ForegroundColor exception and that normal terminal output still works.
Written by the indexing model from the issue text.
Description
Bug Report
Current Behavior
Install script fails due to color arguments in the script.
Error message:
{
"changed": true,
"debug": [],
"error": [
{
"category_info": {
"activity": "Write-InstallInfo",
"category": "InvalidData",
"category_id": 6,
"reason": "ParentContainsErrorRecordException",
"target_name": "",
"target_type": ""
},
"error_details": null,
"exception": {
"help_link": null,
"hresult": -2146233087,
"inner_exception": null,
"message": "Cannot process argument transformation on parameter 'ForegroundColor'. Cannot convert null to type \"System.ConsoleColor\" due to enumeration values that are not valid. Specify one of the following enumeration values and try again. The possible enumeration values are \"Black,DarkBlue,DarkGreen,DarkCyan,DarkRed,DarkMagenta,DarkYellow,Gray,DarkGray,Blue,Green,Cyan,Red,Magenta,Yellow,White\".",
"source": null,
"type": "System.Management.Automation.ParentContainsErrorRecordException"
},
"fully_qualified_error_id": "ParameterArgumentTransformationError,Write-InstallInfo",
"output": "Write-InstallInfo : Cannot process argument transformation on parameter 'ForegroundColor'. Cannot convert null to type \r\n\"System.ConsoleColor\" due to enumeration values that are not valid. Specify one of the following enumeration values and \r\ntry again. The possible enumeration values are \"Black,DarkBlue,DarkGreen,DarkCyan,DarkRed,DarkMagenta,DarkYellow,Gray,Da\r\nrkGray,Blue,Green,Cyan,Red,Magenta,Yellow,White\".\r\nAt C:\\downloads\\scoop\\install.ps1:555 char:5\r\n+ Write-InstallInfo (\"Initializing...\")\r\n+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n + CategoryInfo : InvalidData: (:) [Write-InstallInfo], ParentContainsErrorRecordException\r\n + FullyQualifiedErrorId : ParameterArgumentTransformationError,Write-InstallInfo\r\n \r\n",
"pipeline_iteration_info": [],
"script_stack_trace": "at Install-Scoop, C:\\downloads\\scoop\\install.ps1: line 555\r\nat <ScriptBlock>, C:\\downloads\\scoop\\install.ps1: line 694\r\nat <ScriptBlock>, <No file>: line 2",
"target_object": null
}
],
"host_err": "",
"host_out": "",
"information": [],
"output": [],
"result": {},
"verbose": [],
"warning": []
}
Expected Behavior
Not to throw this exception.
Additional context/output
Possible Solution
I worked around this by removing the terminal color code in the Write-InstallInfo function of the install script.
System details
Windows version: Server 2022
OS architecture: 64bit
PowerShell version: 5.1
- Dominant language
- PowerShell
- Stars
- 1.3k
- Forks
- 155
- Avg merge
- 5h 24m
- Merged PRs (30d)
- 4
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from ScoopInstaller/Install
-
Difficulty 3/5 1-2 days Newbie friendliness 65/100
ScoopInstaller/Install#139 · 1 comment ·
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
ScoopInstaller/Install#130 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
ScoopInstaller/Install#112 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 30/100
ScoopInstaller/Install#108 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
ScoopInstaller/Install#95 · 1 comment ·
All issues in ScoopInstaller/Install
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
kwakseongjae/auto-hwp#319 ·
-
area:cli bug filter-quality good first issue priority:medium
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
AvengeMedia/DankMaterialShell#3523 ·
-
comp/cli comp/cron P3 type/bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
NousResearch/hermes-agent#117433 · 2 comments ·