8000 Documentation of Meta, Charset and Transitional parameter for ConvertTo-HTML by ergo3114 · Pull Request #1432 · MicrosoftDocs/PowerShell-Docs · GitHub
[go: up one dir, main page]

Skip to content

Documentation of Meta, Charset and Transitional parameter for ConvertTo-HTML #1432

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 31, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 63 additions & 1 deletion reference/6/Microsoft.PowerShell.Utility/ConvertTo-Html.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Converts Microsoft .NET Framework objects into HTML that can be displayed in a W
### Page (Default)
```
ConvertTo-Html [-InputObject <PSObject>] [[-Property] <Object[]>] [[-Body] <String[]>] [[-Head] <String[]>]
[[-Title] <String>] [-As <String>] [-CssUri <Uri>] [-PostContent <String[]>] [-PreContent <String[]>]
[[-Title] <String>] [-As <String>] [-CssUri <Uri>] [-PostContent <String[]>] [-PreContent <String[]>] [-Meta <String[]>] [-Charset <String>] [-Transitional]
[-InformationAction <ActionPreference>] [-InformationVariable <String>] [<CommonParameters>]
```

Expand Down Expand Up @@ -160,6 +160,20 @@ The command uses a redirection operator (\>) to send the output to the Services.

A semicolon (;) ends the first command and starts a second command, which uses the Invoke-Item cmdlet (alias = "ii") to open the Services.htm file in the default browser.

### Example 10: Set the Meta properties and Charset of the HTML
```
PS C:\> Get-Service | ConvertTo-HTML -Meta @{refresh=10;author="Author's Name";keywords="PowerShell, HTML, ConvertTo-HTML"} -Charset "UTF-8"
```

This command creates the HTML for a webpage with the meta tags for refresh, author, and keywords. The charset for the page is set to UTF-9

### Example 10: Set the HTML to XHTML Transitional DTD
```
PS C:\> Get-Service | ConvertTo-HTML -Transitional
```

This command sets the DOCTYPE of the returned HTML to XHTML Transitional DTD

## PARAMETERS

### -As
Expand Down Expand Up @@ -334,6 +348,54 @@ Accept pipeline input: False
Accept wildcard characters: False
```

### -Meta
Specifies text to add to the opening \<meta\> tag.
By default, there is no text in that position.

```yaml
Type: Hashtable
Parameter Sets: (Page)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -Charset
Specifies text to add to the opening \<charset\> tag.
By default, there is no text in that position.

```yaml
Type: String
Parameter Sets: (Page)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -Transitional
Changes the DOCTYPE to XHTML Transitional DTD
Default DOCTYPE is XHTML Strict DTD

```yaml
Type: SwitchParameter
Parameter Sets: Page
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -Property
Includes the specified properties of the objects in the HTML.
The value of the *Property* parameter can be a new calculated property.
Expand Down
0