Skip to content

Commit 7deeb2c

Browse files
author
luchaoqiu
committed
Add cmdlet docs for font package operations
1 parent 56ed102 commit 7deeb2c

File tree

4 files changed

+490
-0
lines changed

4 files changed

+490
-0
lines changed
Lines changed: 166 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,166 @@
1+
---
2+
external help file: Microsoft.Online.SharePoint.PowerShell.dll-Help.xml
3+
Module Name: Microsoft.Online.SharePoint.PowerShell
4+
online version: https://learn.microsoft.com/powershell/module/sharepoint-online/add-spofontpackage
5+
applicable: SharePoint Online
6+
title: Add-SPOFontPackage
7+
schema: 2.0.0
8+
author: luchaoqiu
9+
ms.author: luchaoqiu
10+
ms.reviewer:
11+
---
12+
13+
# Add-SPOFontPackage
14+
15+
## SYNOPSIS
16+
17+
Creates a new custom font package with fonts in the brand fonts library.
18+
19+
## SYNTAX
20+
21+
```
22+
Add-SPOFontPackage -Title <String> -PackageJson <String> [-IsHidden <Boolean>] [<CommonParameters>]
23+
```
24+
25+
## DESCRIPTION
26+
27+
The `Add-SPOFontPackage` cmdlet creates a new brand font package for the SharePoint tenant. Each font package must have a unique name. The font file must be added to the SharePoint Brand Center before creating a font package. For more information, see [Brand Fonts](https://learn.microsoft.com/sharepoint/brand-fonts).
28+
29+
## EXAMPLES
30+
31+
### EXAMPLE 1
32+
33+
```powershell
34+
$packageJson = @'
35+
{
36+
"fontFaces": [
37+
{
38+
"fontFamily": "Tahoma",
39+
"path": "Tahoma.ttf",
40+
"fontType": "contentFont"
41+
}
42+
],
43+
"fontSlots": {
44+
"title": {
45+
"fontFamily": "Tahoma",
46+
"fontFace": "Regular",
47+
"fontVariationSettings": {
48+
"wght": 100,
49+
"wdth": 100
50+
}
51+
},
52+
"heading": {
53+
"fontFamily": "Tahoma",
54+
"fontFace": "Regular",
55+
"fontVariationSettings": {
56+
"wght": 100,
57+
"wdth": 100
58+
}
59+
},
60+
"body": {
61+
"fontFamily": "Tahoma",
62+
"fontFace": "Regular",
63+
"fontVariationSettings": {
64+
"wght": 100,
65+
"wdth": 100
66+
}
67+
},
68+
"label": {
69+
"fontFamily": "Tahoma",
70+
"fontFace": "Regular",
71+
"fontVariationSettings": {
72+
"wght": 100,
73+
"wdth": 100
74+
}
75+
}
76+
}
77+
}
78+
'@
79+
80+
Add-SPOFontPackage -Title "Tahoma" -PackageJson $packageJson
81+
```
82+
83+
This example creates a new font package named "Tahoma" with specified JSON configuration.
84+
85+
### EXAMPLE 2
86+
87+
```powershell
88+
# With $packageJson from EXAMPLE 1
89+
Add-SPOFontPackage -Title "Contoso Font Package" -PackageJson $packageJson -IsHidden $true
90+
```
91+
92+
This example creates a hidden font package with specified JSON configuration.
93+
94+
## PARAMETERS
95+
96+
### -Title
97+
98+
> Applicable: SharePoint Online
99+
100+
Specifies the display name of the new font package.
101+
102+
```yaml
103+
Type: System.String
104+
Parameter Sets: (All)
105+
Aliases:
106+
107+
Required: True
108+
Position: Named
109+
Default value: None
110+
Accept pipeline input: False
111+
Accept wildcard characters: False
112+
```
113+
114+
### -PackageJson
115+
116+
> Applicable: SharePoint Online
117+
118+
Specifies the JSON configuration for the font package.
119+
120+
```yaml
121+
Type: System.String
122+
Parameter Sets: (All)
123+
Aliases:
124+
125+
Required: True
126+
Position: Named
127+
Default value: None
128+
Accept pipeline input: False
129+
Accept wildcard characters: False
130+
```
131+
132+
### -IsHidden
133+
134+
> Applicable: SharePoint Online
135+
136+
Specifies whether the font package should be hidden from users. When set to $true, the font package will not be visible in the **Change the look** options, but can still be applied using the `Set-SPOFontPackage` cmdlet.
137+
138+
```yaml
139+
Type: System.Boolean
140+
Parameter Sets: (All)
141+
Aliases:
142+
143+
Required: False
144+
Position: Named
145+
Default value: False
146+
Accept pipeline input: True (ByValue)
147+
Accept wildcard characters: False
148+
```
149+
150+
### CommonParameters
151+
152+
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216).
153+
154+
## OUTPUTS
155+
156+
### System.Object
157+
158+
## NOTES
159+
160+
## RELATED LINKS
161+
162+
[Get-SPOFontPackage](Get-SPOFontPackage.md)
163+
164+
[Set-SPOFontPackage](Set-SPOFontPackage.md)
165+
166+
[Remove-SPOFontPackage](Remove-SPOFontPackage.md)
Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
---
2+
external help file: Microsoft.Online.SharePoint.PowerShell.dll-Help.xml
3+
Module Name: Microsoft.Online.SharePoint.PowerShell
4+
online version: https://learn.microsoft.com/powershell/module/sharepoint-online/get-spofontpackage
5+
applicable: SharePoint Online
6+
title: Get-SPOFontPackage
7+
schema: 2.0.0
8+
author: luchaoqiu
9+
ms.author: luchaoqiu
10+
ms.reviewer:
11+
---
12+
13+
# Get-SPOFontPackage
14+
15+
## SYNOPSIS
16+
17+
Returns one or all custom font packages from the SharePoint tenant.
18+
19+
## SYNTAX
20+
21+
```
22+
Get-SPOFontPackage [[-Identity] <SPOFontPackagePipeBind>] [<CommonParameters>]
23+
```
24+
25+
## DESCRIPTION
26+
27+
The `Get-SPOFontPackage` cmdlet retrieves one or more custom font packages from the SharePoint tenant. Custom font packages include those created through the SharePoint Brand Center app or by using the `Add-SPOFontPackage` cmdlet. You can retrieve a specific font package by providing its identity, or retrieve all font packages if no identity is specified.
28+
29+
Font packages contain custom typography definitions that can be applied to SharePoint sites and Viva Connections for branding purposes.
30+
31+
After running this cmdlet, the information for each font package will be displayed with the following properties:
32+
33+
| Property | Type | Description |
34+
| :---------- | :----- | :------------------------------------------------------|
35+
| ID | Guid | Unique ID of the font package. |
36+
| Title | string | The display name of the font package. |
37+
| IsHidden | bool | Whether the font package is hidden from the SharePointUI. |
38+
| IsValid | bool | Whether the font package is valid and can be applied. |
39+
| PackageJson | string | The JSON specifying the settings of the font package. |
40+
41+
## EXAMPLES
42+
43+
### EXAMPLE 1
44+
45+
```powershell
46+
Get-SPOFontPackage
47+
```
48+
49+
This example returns all font packages in the tenant.
50+
51+
### EXAMPLE 2
52+
53+
```powershell
54+
Get-SPOFontPackage -Identity 12345678-1234-1234-1234-123456789012
55+
```
56+
57+
This example returns the font package with the specified GUID.
58+
59+
### EXAMPLE 3
60+
61+
```powershell
62+
Get-SPOFontPackage | Where-Object {$_.IsHidden -eq $false}
63+
```
64+
65+
This example returns all visible font packages (not hidden).
66+
67+
### EXAMPLE 4
68+
69+
```powershell
70+
$fontPackage = Get-SPOFontPackage -Identity 12345678-1234-1234-1234-123456789012
71+
$fontPackage.PackageJson
72+
```
73+
74+
This example retrieves a specific font package and displays its JSON configuration.
75+
76+
## PARAMETERS
77+
78+
### -Identity
79+
80+
> Applicable: SharePoint Online
81+
82+
Specifies the identity of the font package to retrieve. This can be the ID (GUID) of the font package, or a font package object. If not specified, all font packages will be retrieved.
83+
84+
```yaml
85+
Type: Microsoft.Online.SharePoint.PowerShell.SPOFontPackagePipeBind
86+
Parameter Sets: (All)
87+
Aliases:
88+
89+
Required: False
90+
Position: 0
91+
Default value: None
92+
Accept pipeline input: True (ByValue)
93+
Accept wildcard characters: False
94+
```
95+
96+
### CommonParameters
97+
98+
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216).
99+
100+
## INPUTS
101+
102+
### Microsoft.Online.SharePoint.PowerShell.SPOFontPackagePipeBind
103+
104+
## OUTPUTS
105+
106+
### System.Object
107+
108+
## NOTES
109+
110+
## RELATED LINKS
111+
112+
[Add-SPOFontPackage](Add-SPOFontPackage.md)
113+
114+
[Set-SPOFontPackage](Set-SPOFontPackage.md)
115+
116+
[Remove-SPOFontPackage](Remove-SPOFontPackage.md)
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
---
2+
external help file: Microsoft.Online.SharePoint.PowerShell.dll-Help.xml
3+
Module Name: Microsoft.Online.SharePoint.PowerShell
4+
online version: https://learn.microsoft.com/powershell/module/sharepoint-online/remove-spofontpackage
5+
applicable: SharePoint Online
6+
title: Remove-SPOFontPackage
7+
schema: 2.0.0
8+
author: luchaoqiu
9+
ms.author: luchaoqiu
10+
ms.reviewer:
11+
---
12+
13+
# Remove-SPOFontPackage
14+
15+
## SYNOPSIS
16+
17+
Removes a brand font package from the SharePoint tenant.
18+
19+
## SYNTAX
20+
21+
```
22+
Remove-SPOFontPackage [-Identity] <SPOFontPackagePipeBind> [<CommonParameters>]
23+
```
24+
25+
## DESCRIPTION
26+
27+
The `Remove-SPOFontPackage` cmdlet removes a custom font package from the SharePoint tenant. After removal, the font package will no longer be available for use on SharePoint sites or Viva Connections.
28+
29+
> [!NOTE]
30+
> Removing a font package does not delete the associated brand font files. Pages that already use the removed font package will continue to display the configured fonts, but you will no longer be able to modify the font package settings.
31+
32+
## EXAMPLES
33+
34+
### EXAMPLE 1
35+
36+
```powershell
37+
Remove-SPOFontPackage -Identity 12345678-1234-1234-1234-123456789012
38+
```
39+
40+
This example removes the font package with the specified GUID.
41+
42+
### EXAMPLE 2
43+
44+
```powershell
45+
$fontPackage = Get-SPOFontPackage -Identity 12345678-1234-1234-1234-123456789012
46+
Remove-SPOFontPackage -Identity $fontPackage
47+
```
48+
49+
This example retrieves a font package and then removes it.
50+
51+
### EXAMPLE 3
52+
53+
```powershell
54+
Get-SPOFontPackage | Where-Object {$_.IsHidden -eq $true} | Remove-SPOFontPackage
55+
```
56+
57+
This example removes all hidden font packages from the SharePoint tenant.
58+
59+
## PARAMETERS
60+
61+
### -Identity
62+
63+
> Applicable: SharePoint Online
64+
65+
Specifies the identity of the font package to remove. This can be the ID (GUID) of the font package, or a font package object.
66+
67+
```yaml
68+
Type: Microsoft.Online.SharePoint.PowerShell.SPOFontPackagePipeBind
69+
Parameter Sets: (All)
70+
Aliases:
71+
72+
Required: True
73+
Position: 0
74+
Default value: None
75+
Accept pipeline input: True (ByValue)
76+
Accept wildcard characters: False
77+
```
78+
79+
### CommonParameters
80+
81+
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216).
82+
83+
## INPUTS
84+
85+
### Microsoft.Online.SharePoint.PowerShell.SPOFontPackagePipeBind
86+
87+
## OUTPUTS
88+
89+
### None
90+
91+
## NOTES
92+
93+
## RELATED LINKS
94+
95+
[Add-SPOFontPackage](Add-SPOFontPackage.md)
96+
97+
[Get-SPOFontPackage](Get-SPOFontPackage.md)
98+
99+
[Set-SPOFontPackage](Set-SPOFontPackage.md)

0 commit comments

Comments
 (0)