Skip to content

Commit 16d3f92

Browse files
committed
Renaming Font to FontPackage
1 parent 50317a2 commit 16d3f92

9 files changed

+50
-50
lines changed

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
6565
- Added the ability to `Get-PnPPage` to return all site pages in the site by omitting the `-Identity` parameter [#4805](https://github.com/pnp/powershell/pull/4805)
6666
- Added `Copy-PnPPage`, `Move-PnPPage` and `Get-PnPPageCopyProgress` cmdlets to allow for copying and moving site pages between sites [#4806](https://github.com/pnp/powershell/pull/4806)
6767
- Added `Get-PnPBrandCenterConfig` to retrieve the configuration of the Brand Center on the tenant [#4830](https://github.com/pnp/powershell/pull/4830)
68-
- Added `Get-PnPBrandCenterFont` to retrieve the available fonts from the various Brand Centers [#4830](https://github.com/pnp/powershell/pull/4830)
69-
- Added `Use-PnPBrandCenterFont` to apply the specified font from the Brand Center to the current site [#4830](https://github.com/pnp/powershell/pull/4830)
68+
- Added `Get-PnPBrandCenterFontPackage` to retrieve the available font packages from the various Brand Centers [#4830](https://github.com/pnp/powershell/pull/4830)
69+
- Added `Use-PnPBrandCenterFontPackage` to apply the specified font package from the Brand Center to the current site [#4830](https://github.com/pnp/powershell/pull/4830)
7070
- Added `Add-PnPBrandCenterFont` to upload a font to the tenant Brand Center [#4830](https://github.com/pnp/powershell/pull/4830)
7171

7272
### Changed

documentation/Get-PnPBrandCenterFont.md renamed to documentation/Get-PnPBrandCenterFontPackage.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
Module Name: PnP.PowerShell
33
schema: 2.0.0
44
applicable: SharePoint Online
5-
online version: https://pnp.github.io/powershell/cmdlets/Get-PnPBrandCenterFont.html
5+
online version: https://pnp.github.io/powershell/cmdlets/Get-PnPBrandCenterFontPackage.html
66
external help file: PnP.PowerShell.dll-Help.xml
7-
title: Get-PnPBrandCenterFont
7+
title: Get-PnPBrandCenterFontPackage
88
---
99

10-
# Get-PnPBrandCenterFont
10+
# Get-PnPBrandCenterFontPackage
1111

1212
## SYNOPSIS
1313
Returns the available fonts configured throught heBrand Center
@@ -16,12 +16,12 @@ Returns the available fonts configured throught heBrand Center
1616

1717
### All
1818
```powershell
19-
Get-PnPBrandCenterFont [-Store <Tenant|OutOfBox|Site|All>] [-Connection <PnPConnection>]
19+
Get-PnPBrandCenterFontPackage [-Store <Tenant|OutOfBox|Site|All>] [-Connection <PnPConnection>]
2020
```
2121

2222
### Single
2323
```powershell
24-
Get-PnPBrandCenterFont -Identity <BrandCenterFontPipeBind> [-Store <Tenant|OutOfBox|Site|All>] [-Connection <PnPConnection>]
24+
Get-PnPBrandCenterFontPackage -Identity <BrandCenterFontPipeBind> [-Store <Tenant|OutOfBox|Site|All>] [-Connection <PnPConnection>]
2525
```
2626

2727
## DESCRIPTION
@@ -31,28 +31,28 @@ Allows retrieval of the available fonts from the various Brand Centers.
3131

3232
### EXAMPLE 1
3333
```powershell
34-
Get-PnPBrandCenterFont
34+
Get-PnPBrandCenterFontPackage
3535
```
3636

3737
Returns all the available fonts
3838

3939
### EXAMPLE 2
4040
```powershell
41-
Get-PnPBrandCenterFont -Store Site
41+
Get-PnPBrandCenterFontPackage -Store Site
4242
```
4343

4444
Returns the available fonts from the site collection Brand Center
4545

4646
### EXAMPLE 3
4747
```powershell
48-
Get-PnPBrandCenterFont -Identity "My awesome font"
48+
Get-PnPBrandCenterFontPackage -Identity "My awesome font"
4949
```
5050

5151
Looks up and returns the font with the name "My awesome font" from any of the Brand Centers
5252

5353
### EXAMPLE 4
5454
```powershell
55-
Get-PnPBrandCenterFont -Identity "2812cbd8-7176-4e45-8911-6a063f89a1f1"
55+
Get-PnPBrandCenterFontPackage -Identity "2812cbd8-7176-4e45-8911-6a063f89a1f1"
5656
```
5757

5858
Looks up and returns the font with the Identity "2812cbd8-7176-4e45-8911-6a063f89a1f1" from any of the Brand Centers

documentation/Use-PnPBrandCenterFont.md renamed to documentation/Use-PnPBrandCenterFontPackage.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,20 @@
22
Module Name: PnP.PowerShell
33
schema: 2.0.0
44
applicable: SharePoint Online
5-
online version: https://pnp.github.io/powershell/cmdlets/Use-PnPBrandCenterFont.html
5+
online version: https://pnp.github.io/powershell/cmdlets/Use-PnPBrandCenterFontPackage.html
66
external help file: PnP.PowerShell.dll-Help.xml
7-
title: Use-PnPBrandCenterFont
7+
title: Use-PnPBrandCenterFontPackage
88
---
99

10-
# Use-PnPBrandCenterFont
10+
# Use-PnPBrandCenterFontPackage
1111

1212
## SYNOPSIS
1313
Applies the specified font from the Brand Center to the current site.
1414

1515
## SYNTAX
1616

1717
```powershell
18-
Use-PnPBrandCenterFont -Identity <BrandCenterFontPipeBind> [-Store <Tenant|OutOfBox|Site|All>] [-Connection <PnPConnection>]
18+
Use-PnPBrandCenterFontPackage -Identity <BrandCenterFontPipeBind> [-Store <Tenant|OutOfBox|Site|All>] [-Connection <PnPConnection>]
1919
```
2020

2121
## DESCRIPTION
@@ -25,14 +25,14 @@ Applies the specified font from the Brand Center to the current site.
2525

2626
### EXAMPLE 1
2727
```powershell
28-
Use-PnPBrandCenterFont -Identity "2812cbd8-7176-4e45-8911-6a063f89a1f1"
28+
Use-PnPBrandCenterFontPackage -Identity "2812cbd8-7176-4e45-8911-6a063f89a1f1"
2929
```
3030

3131
Looks up and applies the font with the identity "2812cbd8-7176-4e45-8911-6a063f89a1f1" from any of the Brand Centers to the current site
3232

3333
### EXAMPLE 2
3434
```powershell
35-
Use-PnPBrandCenterFont -Identity "My awesome font" -Store Tenant
35+
Use-PnPBrandCenterFontPackage -Identity "My awesome font" -Store Tenant
3636
```
3737

3838
Looks up and applies the font with the title "My awesome font" from the tenant Brand Center

src/Commands/Base/Completers/BrandCenterFontCompleter.cs renamed to src/Commands/Base/Completers/BrandCenterFontPackageCompleter.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88

99
namespace PnP.PowerShell.Commands.Base.Completers
1010
{
11-
public sealed class BrandCenterFontCompleter : PnPArgumentCompleter
11+
public sealed class BrandCenterFontPackageCompleter : PnPArgumentCompleter
1212
{
1313
protected override IEnumerable<CompletionResult> GetArguments(string commandName, string parameterName, string wordToComplete, CommandAst commandAst, IDictionary fakeBoundParameters)
1414
{
1515
ClientContext.Web.EnsureProperty(w => w.Url);
16-
var fonts = BrandCenterUtility.GetFonts(null, ClientContext, ClientContext.Web.Url);
16+
var fonts = BrandCenterUtility.GetFontPackages(null, ClientContext, ClientContext.Web.Url);
1717
return fonts.Select(font => new CompletionResult(font.Title)).OrderBy(ct => ct.CompletionText);
1818
}
1919
}

src/Commands/Base/PipeBinds/BrandCenterFontPipeBind.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,12 @@ public Font GetFont(BasePSCmdlet cmdlet, ClientContext clientContext, string web
5454
}
5555
else if (_id.HasValue)
5656
{
57-
_font = BrandCenterUtility.GetFontById(cmdlet, clientContext, _id.Value, webUrl, store);
57+
_font = BrandCenterUtility.GetFontPackageById(cmdlet, clientContext, _id.Value, webUrl, store);
5858
return _font;
5959
}
6060
else if (!string.IsNullOrEmpty(_title))
6161
{
62-
_font = BrandCenterUtility.GetFontByTitle(cmdlet, clientContext, _title, webUrl, store);
62+
_font = BrandCenterUtility.GetFontPackageByTitle(cmdlet, clientContext, _title, webUrl, store);
6363
return _font;
6464
}
6565
return null;

src/Commands/Branding/GetBrandCenterFont.cs renamed to src/Commands/Branding/GetBrandCenterFontPackage.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,16 @@
88

99
namespace PnP.PowerShell.Commands.Branding
1010
{
11-
[Cmdlet(VerbsCommon.Get, "PnPBrandCenterFont", DefaultParameterSetName = ParameterSet_ALL)]
11+
[Cmdlet(VerbsCommon.Get, "PnPBrandCenterFontPackage", DefaultParameterSetName = ParameterSet_ALL)]
1212
[OutputType(typeof(Font), ParameterSetName = new[] { ParameterSet_SINGLE })]
1313
[OutputType(typeof(IEnumerable<Font>), ParameterSetName = new[] { ParameterSet_ALL })]
14-
public class GetBrandCenterFont : PnPWebCmdlet
14+
public class GetBrandCenterFontPackage : PnPWebCmdlet
1515
{
1616
private const string ParameterSet_SINGLE = "Single";
1717
private const string ParameterSet_ALL = "All";
1818

1919
[Parameter(Mandatory = true, Position = 0, ValueFromPipeline = true, ParameterSetName = ParameterSet_SINGLE)]
20-
[ArgumentCompleter(typeof(BrandCenterFontCompleter))]
20+
[ArgumentCompleter(typeof(BrandCenterFontPackageCompleter))]
2121
public BrandCenterFontPipeBind Identity { get; set; }
2222

2323
[Parameter(Mandatory = false, ParameterSetName = ParameterSet_SINGLE)]
@@ -35,7 +35,7 @@ protected override void ExecuteCmdlet()
3535
}
3636
else
3737
{
38-
WriteObject(BrandCenterUtility.GetFonts(this, ClientContext, CurrentWeb.Url, Store), true);
38+
WriteObject(BrandCenterUtility.GetFontPackages(this, ClientContext, CurrentWeb.Url, Store), true);
3939
}
4040
}
4141
}

src/Commands/Branding/SetBrandCenterFont.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ namespace PnP.PowerShell.Commands.Files
1212
public class SetBrandCenterFont : PnPWebCmdlet
1313
{
1414
[Parameter(Mandatory = true, Position = 0, ValueFromPipeline = true)]
15-
[ArgumentCompleter(typeof(BrandCenterFontCompleter))]
15+
[ArgumentCompleter(typeof(BrandCenterFontPackageCompleter))]
1616
public BrandCenterFontPipeBind Identity { get; set; }
1717

1818
[Parameter(Mandatory = true)]

src/Commands/Branding/UseBrandCenterFont.cs renamed to src/Commands/Branding/UseBrandCenterFontPackage.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88

99
namespace PnP.PowerShell.Commands.Branding
1010
{
11-
[Cmdlet(VerbsOther.Use, "PnPBrandCenterFont")]
11+
[Cmdlet(VerbsOther.Use, "PnPBrandCenterFontPackage")]
1212
[OutputType(typeof(void))]
13-
public class UseBrandCenterFont : PnPWebCmdlet
13+
public class UseBrandCenterFontPackage : PnPWebCmdlet
1414
{
1515
[Parameter(Mandatory = true, Position = 0, ValueFromPipeline = true)]
16-
[ArgumentCompleter(typeof(BrandCenterFontCompleter))]
16+
[ArgumentCompleter(typeof(BrandCenterFontPackageCompleter))]
1717
public BrandCenterFontPipeBind Identity { get; set; }
1818

1919
[Parameter(Mandatory = false)]
@@ -31,7 +31,7 @@ protected override void ExecuteCmdlet()
3131
LogWarning($"The font with identity {font.Id} titled '{font.Title}' is not valid. Will try to apply it anyway.");
3232
}
3333

34-
var url = $"{BrandCenterUtility.GetStoreUrlByStoreType(font.Store, CurrentWeb.Url)}/GetById('{font.Id}')/Apply";
34+
var url = $"{BrandCenterUtility.GetStoreFontPackageUrlByStoreType(font.Store, CurrentWeb.Url)}/GetById('{font.Id}')/Apply";
3535
LogDebug($"Applying font by making a POST call to {url}");
3636
RestHelper.Post(Connection.HttpClient, url, ClientContext);
3737
}

src/Commands/Utilities/BrandCenterUtility.cs

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -15,24 +15,24 @@ namespace PnP.PowerShell.Commands.Utilities
1515
internal static class BrandCenterUtility
1616
{
1717
/// <summary>
18-
/// Retrieves a font from the Brand Center based on its name and optionally store type.
18+
/// Retrieves a font package from the Brand Center based on its name and optionally store type.
1919
/// </summary>
2020
/// <param name="cmdlet">Cmdlet for which this runs, used for logging</param>
2121
/// <param name="title">Title of the font to retrieve</param>
2222
/// <param name="webUrl">Url to use to check the site collection Brand Center</param>
2323
/// <param name="store">The store to check for the font. When NULL, it will check all stores.</param>
2424
/// <param name="clientContext">ClientContext to use to communicate with SharePoint Online</param>
2525
/// <returns>The font with the provided identity or NULL if no font found with the provided identity</returns>
26-
public static Font GetFontByTitle(BasePSCmdlet cmdlet, ClientContext clientContext, string title, string webUrl, Store store = Store.All)
26+
public static Font GetFontPackageByTitle(BasePSCmdlet cmdlet, ClientContext clientContext, string title, string webUrl, Store store = Store.All)
2727
{
2828
if (store == Store.All)
2929
{
30-
return GetFontByTitle(cmdlet, clientContext, title, webUrl, Store.Site) ??
31-
GetFontByTitle(cmdlet, clientContext, title, webUrl, Store.Tenant) ??
32-
GetFontByTitle(cmdlet, clientContext, title, webUrl, Store.OutOfBox);
30+
return GetFontPackageByTitle(cmdlet, clientContext, title, webUrl, Store.Site) ??
31+
GetFontPackageByTitle(cmdlet, clientContext, title, webUrl, Store.Tenant) ??
32+
GetFontPackageByTitle(cmdlet, clientContext, title, webUrl, Store.OutOfBox);
3333
}
3434

35-
var url = $"{GetStoreUrlByStoreType(store, webUrl)}/GetByTitle('{title}')";
35+
var url = $"{GetStoreFontPackageUrlByStoreType(store, webUrl)}/GetByTitle('{title}')";
3636
cmdlet?.LogDebug($"Making a GET request to {url} to retrieve {store} font with title {title}.");
3737
try
3838
{
@@ -52,24 +52,24 @@ public static Font GetFontByTitle(BasePSCmdlet cmdlet, ClientContext clientConte
5252
}
5353

5454
/// <summary>
55-
/// Retrieves a font from the Brand Center based on its identity and optionally store type.
55+
/// Retrieves a font package from the Brand Center based on its identity and optionally store type.
5656
/// </summary>
5757
/// <param name="cmdlet">Cmdlet for which this runs, used for logging</param>
5858
/// <param name="identity">Id of the font to retrieve</param>
5959
/// <param name="webUrl">Url to use to check the site collection Brand Center</param>
6060
/// <param name="store">The store to check for the font. When NULL, it will check all stores.</param>
6161
/// <param name="clientContext">ClientContext to use to communicate with SharePoint Online</param>
6262
/// <returns>The font with the provided identity or NULL if no font found with the provided identity</returns>
63-
public static Font GetFontById(BasePSCmdlet cmdlet, ClientContext clientContext, Guid identity, string webUrl, Store store = Store.All)
63+
public static Font GetFontPackageById(BasePSCmdlet cmdlet, ClientContext clientContext, Guid identity, string webUrl, Store store = Store.All)
6464
{
6565
if (store == Store.All)
6666
{
67-
return GetFontById(cmdlet, clientContext, identity, webUrl, Store.Site) ??
68-
GetFontById(cmdlet, clientContext, identity, webUrl, Store.Tenant) ??
69-
GetFontById(cmdlet, clientContext, identity, webUrl, Store.OutOfBox);
67+
return GetFontPackageById(cmdlet, clientContext, identity, webUrl, Store.Site) ??
68+
GetFontPackageById(cmdlet, clientContext, identity, webUrl, Store.Tenant) ??
69+
GetFontPackageById(cmdlet, clientContext, identity, webUrl, Store.OutOfBox);
7070
}
7171

72-
var url = $"{GetStoreUrlByStoreType(store, webUrl)}/GetById('{identity}')";
72+
var url = $"{GetStoreFontPackageUrlByStoreType(store, webUrl)}/GetById('{identity}')";
7373
cmdlet?.LogDebug($"Making a GET request to {url} to retrieve {store} font with identity {identity}.");
7474
try
7575
{
@@ -89,38 +89,38 @@ public static Font GetFontById(BasePSCmdlet cmdlet, ClientContext clientContext,
8989
}
9090

9191
/// <summary>
92-
/// Retrieves fonts from the Brand Center optionally based on the store type.
92+
/// Retrieves font packages from the Brand Center optionally based on the store type.
9393
/// </summary>
9494
/// <param name="cmdlet">Cmdlet for which this runs, used for logging</param>
9595
/// <param name="webUrl">Url to use to check the site collection Brand Center</param>
9696
/// <param name="store">The store to check for the font. When NULL, it will check all stores.</param>
9797
/// <param name="clientContext">ClientContext to use to communicate with SharePoint Online</param>
9898
/// <returns>The available fonts</returns>
99-
public static List<Font> GetFonts(BasePSCmdlet cmdlet, ClientContext clientContext, string webUrl, Store store = Store.All)
99+
public static List<Font> GetFontPackages(BasePSCmdlet cmdlet, ClientContext clientContext, string webUrl, Store store = Store.All)
100100
{
101101
if (store == Store.All)
102102
{
103103
var allStoresFonts = new List<Font>();
104-
allStoresFonts.AddRange(GetFonts(cmdlet, clientContext, webUrl, Store.Site));
105-
allStoresFonts.AddRange(GetFonts(cmdlet, clientContext, webUrl, Store.Tenant));
106-
allStoresFonts.AddRange(GetFonts(cmdlet, clientContext, webUrl, Store.OutOfBox));
104+
allStoresFonts.AddRange(GetFontPackages(cmdlet, clientContext, webUrl, Store.Site));
105+
allStoresFonts.AddRange(GetFontPackages(cmdlet, clientContext, webUrl, Store.Tenant));
106+
allStoresFonts.AddRange(GetFontPackages(cmdlet, clientContext, webUrl, Store.OutOfBox));
107107
return allStoresFonts;
108108
}
109109

110-
var url = GetStoreUrlByStoreType(store, webUrl);
110+
var url = GetStoreFontPackageUrlByStoreType(store, webUrl);
111111
cmdlet?.LogDebug($"Making a GET request to {url} to retrieve {store} fonts.");
112112
var fonts = RestHelper.Get<RestResultCollection<Font>>(Framework.Http.PnPHttpClient.Instance.GetHttpClient(), url, clientContext);
113113
return fonts.Items.ToList();
114114
}
115115

116116
/// <summary>
117-
/// Returns the URL to the Brand Center based on the store type
117+
/// Returns the font package URL to the Brand Center based on the store type
118118
/// </summary>
119119
/// <param name="store">Brand Center store to connect to</param>
120120
/// <param name="webUrl">Base URL to connect to</param>
121121
/// <returns></returns>
122122
/// <exception cref="ArgumentOutOfRangeException">Thrown if an invalid store type has been provided</exception>
123-
public static string GetStoreUrlByStoreType(Store store, string webUrl)
123+
public static string GetStoreFontPackageUrlByStoreType(Store store, string webUrl)
124124
{
125125
return store switch
126126
{

0 commit comments

Comments
 (0)