diff --git a/CHANGELOG.md b/CHANGELOG.md index b0f5a960d..356626e6b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,7 +12,11 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - Added `ResourceBehaviorOptions` option in `New-PnPMicrosoft365Group` cmdlet to set `ResourceBehaviorOptions` while provisioning a Microsoft 365 Group. [#1774](https://github.com/pnp/powershell/pull/1774) - Added `Add-PnPTeamsChannelUser` which allows members and owners to be added to private channels in Teams [#1735](https://github.com/pnp/powershell/pull/1735) - Added `ExcludeVisualPromotedResults` parameter to `Get-PnPSearchConfiguration` which excludes promoted results [#1750](https://github.com/pnp/powershell/pull/1750) -- Added `MediaTranscription` parameter to `Set-PnPTenantSite` and `Set-PnPSite` cmdlets which when enabled allows videos to have transcripts generated on demand or generated automatically in certain scenarios. [#1771](https://github.com/pnp/powershell/pull/1771) +- Added `MediaTranscription` parameter to `Set-PnPTenantSite` and `Set-PnPSite` cmdlets which when enabled allows videos to have transcripts generated on demand or generated automatically in certain scenarios +- Added `Get-PnPVivaConnectionsDashboardACE` to retrieve the Adaptive Card extensions from the Viva connections dashboard page. [#1805](https://github.com/pnp/powershell/pull/1805) +- Added `Add-PnPVivaConnectionsDashboardACE` to add an Adaptive Card extension to the Viva connections dashboard page. [#1805](https://github.com/pnp/powershell/pull/1805) +- Added `Update-PnPVivaConnectionsDashboardACE` to update an Adaptive Card extension in the Viva connections dashboard page. [#1805](https://github.com/pnp/powershell/pull/1805) +- Added `Remove-PnPVivaConnectionsDashboardACE` to remove an Adaptive Card extension in the Viva connections dashboard page. [#1805](https://github.com/pnp/powershell/pull/1805) - Added `Accept` parameter to `Invoke-PnPSPRestMethod` cmdlet which if specified will pass the Accept HTTP request header. [#1795](https://github.com/pnp/powershell/pull/1795) - Added `Get-PnPFlowRun` cmdlet to retrieve a specific run, or all runs from a specific Power Automate flow. [#1819](https://github.com/pnp/powershell/pull/1819) - Added `Invoke-PnPGraphMethod` cmdlet to invoke generic Microsoft Graph API Methods. [#1820](https://github.com/pnp/powershell/pull/1820) diff --git a/documentation/Add-PnPVivaConnectionsDashboardACE.md b/documentation/Add-PnPVivaConnectionsDashboardACE.md new file mode 100644 index 000000000..4f97bac21 --- /dev/null +++ b/documentation/Add-PnPVivaConnectionsDashboardACE.md @@ -0,0 +1,171 @@ +--- +Module Name: PnP.PowerShell +title: Add-PnPVivaConnectionsDashboardACE +schema: 2.0.0 +applicable: SharePoint Online +external help file: PnP.PowerShell.dll-Help.xml +online version: https://pnp.github.io/powershell/cmdlets/Add-PnPVivaConnectionsDashboardACE.html +--- + +# Add-PnPVivaConnectionsDashboardACE + +## SYNOPSIS +Add an Adaptive card extension in the Viva connections dashboard page. This requires that you connect to a SharePoint Home site and have configured the Viva connections page. + +## SYNTAX + +```powershell +Add-PnPVivaConnectionsDashboardACE [-Identity ] [-Title ] [-PropertiesJSON ] [-Description ] [-IconProperty ] [-Order ][-CardSize ] [-Connection ] [] +``` + +## DESCRIPTION + +## EXAMPLES + +### EXAMPLE 1 +```powershell +Add-PnPVivaConnectionsDashboardACE -Identity CardDesigner -Order 3 -Title "Hello there" -PropertiesJSON $myProperties -CardSize Large -Description "ACE description" -Iconproperty "https://cdn.hubblecontent.osi.office.net/m365content/publish/002f8bf9-b8ee-4689-ae97-e411b756099d/691108002.jpg" +``` + +Add an Adaptive card extension of type Card Designer in the Viva connections dashboard page with Title, Description, IconProperty, Order , CardSize and PropertiesJSON of the ACE. + +### EXAMPLE 2 +```powershell +Add-PnPVivaConnectionsDashboardACE -Identity ThirdPartyApp -Order 1 -Title "Hello there" -PropertiesJSON $myProperties -CardSize Medium -Description "ACE with description" -Iconproperty "https://cdn.hubblecontent.osi.office.net/m365content/publish/002f8bf9-b8ee-4689-ae97-e411b756099d/691108002.jpg" +``` + +Add an Adaptive card extension of type Third party(custom adaptive card) in the Viva connections dashboard page with Title, Description, IconProperty, Order , CardSize and PropertiesJSON of the ACE. + +### EXAMPLE 3 +```powershell +Add-PnPVivaConnectionsDashboardACE -Identity AssignedTasks -Order 2 -Title "Tasks" -PropertiesJSON $myProperties -CardSize Medium -Description "My Assigned tasks" -Iconproperty "https://cdn.hubblecontent.osi.office.net/m365content/publish/002f8bf9-b8ee-4689-ae97-e411b756099d/691108002.jpg" +``` + +Add an Adaptive card extension of type AssignedTasks in the Viva connections dashboard page with Title, Description, IconProperty, Order , CardSize and PropertiesJSON of the ACE. + +## PARAMETERS + +### -Identity +The Id of the Adaptive Card on the Viva connections dashboard page. Supported values are: + +- Approvals +- AssignedTasks +- CardDesigner +- Shifts +- TeamsApp +- ThirdParty +- WebLink + +```yaml +Type: DefaultACE +Parameter Sets: (All) + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Title +The Tite of the Adaptive Card extension. + +```yaml +Type: string +Parameter Sets: (All) + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Description +The Description of the Adaptive Card extension. + +```yaml +Type: string +Parameter Sets: (All) + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -IconProperty +The Icon used by Adaptive Card extension. + +```yaml +Type: string +Parameter Sets: (All) + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PropertiesJSON +The properties of the Adaptive Card extension. You can get the properties by executing `Get-PnPVivaConnectionsDashboardACE` and then use the `JSONProperties`. + +```yaml +Type: string +Parameter Sets: (All) + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Order +The Order of appearance of the Adaptive Card extension on the Viva connections dashboard page. The default value is 0. + +```yaml +Type: Int +Parameter Sets: (All) + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -CardSize +The size of the Adaptive Card extension. The available values are `Large` or `Medium`. Default card size is `Medium` + +```yaml +Type: CardSize +Parameter Sets: (All) + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Connection +Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. + +```yaml +Type: PnPConnection +Parameter Sets: (All) + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +## RELATED LINKS + +[Microsoft 365 Patterns and Practices](https://aka.ms/m365pnp) + diff --git a/documentation/Get-PnPVivaConnectionsDashboardACE.md b/documentation/Get-PnPVivaConnectionsDashboardACE.md new file mode 100644 index 000000000..b0f236404 --- /dev/null +++ b/documentation/Get-PnPVivaConnectionsDashboardACE.md @@ -0,0 +1,73 @@ +--- +Module Name: PnP.PowerShell +title: Get-PnPVivaConnectionsDashboardACE +schema: 2.0.0 +applicable: SharePoint Online +external help file: PnP.PowerShell.dll-Help.xml +online version: https://pnp.github.io/powershell/cmdlets/Get-PnPVivaConnectionsDashboardACE.html +--- + +# Get-PnPVivaConnectionsDashboardACE + +## SYNOPSIS +Returns the Adaptive card extensions from the Viva connections dashboard page. This requires that you connect to a SharePoint Home site and have configured the Viva connections page. + +## SYNTAX + +```powershell +Get-PnPVivaConnectionsDashboardACE [-Identity ] [-Connection ] [] +``` + +## DESCRIPTION + +## EXAMPLES + +### EXAMPLE 1 +```powershell +Get-PnPVivaConnectionsDashboardACE +``` + +Returns all the adaptive card extensions present in the Viva Connections dashboard page. + +### EXAMPLE 2 +```powershell +Get-PnPVivaConnectionsDashboardACE -Identity "58108715-185e-4214-8786-01218e7ab9ef" +``` + +Returns the adaptive card extensions with specified Instance Id from the Viva Connections dashboard page. + + +## PARAMETERS + +### -Identity +The instance Id of the Adaptive Card extension present on the Viva connections dashboard page. You can retrieve the value for this parameter by executing `Get-PnPVivaConnectionsDashboardACE` cmdlet + +```yaml +Type: GUID +Parameter Sets: (All) + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Connection +Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. + +```yaml +Type: PnPConnection +Parameter Sets: (All) + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +## RELATED LINKS + +[Microsoft 365 Patterns and Practices](https://aka.ms/m365pnp) + diff --git a/documentation/Remove-PnPVivaConnectionsDashboardACE.md b/documentation/Remove-PnPVivaConnectionsDashboardACE.md new file mode 100644 index 000000000..31577fb0f --- /dev/null +++ b/documentation/Remove-PnPVivaConnectionsDashboardACE.md @@ -0,0 +1,66 @@ +--- +Module Name: PnP.PowerShell +title: Remove-PnPVivaConnectionsDashboardACE +schema: 2.0.0 +applicable: SharePoint Online +external help file: PnP.PowerShell.dll-Help.xml +online version: https://pnp.github.io/powershell/cmdlets/Remove-PnPVivaConnectionsDashboardACE.html +--- + +# Remove-PnPVivaConnectionsDashboardACE + +## SYNOPSIS +Removes the Adaptive card extensions from the Viva connections dashboard page. This requires that you connect to a SharePoint Home site and have configured the Viva connections page. + +## SYNTAX + +```powershell +Remove-PnPVivaConnectionsDashboardACE [-Identity ] [-Connection ] [] +``` + +## DESCRIPTION + +## EXAMPLES + +### EXAMPLE 1 +```powershell +Remove-PnPVivaConnectionsDashboardACE -Identity "58108715-185e-4214-8786-01218e7ab9ef" +``` + +Removes the adaptive card extensions with Instance Id `58108715-185e-4214-8786-01218e7ab9ef` from the Viva connections dashboard page + + +## PARAMETERS + +### -Identity +The instance Id of the Adaptive Card extension present on the Viva connections dashboard page. You can retrieve the value for this parameter by executing `Get-PnPVivaConnectionsDashboardACE` cmdlet + +```yaml +Type: GUID +Parameter Sets: (All) + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Connection +Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. + +```yaml +Type: PnPConnection +Parameter Sets: (All) + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +## RELATED LINKS + +[Microsoft 365 Patterns and Practices](https://aka.ms/m365pnp) + diff --git a/documentation/Update-PnPVivaConnectionsDashboardACE.md b/documentation/Update-PnPVivaConnectionsDashboardACE.md new file mode 100644 index 000000000..6e8ce0ecf --- /dev/null +++ b/documentation/Update-PnPVivaConnectionsDashboardACE.md @@ -0,0 +1,171 @@ +--- +Module Name: PnP.PowerShell +title: Update-PnPVivaConnectionsDashboardACE +schema: 2.0.0 +applicable: SharePoint Online +external help file: PnP.PowerShell.dll-Help.xml +online version: https://pnp.github.io/powershell/cmdlets/Update-PnPVivaConnectionsDashboardACE.html +--- + +# Update-PnPVivaConnectionsDashboardACE + +## SYNOPSIS +Update the Adaptive card extension in the Viva connections dashboard page. This requires that you connect to a SharePoint Home site and have configured the Viva connections page. + +## SYNTAX + +```powershell +Update-PnPVivaConnectionsDashboardACE [-Identity ] [-Title ] [-PropertiesJSON ] [-Description ] [-IconProperty ] [-Order ][-CardSize ] [-Connection ] [] +``` + +## DESCRIPTION + +## EXAMPLES + +### EXAMPLE 1 +```powershell +Update-PnPVivaConnectionsDashboardACE -Identity "58108715-185e-4214-8786-01218e7ab9ef" -Title "Update title" -Description "Update Description" -IconProperty "https://cdn.hubblecontent.osi.office.net/m365content/publish/002f8bf9-b8ee-4689-ae97-e411b756099d/691108002.jpg" -Order 4 -CardSize Large -PropertiesJSON $myProperties +``` + +Update the adaptive card extensions with Instance Id `58108715-185e-4214-8786-01218e7ab9ef` in the Viva connections dashboard page. It will update the Title, Description, IconProperty, Order , CardSize and PropertiesJSON of the ACE. + +### EXAMPLE 2 +```powershell +Update-PnPVivaConnectionsDashboardACE -Identity "58108715-185e-4214-8786-01218e7ab9ef" -Title "Update title" -Description "Update Description" +``` + +Update the adaptive card extensions with Instance Id `58108715-185e-4214-8786-01218e7ab9ef` in the Viva connections dashboard page. It will update the Title and Description of the ACE. + +### EXAMPLE 3 +```powershell +Update-PnPVivaConnectionsDashboardACE -Identity "58108715-185e-4214-8786-01218e7ab9ef" -IconProperty "https://cdn.hubblecontent.osi.office.net/m365content/publish/002f8bf9-b8ee-4689-ae97-e411b756099d/691108002.jpg" -Order 4 +``` + +Update the adaptive card extensions with Instance Id `58108715-185e-4214-8786-01218e7ab9ef` in the Viva connections dashboard page. It will update the IconProperty and Order of the ACE. + +### EXAMPLE 4 +```powershell +Update-PnPVivaConnectionsDashboardACE -Identity "58108715-185e-4214-8786-01218e7ab9ef" -CardSize Large +``` + +Update the adaptive card extensions with Instance Id `58108715-185e-4214-8786-01218e7ab9ef` in the Viva connections dashboard page. It will update the CardSize to large. + + +## PARAMETERS + +### -Identity +The instance Id of the Adaptive Card extension present on the Viva connections dashboard page. You can retrieve the value for this parameter by executing `Get-PnPVivaConnectionsDashboardACE` cmdlet + +```yaml +Type: GUID +Parameter Sets: (All) + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Title +The Tite of the Adaptive Card extension present on the Viva connections dashboard page. + +```yaml +Type: string +Parameter Sets: (All) + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Description +The Description of the Adaptive Card extension present on the Viva connections dashboard page. + +```yaml +Type: string +Parameter Sets: (All) + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -IconProperty +The Icon used by Adaptive Card extension present on the Viva connections dashboard page. + +```yaml +Type: string +Parameter Sets: (All) + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PropertiesJSON +The properties of the Adaptive Card extension present on the Viva connections dashboard page. + +```yaml +Type: string +Parameter Sets: (All) + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Order +The Order of appearance of the Adaptive Card extension present on the Viva connections dashboard page. + +```yaml +Type: Int +Parameter Sets: (All) + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -CardSize +The size of the Adaptive Card extension present on the Viva connections dashboard page. The available values are `Large` or `Medium`. + +```yaml +Type: CardSize +Parameter Sets: (All) + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Connection +Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. + +```yaml +Type: PnPConnection +Parameter Sets: (All) + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +## RELATED LINKS + +[Microsoft 365 Patterns and Practices](https://aka.ms/m365pnp) + diff --git a/src/Commands/Viva/AddVivaConnectionsDashboardACE.cs b/src/Commands/Viva/AddVivaConnectionsDashboardACE.cs new file mode 100644 index 000000000..0131a2718 --- /dev/null +++ b/src/Commands/Viva/AddVivaConnectionsDashboardACE.cs @@ -0,0 +1,76 @@ +using PnP.Core.Model.SharePoint; +using System; +using System.Collections.Generic; +using System.Management.Automation; +using System.Text; +using PnP.Core.Services; +using System.Text.Json; + +namespace PnP.PowerShell.Commands.Viva +{ + [Cmdlet(VerbsCommon.Add, "PnPVivaConnectionsDashboardACE")] + public class AddVivaConnectionsDashboardACE : PnPWebCmdlet + { + [Parameter(Mandatory = true)] + public DefaultACE Identity; + + [Parameter(Mandatory = true)] + public int Order = 0; + + [Parameter(Mandatory = false)] + public string Title = ""; + + [Parameter(Mandatory = true)] + public string PropertiesJSON; + + [Parameter(Mandatory = false)] + public string Description; + + [Parameter(Mandatory = false)] + public string IconProperty; + + [Parameter(Mandatory = false)] + public CardSize CardSize = CardSize.Medium; + + protected override void ExecuteCmdlet() + { + if (PnPContext.Site.IsHomeSite()) + { + IVivaDashboard dashboard = PnPContext.Web.GetVivaDashboardAsync().GetAwaiter().GetResult(); + + var cardDesignerACE = dashboard.NewACE(Identity, CardSize); + cardDesignerACE.Title = Title; + cardDesignerACE.Properties = JsonSerializer.Deserialize(PropertiesJSON); + + if (ParameterSpecified(nameof(Description))) + { + cardDesignerACE.Description = Description; + } + + if (ParameterSpecified(nameof(IconProperty))) + { + cardDesignerACE.IconProperty = IconProperty; + } + + if (ParameterSpecified(nameof(Order)) && Order > -1) + { + dashboard.AddACE(cardDesignerACE, Order); + } + else + { + dashboard.AddACE(cardDesignerACE); + } + + dashboard.Save(); + + // load the dashboard again + dashboard = PnPContext.Web.GetVivaDashboardAsync().GetAwaiter().GetResult(); + WriteObject(dashboard, true); + } + else + { + WriteWarning("Connected site is not a home site"); + } + } + } +} diff --git a/src/Commands/Viva/GetVivaConnectionsDashboard.cs b/src/Commands/Viva/GetVivaConnectionsDashboard.cs new file mode 100644 index 000000000..b6e7e3ca8 --- /dev/null +++ b/src/Commands/Viva/GetVivaConnectionsDashboard.cs @@ -0,0 +1,45 @@ +using PnP.Core.Model.SharePoint; +using PnP.PowerShell.Commands.Base; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Management.Automation; +using System.Text; + +namespace PnP.PowerShell.Commands.Viva +{ + [Cmdlet(VerbsCommon.Get, "PnPVivaConnectionsDashboardACE")] + public class GetVivaConnectionsDashboard : PnPWebCmdlet + { + [Parameter(Mandatory = false)] + public Guid Identity; + protected override void ExecuteCmdlet() + { + if (PnPContext.Site.IsHomeSite()) + { + IVivaDashboard dashboard = PnPContext.Web.GetVivaDashboardAsync().GetAwaiter().GetResult(); + + if (ParameterSpecified(nameof(Identity))) + { + var aceToRetrieve = dashboard.ACEs.FirstOrDefault(p => p.InstanceId == Identity); + if (aceToRetrieve != null) + { + WriteObject(aceToRetrieve); + } + else + { + WriteWarning("ACE with specified Instance Id not found"); + } + } + else + { + WriteObject(dashboard.ACEs, true); + } + } + else + { + WriteWarning("Connected site is not a home site"); + } + } + } +} diff --git a/src/Commands/Viva/RemoveVivaConnectionsACE.cs b/src/Commands/Viva/RemoveVivaConnectionsACE.cs new file mode 100644 index 000000000..6cd6a6e27 --- /dev/null +++ b/src/Commands/Viva/RemoveVivaConnectionsACE.cs @@ -0,0 +1,38 @@ +using PnP.Core.Model.SharePoint; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Management.Automation; +using System.Text; + +namespace PnP.PowerShell.Commands.Viva +{ + [Cmdlet(VerbsCommon.Remove, "PnPVivaConnectionsDashboardACE")] + public class RemoveVivaConnectionsACE : PnPWebCmdlet + { + [Parameter(Mandatory = true)] + public Guid Identity; + protected override void ExecuteCmdlet() + { + if (PnPContext.Site.IsHomeSite()) + { + IVivaDashboard dashboard = PnPContext.Web.GetVivaDashboardAsync().GetAwaiter().GetResult(); + var aceToRemove = dashboard.ACEs.FirstOrDefault(p => p.InstanceId == Identity); + + if (aceToRemove != null) + { + dashboard.RemoveACE(aceToRemove.InstanceId); + dashboard.Save(); + } + else + { + WriteWarning("ACE with specified instance Id not found"); + } + } + else + { + WriteWarning("Connected site is not a home site"); + } + } + } +} diff --git a/src/Commands/Viva/UpdateVivaConnectionsACE.cs b/src/Commands/Viva/UpdateVivaConnectionsACE.cs new file mode 100644 index 000000000..304f604fb --- /dev/null +++ b/src/Commands/Viva/UpdateVivaConnectionsACE.cs @@ -0,0 +1,103 @@ +using PnP.Core.Model.SharePoint; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Management.Automation; +using System.Text; +using System.Text.Json; + +namespace PnP.PowerShell.Commands.Viva +{ + [Cmdlet(VerbsData.Update, "PnPVivaConnectionsDashboardACE")] + public class UpdateVivaConnectionsACE : PnPWebCmdlet + { + [Parameter(Mandatory = true)] + public Guid Identity; + + [Parameter(Mandatory = false)] + public string Title; + + [Parameter(Mandatory = false)] + public string PropertiesJSON; + + [Parameter(Mandatory = false)] + public string Description; + + [Parameter(Mandatory = false)] + public string IconProperty; + + [Parameter(Mandatory = false)] + public int Order; + + [Parameter(Mandatory = false)] + public CardSize CardSize = CardSize.Medium; + + protected override void ExecuteCmdlet() + { + if (PnPContext.Site.IsHomeSite()) + { + IVivaDashboard dashboard = PnPContext.Web.GetVivaDashboardAsync().GetAwaiter().GetResult(); + var aceToUpdate = dashboard.ACEs.FirstOrDefault(p => p.InstanceId == Identity); + + if (aceToUpdate != null) + { + bool updateRequired = false; + if (ParameterSpecified(nameof(Title))) + { + aceToUpdate.Title = Title; + updateRequired = true; + } + + if (ParameterSpecified(nameof(PropertiesJSON))) + { + aceToUpdate.Properties = JsonSerializer.Deserialize(PropertiesJSON); + updateRequired = true; + } + + if (ParameterSpecified(nameof(Description))) + { + aceToUpdate.Description = Description; + updateRequired = true; + } + + if (ParameterSpecified(nameof(IconProperty))) + { + aceToUpdate.IconProperty = IconProperty; + updateRequired = true; + } + + if (ParameterSpecified(nameof(CardSize))) + { + aceToUpdate.CardSize = CardSize; + updateRequired = true; + } + + if (updateRequired) + { + if (ParameterSpecified(nameof(Order)) && Order > -1) + { + dashboard.UpdateACE(aceToUpdate, Order); + } + else + { + dashboard.UpdateACE(aceToUpdate); + } + + dashboard.Save(); + + dashboard = PnPContext.Web.GetVivaDashboardAsync().GetAwaiter().GetResult(); + WriteObject(dashboard, true); + } + } + else + { + WriteWarning("ACE with specified instance ID not found"); + } + } + else + { + WriteWarning("Connected site is not a home site"); + } + } + } +}