> For the complete documentation index, see [llms.txt](https://docs.devolutions.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.devolutions.net/powershell-universal/da/powershell-kommandoer/new-udcodeeditor.md).

# New-UDCodeEditor

New-UDCodeEditor indlejrer en Monaco-baseret kodeeditor i PowerShell Universal med syntaksfremhævning, temaer og support til diff-sammenligning.

### Synopsis

Opretter et nyt Monaco-kodeeditorkontrolelement.

### Syntaks

```powershell
New-UDCodeEditor [-Id <String>] [-Language <String>] [-Height <String>] [-Width <String>] [-HideCodeLens] [-DisableCodeFolding] [-FormatOnPaste] [-GlyphMargin] [-DisableLineNumbers] [-DisableLinks] [-DisableBracketMatching] [-MouseWheelScrollSensitivity <Int32>] [-MouseWheelZoom] [-ReadOnly] [-RenderControlCharacters] [-ShowFoldingControls <String>] [-SmoothScrolling] [-LightTheme <String>] [-DarkTheme <String>] [-Code <String>] [-Original <String>] [-CanSave] [-Extension <String>] [-HideMiniMap] [<CommonParameters>]

New-UDCodeEditor [-Id <String>] [-Language <String>] [-Height <String>] [-Width <String>] [-Code <String>] [-Original <String>] [-Options <Hashtable>] [-CanSave] [-Extension <String>] [-HideMiniMap] [<CommonParameters>]
```

### Beskrivelse

Opretter et nyt Monaco-kodeeditorkontrolelement.

### Parametre

#### -Id

Id'et for denne editor

```
Required?                    false
Position?                    named
Default value                ([Guid]::NewGuid())
Accept pipeline input?       false
Aliases
Accept wildcard characters?  false
```

#### -Language

Det sprog, der skal bruges til syntaksfremhævning.

```
Required?                    false
Position?                    named
Default value
Accept pipeline input?       false
Aliases
Accept wildcard characters?  false
```

#### -Height

Højden på editoren.

```
Required?                    false
Position?                    named
Default value                100ch
Accept pipeline input?       false
Aliases
Accept wildcard characters?  false
```

#### -Width

Bredden på editoren.

```
Required?                    false
Position?                    named
Default value                100%
Accept pipeline input?       false
Aliases
Accept wildcard characters?  false
```

#### -HideCodeLens

Skjuler code lens i editoren.

```
Required?                    false
Position?                    named
Default value                False
Accept pipeline input?       false
Aliases
Accept wildcard characters?  false
```

#### -DisableCodeFolding

Deaktiverer kodefoldning.

```
Required?                    false
Position?                    named
Default value                False
Accept pipeline input?       false
Aliases
Accept wildcard characters?  false
```

#### -FormatOnPaste

Formaterer ved indsættelse.

```
Required?                    false
Position?                    named
Default value                False
Accept pipeline input?       false
Aliases
Accept wildcard characters?  false
```

#### -GlyphMargin

Angiver størrelsen af glyfmarginen

```
Required?                    false
Position?                    named
Default value                False
Accept pipeline input?       false
Aliases
Accept wildcard characters?  false
```

#### -DisableLineNumbers

Deaktiverer linjenumre

```
Required?                    false
Position?                    named
Default value                False
Accept pipeline input?       false
Aliases
Accept wildcard characters?  false
```

#### -DisableLinks

Deaktiverer automatisk fremhævning af links.

```
Required?                    false
Position?                    named
Default value                False
Accept pipeline input?       false
Aliases
Accept wildcard characters?  false
```

#### -DisableBracketMatching

Deaktiverer parentesmatchning.

```
Required?                    false
Position?                    named
Default value                False
Accept pipeline input?       false
Aliases
Accept wildcard characters?  false
```

#### -MouseWheelScrollSensitivity

Angiver musehjulets rullefølsomhed.

```
Required?                    false
Position?                    named
Default value                1
Accept pipeline input?       false
Aliases
Accept wildcard characters?  false
```

#### -MouseWheelZoom

Aktiverer zoom med Ctrl+Scroll.

```
Required?                    false
Position?                    named
Default value                False
Accept pipeline input?       false
Aliases
Accept wildcard characters?  false
```

#### -ReadOnly

Sætter editoren til skrivebeskyttet.

```
Required?                    false
Position?                    named
Default value                False
Accept pipeline input?       false
Aliases
Accept wildcard characters?  false
```

#### -RenderControlCharacters

Aktiverer gengivelse af kontroltegn.

```
Required?                    false
Position?                    named
Default value                False
Accept pipeline input?       false
Aliases
Accept wildcard characters?  false
```

#### -ShowFoldingControls

Styrer, hvordan foldningskontrollerne vises.

```
Required?                    false
Position?                    named
Default value                mouseover
Accept pipeline input?       false
Aliases
Accept wildcard characters?  false
```

#### -SmoothScrolling

Aktiverer jævn rulning.

```
Required?                    false
Position?                    named
Default value                False
Accept pipeline input?       false
Aliases
Accept wildcard characters?  false
```

#### -LightTheme

Det lyse tema for editoren.

```
Required?                    false
Position?                    named
Default value                vs
Accept pipeline input?       false
Aliases
Accept wildcard characters?  false
```

#### -DarkTheme

Det mørke tema for editoren.

```
Required?                    false
Position?                    named
Default value                vs-dark
Accept pipeline input?       false
Aliases
Accept wildcard characters?  false
```

#### -Code

Den kode, der skal vises i editoren.

```
Required?                    false
Position?                    named
Default value
Accept pipeline input?       false
Aliases
Accept wildcard characters?  false
```

#### -Original

Den oprindelige kode, der skal sammenlignes med.

```
Required?                    false
Position?                    named
Default value
Accept pipeline input?       false
Aliases
Accept wildcard characters?  false
```

#### -Options

En hashtable med indstillinger, der skal anvendes på editoren.

```
Required?                    false
Position?                    named
Default value                @{}
Accept pipeline input?       false
Aliases
Accept wildcard characters?  false
```

#### -CanSave

Om koden kan gemmes.

```
Required?                    false
Position?                    named
Default value                False
Accept pipeline input?       false
Aliases
Accept wildcard characters?  false
```

#### -Extension

Udvidelsen af filen.

```
Required?                    false
Position?                    named
Default value                txt
Accept pipeline input?       false
Aliases
Accept wildcard characters?  false
```

#### -HideMiniMap

Skjuler Monaco-editorens minimap og, i diff-tilstand, diff-oversigtslinealen. Tilgængelig både med standardvalgmulighederne og med parametersættene for hashtabellen `-Options`.

```
Required?                    false
Position?                    named
Default value                False
Accept pipeline input?       false
Aliases
Accept wildcard characters?  false
```

#### Fælles parametre

Denne cmdlet understøtter de fælles parametre: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, WarningVariable, OutBuffer, PipelineVariable og OutVariable. Se [about\_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216) for at få flere oplysninger.

### Output

### Eksempler

#### Eksempel 1: grundlæggende kodeeditor

```powershell
New-UDCodeEditor -Code 'Get-Process' -Theme 'vs-dark' -Language 'powershell' -Id 'codeEditor1'
```

Opretter en PowerShell-kodeeditor

#### Eksempel 2: skrivebeskyttet kodeeditor

```powershell
New-UDCodeEditor -Code 'Get-Process' -Theme 'vs-dark' -Language 'powershell' -Height '200' -Width '100%' -ReadOnly -Id 'codeEditor2'
```

Opretter en skrivebeskyttet PowerShell-kodeeditor

#### Eksempel 3: diff-kodeeditor

```powershell
New-UDCodeEditor -Code "Get-Process notepad" -Original "Get-Process code" -Theme 'vs-dark' -Language 'powershell' -Height '200' -Width '100%' -ReadOnly -Id 'codeEditor3'
```

Opretter en skrivebeskyttet PowerShell-kodeeditor med diff aktiveret


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.devolutions.net/powershell-universal/da/powershell-kommandoer/new-udcodeeditor.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
