Comments (3)
It seems that $host.UI.RawUI.ForegroundColor
returns null
with this setup.
Lines 72 to 89 in 656e17b
Could you try this modified Write-InstallInfo
function?
function Write-InstallInfo {
param(
[Parameter(Mandatory = $True, Position = 0)]
[String] $String,
[Parameter(Mandatory = $False, Position = 1)]
[System.ConsoleColor] $ForegroundColor = 'Gray'
)
$backup = $host.UI.RawUI.ForegroundColor
if ($null -eq $backup) {
$backup = 'Gray'
}
if ($null -eq $ForegroundColor) {
$ForegroundColor = 'Gray'
}
if ($ForegroundColor -ne $host.UI.RawUI.ForegroundColor) {
$host.UI.RawUI.ForegroundColor = $ForegroundColor
}
Write-Output "$String"
$host.UI.RawUI.ForegroundColor = $backup
}
from install.
Here is the result:
{
"category_info": {
"activity": "Write-InstallInfo",
"category": "NotSpecified",
"category_id": 0,
"reason": "SetValueInvocationException",
"target_name": "",
"target_type": ""
},
"error_details": null,
"exception": {
"help_link": null,
"hresult": -2146233087,
"inner_exception": {
"help_link": null,
"hresult": -2146233087,
"inner_exception": null,
"message": "A command that prompts the user failed because the host program or the command type does not support user interaction. Try a host program that supports user interaction, such as the Windows PowerShell Console or Windows PowerShell ISE, and remove prompt-related commands from command types that do not support user interaction, such as Windows PowerShell workflows.",
"source": "System.Management.Automation",
"type": "System.Management.Automation.Host.HostException"
},
"message": "Exception setting \"ForegroundColor\": \"A command that prompts the user failed because the host program or the command type does not support user interaction. Try a host program that supports user interaction, such as the Windows PowerShell Console or Windows PowerShell ISE, and remove prompt-related commands from command types that do not support user interaction, such as Windows PowerShell workflows.\"",
"source": "System.Management.Automation",
"type": "System.Management.Automation.SetValueInvocationException"
},
"fully_qualified_error_id": "ExceptionWhenSetting,Write-InstallInfo",
"output": "Write-InstallInfo : Exception setting \"ForegroundColor\": \"A command that prompts the user failed because the host \r\nprogram or the command type does not support user interaction. Try a host program that supports user interaction, such \r\nas the Windows PowerShell Console or Windows PowerShell ISE, and remove prompt-related commands from command types that \r\ndo not support user interaction, such as Windows PowerShell workflows.\"\r\nAt C:\\downloads\\scoop\\scoop_install.ps1:561 char:5\r\n+ Write-InstallInfo \"Initializing...\"\r\n+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n + CategoryInfo : NotSpecified: (:) [Write-InstallInfo], SetValueInvocationException\r\n + FullyQualifiedErrorId : ExceptionWhenSetting,Write-InstallInfo\r\n \r\n",
"pipeline_iteration_info": [
0,
1
],
"script_stack_trace": "at Write-InstallInfo, C:\\downloads\\scoop\\scoop_install.ps1: line 89\r\nat Install-Scoop, C:\\downloads\\scoop\\scoop_install.ps1: line 561\r\nat <ScriptBlock>, C:\\downloads\\scoop\\scoop_install.ps1: line 700\r\nat <ScriptBlock>, <No file>: line 2",
"target_object": null
}
from install.
I am also getting this error, to validate the other users bug report.
from install.
Related Issues (20)
- Invoke-Expression: Error HOT 9
- Check target path before installation HOT 5
- sei358
- [Bug] Cannot install Scoop HOT 2
- Check $env:PATH before installation
- Error installing git HOT 2
- Help
- Option for no side effects like updating the system path HOT 1
- Don't abort if already installed
- Abort when failing installation on CI
- Create `.gitignore` file in `scoop` directory
- Add support for other sources of Scoop app and main bucket HOT 2
- https://get.scoop.sh/ is down HOT 1
- Show single quotes in instructions while passing path arguments HOT 3
- [Bug] Installation Failure HOT 2
- installation *seems* to be ok, but many things don't work
- Install fail: Operation did not complete successfully because the file contains a virus or potentially unwanted software. HOT 2
- Failed on installing Scoop HOT 1
- Migrating from Shovel to Scoop HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from install.