# Set-HostProperty

Sets the current host property.

## Syntax

Set-HostProperty \[-ForegroundColor \<Black | DarkBlue | DarkGreen | DarkCyan | DarkRed | DarkMagenta | DarkYellow | Gray | DarkGray | Blue | Green | Cyan | Red | Magenta | Yellow | White>] \[-BackgroundColor \<Black | DarkBlue | DarkGreen | DarkCyan | DarkRed | DarkMagenta | DarkYellow | Gray | DarkGray | Blue | Green | Cyan | Red | Magenta | Yellow | White>] \[-HostWidth \<Int32>] \[-Persist]

## Detailed Description

Sets the current host property and perssits them for the future if used with -Persist parameter.

© 2010-2019 Adam Najmanowicz, Michael West. All rights reserved. Sitecore PowerShell Extensions

## Parameters

### -ForegroundColor \<ConsoleColor>

Color of the console text.

| Aliases                     |       |
| --------------------------- | ----- |
| Required?                   | false |
| Position?                   | named |
| Default Value               |       |
| Accept Pipeline Input?      | false |
| Accept Wildcard Characters? | false |

### -BackgroundColor \<ConsoleColor>

Color of the console background.

| Aliases                     |       |
| --------------------------- | ----- |
| Required?                   | false |
| Position?                   | named |
| Default Value               |       |
| Accept Pipeline Input?      | false |
| Accept Wildcard Characters? | false |

### -HostWidth \<Int32>

Width of the text buffer (texts longer than the number provided will wrap to the next line.

| Aliases                     |       |
| --------------------------- | ----- |
| Required?                   | false |
| Position?                   | named |
| Default Value               |       |
| Accept Pipeline Input?      | false |
| Accept Wildcard Characters? | false |

### -Persist \<SwitchParameter>

Persist the console setting provided

| Aliases                     |       |
| --------------------------- | ----- |
| Required?                   | false |
| Position?                   | named |
| Default Value               |       |
| Accept Pipeline Input?      | false |
| Accept Wildcard Characters? | false |

## Notes

Help Author: Adam Najmanowicz, Michael West

## Examples

### EXAMPLE 1

Set width of the console buffer to 80 and persist it for the future instances

```powershell
PS master:\> Set-HostProperty -HostWidth 80 -Persist
```

### EXAMPLE 2

Set color of the console text to cyan. Next instance of the console will revert to default (white).

```powershell
PS master:\> Set-HostProperty -ForegroundColor Cyan
```

## Related Topics

* <https://github.com/SitecorePowerShell/Console/>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://doc.sitecorepowershell.com/appendix/common/set-hostproperty.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
