# Send-SheerMessage

Sends a sheer message to the app in which context the script is executing.

## Syntax

```powershell
Send-SheerMessage [-Name] <String> [-Parameters <Hashtable>] [-OnScriptEnd <SwitchParameter>] [<CommonParameters>]

Send-SheerMessage [-Name] <String> [-Parameters <Hashtable>] [<CommonParameters>]

Send-SheerMessage [-Name] <String> [-GetResult <SwitchParameter>] [-Parameters <Hashtable>] [<CommonParameters>]
```

## Detailed Description

Sends a sheer message to the app in which context the script is executing.

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

## Parameters

### -Name \<String>

Name of the Sheer message to execute.

| Aliases                     |                |
| --------------------------- | -------------- |
| Required?                   | true           |
| Position?                   | 1              |
| Default Value               |                |
| Accept Pipeline Input?      | true (ByValue) |
| Accept Wildcard Characters? | false          |

### -GetResult \<SwitchParameter>

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

### -Parameters \<Hashtable>

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

### -OnScriptEnd \<SwitchParameter>

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

## Notes

Help Author: Adam Najmanowicz, Michael West

## Examples

### EXAMPLE

If you execute the following script in the PowerShell ISE the Save dialog will popup

```powershell
Send-SheerMessage -Name 'ise:save'
```

### EXAMPLE

```powershell
$item = $SitecoreContextItem
Send-SheerMessage -OnScriptEnd -Name "item:refresh" -Parameters @{id=&{$item.ID};language=&{$item.Language};version=&{$item.Version}}
Invoke-JavaScript -OnScriptEnd -Script "scForm.invoke('item:refresh(id=$($item.ID),language=$($item.Language),version=$($item.Version))')"

Send-SheerMessage -OnScriptEnd -Name "item:refreshchildren" -Parameters @{id=&{$item.Parent.ID}}
Invoke-JavaScript -OnScriptEnd -Script "scForm.invoke('item:refreshchildren(id=$($item.Parent.ID))')"

Send-SheerMessage -OnScriptEnd -Name "item:refreshchildren" -Parameters @{id=&{$item.ID};language=&{$item.Language};version=&{$item.Version}}
Invoke-JavaScript -OnScriptEnd -Script "scForm.invoke('item:refreshchildren(id=$($item.ID),language=$($item.Language),version=$($item.Version))')"

Close-Window
```

## Related Topics

* [#149](https://github.com/SitecorePowerShell/Console/issues/149)
* [#1340](https://github.com/SitecorePowerShell/Console/issues/1340)


---

# 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/send-sheermessage.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.
