Examples/Change-HistoryWidgetType.ps1
$VerbosePreferance = "Continue" Set-Location 'C:\Users\kkr\source\repos\IA Scripts\Modules\CTGlobalInsightAnalytics' #Install-Module CTGlobal.Insight.Analytics -Force -Verbose Import-Module .\CTGlobal.Insight.Analytics -Force -Verbose $LicenseKey = "db227f04-b6ad-417e-b64a-5edc87ac9b7f" Connect-IA -LicenseKey $LicenseKey -environment dev $IAGroup = Get-IAGroup -Id '2afc719c-c7c9-4ea9-02f8-08d8014d4d99' $WidgetTypeHistory = Get-IAWidgetType -Name History $AllSystemsCollectionId = (Get-IACollection -Name 'All Systems').Id Write-Output "Creating: ClientActivity" $WidgetTemplate = $null $IAConfigurationDataModel = $null $IAConfiguration = $null $IAWidgetObject = $null $IAWidget = $null $WidgetTemplate = Get-IAWidgetTemplate -Name 'Client Activity' $IAConfigurationDataModel = Get-IAConfigurationDataModel -WidgetTemplateId $WidgetTemplate.Id $IAConfigurationDataModel.DataModel.CollectionId = $AllSystemsCollectionId $IAConfigurationDataModel.DataModel.Days = 1000 $IAConfiguration = New-IAConfiguration -Name $IAConfigurationDataModel.Name -IAConfigurationDataModel $IAConfigurationDataModel.DataModel -Passthru $IAWidgetObject = New-IAWidgetObject -IAGroup $IAGroup ` -IAWidgetTemplate $WidgetTemplate ` -IAWidgetType $WidgetTypeHistory ` -WidgetConfiguration $IAConfiguration $IAWidget = New-IAWidget -IAWidgetObject $IAWidgetObject -PassThru -CreateDataValueFieldMaps # Changing HistoryType $HistoryType = Get-IAWidgetConfigurationHistory -Id $IAWidget.WidgetConfigurationBaseId <# Area Column Line Bar #> $HistoryType.ChartType = 'bar' Set-IAWidgetConfigurationHistory -IAWidgetConfigurationHistory $HistoryType -Verbose |