Skip to content
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

Adding support for vanity domains to several cmdlets #3898

Merged
merged 2 commits into from
Apr 18, 2024
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
- Added `Unlock-PnPSensitivityLabelEncryptedFile` which allows the encryption to be removed from a file [#3864](https://github.com/pnp/powershell/pull/3864)
- Added `Get-PnPLibraryFileVersionBatchDeleteJobStatus` and `Get-PnPSiteFileVersionBatchDeleteJobStatus` to check on the status of applying file based version expiration based on age on a library and site level [#3828](https://github.com/pnp/powershell/pull/3828)
- Added support for `Get-PnPSiteCollectionAppCatalog` and `Get-PnPTenantSite` to be used with vanity domain tenants [#3895](https://github.com/pnp/powershell/pull/3895)
- Added support for using vanity domain tenants with `Grant-PnPTenantServicePrincipalPermission`, `Revoke-PnPTenantServicePrincipalPermission`, `Set-PnPWebTheme`, `Invoke-PnPListDesign`, `Set-PnPSite`, `Add-PnPSiteDesignTask`, `Get-PnPSiteDesignRun`, `Get-PnPSiteDesignTask` and `Invoke-PnPSiteDesign` cmdlets [#3898](https://github.com/pnp/powershell/pull/3898)

### Fixed

Expand Down
2 changes: 1 addition & 1 deletion src/Commands/Apps/GrantTenantServicePrincipalPermission.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class GrantTenantServicePrincipalPermission : PnPGraphCmdlet
public string Resource = "Microsoft Graph";
protected override void ExecuteCmdlet()
{
var tenantUrl = UrlUtilities.GetTenantAdministrationUrl(ClientContext.Url);
var tenantUrl = Connection.TenantAdminUrl ?? UrlUtilities.GetTenantAdministrationUrl(ClientContext.Url);
using (var tenantContext = ClientContext.Clone(tenantUrl))
{
var spoWebAppServicePrincipal = new SPOWebAppServicePrincipal(tenantContext);
Expand Down
3 changes: 1 addition & 2 deletions src/Commands/Apps/RevokeTenantServicePrincipalPermission.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ public class RevokeTenantServicePrincipal : PnPGraphCmdlet

protected override void ExecuteCmdlet()
{

var tenantUrl = UrlUtilities.GetTenantAdministrationUrl(ClientContext.Url);
var tenantUrl = Connection.TenantAdminUrl ?? UrlUtilities.GetTenantAdministrationUrl(ClientContext.Url);
using (var tenantContext = ClientContext.Clone(tenantUrl))
{
var spoWebAppServicePrincipal = new SPOWebAppServicePrincipal(tenantContext);
Expand Down
2 changes: 1 addition & 1 deletion src/Commands/Branding/SetWebTheme.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class SetWebTheme : PnPWebCmdlet
protected override void ExecuteCmdlet()
{
var url = CurrentWeb.EnsureProperty(w => w.Url);
var tenantUrl = UrlUtilities.GetTenantAdministrationUrl(ClientContext.Url);
var tenantUrl = Connection.TenantAdminUrl ?? UrlUtilities.GetTenantAdministrationUrl(ClientContext.Url);
using (var tenantContext = ClientContext.Clone(tenantUrl))
{
var tenant = new Tenant(tenantContext);
Expand Down
2 changes: 1 addition & 1 deletion src/Commands/ListDesign/InvokeListDesign.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class InvokeListDesign : PnPWebCmdlet
protected override void ExecuteCmdlet()
{
var url = CurrentWeb.EnsureProperty(w => w.Url);
var tenantUrl = UrlUtilities.GetTenantAdministrationUrl(ClientContext.Url);
var tenantUrl = Connection.TenantAdminUrl ?? UrlUtilities.GetTenantAdministrationUrl(ClientContext.Url);
using (var tenantContext = ClientContext.Clone(tenantUrl))
{
var tenant = new Tenant(tenantContext);
Expand Down
2 changes: 1 addition & 1 deletion src/Commands/Site/SetSite.cs
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ protected override void ExecuteCmdlet()

if (IsTenantProperty())
{
var tenantAdminUrl = UrlUtilities.GetTenantAdministrationUrl(context.Url);
var tenantAdminUrl = Connection.TenantAdminUrl ?? UrlUtilities.GetTenantAdministrationUrl(context.Url);
context = context.Clone(tenantAdminUrl);

executeQueryRequired = false;
Expand Down
2 changes: 1 addition & 1 deletion src/Commands/SiteDesigns/AddSiteDesignTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class AddSiteDesignTask : PnPWebCmdlet
protected override void ExecuteCmdlet()
{
var url = CurrentWeb.EnsureProperty(w => w.Url);
var tenantUrl = UrlUtilities.GetTenantAdministrationUrl(ClientContext.Url);
var tenantUrl = Connection.TenantAdminUrl ?? UrlUtilities.GetTenantAdministrationUrl(ClientContext.Url);
using (var tenantContext = ClientContext.Clone(tenantUrl))
{
var webUrl = url;
Expand Down
2 changes: 1 addition & 1 deletion src/Commands/SiteDesigns/GetSiteDesignRun.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class GetSiteDesignRun : PnPWebCmdlet
protected override void ExecuteCmdlet()
{
var url = CurrentWeb.EnsureProperty(w => w.Url);
var tenantUrl = UrlUtilities.GetTenantAdministrationUrl(ClientContext.Url);
var tenantUrl = Connection.TenantAdminUrl ?? UrlUtilities.GetTenantAdministrationUrl(ClientContext.Url);
using (var tenantContext = ClientContext.Clone(tenantUrl))
{
var tenant = new Tenant(tenantContext);
Expand Down
2 changes: 1 addition & 1 deletion src/Commands/SiteDesigns/GetSiteDesignTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class GetSiteDesignTask : PnPWebCmdlet
protected override void ExecuteCmdlet()
{
var url = CurrentWeb.EnsureProperty(w => w.Url);
var tenantUrl = UrlUtilities.GetTenantAdministrationUrl(ClientContext.Url);
var tenantUrl = Connection.TenantAdminUrl ?? UrlUtilities.GetTenantAdministrationUrl(ClientContext.Url);
using (var tenantContext = ClientContext.Clone(tenantUrl))
{
if (Identity != null)
Expand Down
2 changes: 1 addition & 1 deletion src/Commands/SiteDesigns/InvokeSiteDesign.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class InvokeSiteDesign : PnPWebCmdlet
protected override void ExecuteCmdlet()
{
var url = CurrentWeb.EnsureProperty(w => w.Url);
var tenantUrl = UrlUtilities.GetTenantAdministrationUrl(ClientContext.Url);
var tenantUrl = Connection.TenantAdminUrl ?? UrlUtilities.GetTenantAdministrationUrl(ClientContext.Url);
using (var tenantContext = ClientContext.Clone(tenantUrl))
{
var tenant = new Tenant(tenantContext);
Expand Down
Loading