> For the complete documentation index, see [llms.txt](https://doc.sitecorepowershell.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.sitecorepowershell.com/appendix/presentation/set-layout.md).

# Set-Layout

Sets item layout for a device.

## Syntax

```powershell
Set-Layout [-Item] <Item> -Device <DeviceItem> [-Layout <Item>] [-FinalLayout] [-Language <String[]>]

Set-Layout [-Path] <String> -Device <DeviceItem> [-Layout <Item>] [-FinalLayout] [-Language <String[]>]

Set-Layout -Id <String> [-Database <String>] -Device <DeviceItem> [-Layout <Item>] [-FinalLayout] [-Language <String[]>]
```

## Detailed Description

Sets item layout for a specific device provided

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

## Parameters

### -Device \<DeviceItem>

Device for which to set layout.

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

### -Layout \<Item>

Sitecore item defining the layout.

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

### -FinalLayout \<SwitchParameter>

Targets the Final Layout. If not provided, the Shared Layout will be targeted. Applies to Sitecore 8.0 and higher only.

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

### -Language \<String\[]>

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

### -Item \<Item>

The item to be processed.

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

### -Path \<String>

Path to the item to be processed - can work with Language parameter to narrow the publication scope.

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

### -Id \<String>

Id of the item to be processed - can work with Language parameter to narrow the publication scope.

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

### -Database \<String>

Database containing the item to be processed - can work with Language parameter to narrow the publication scope.

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

## Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

* Sitecore.Data.Items.Item

## Notes

Help Author: Adam Najmanowicz, Michael West

## Examples

### EXAMPLE 1

```powershell
# where my test page will go
$path = 'master:\content\Sample'

# wipe and re-create it if exists
if(Test-Path $path){
    Remove-Item $path
}
$item = New-Item -Path $path -ItemType "Sample/Sample Item"

# select default layout
$device = Get-LayoutDevice -Default

# and a layout we will change to
$layout = Get-Item -Path 'master:\layout\Layouts\System\Simulated Device Layout'

# change the layout from what is in Standard values to the new one.
Set-Layout -Item $item -Device $device -Layout $layout | Out-Null

# verify
Get-Layout $item  
```

## Related Topics

* <https://github.com/SitecorePowerShell/Console/>
* [Add-Rendering](/appendix/presentation/add-rendering.md)
* [New-Rendering](/appendix/presentation/new-rendering.md)
* [Set-Rendering](/appendix/presentation/set-rendering.md)
* [Get-Rendering](/appendix/presentation/get-rendering.md)
* [Get-LayoutDevice](/appendix/presentation/get-layoutdevice.md)
* [Remove-Rendering](/appendix/presentation/remove-rendering.md)
* [Get-Layout](/appendix/presentation/get-layout.md)
* [Reset-Layout](/appendix/presentation/reset-layout.md)
* [#579](https://github.com/SitecorePowerShell/Console/issues/579)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://doc.sitecorepowershell.com/appendix/presentation/set-layout.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
