# PowerShell "Start-QSAssetBundleImportJob" cmdlet - how to populate parameters

**URL:** <https://community.amazonquick.com/t/powershell-start-qsassetbundleimportjob-cmdlet-how-to-populate-parameters/25347>\
**Category:** Q&A\
**Tags:** qls-asset-as-code, api, developer, quick-sight\
**Created:** [February 1, 2024, 9:43pm UTC](https://community.amazonquick.com/t/powershell-start-qsassetbundleimportjob-cmdlet-how-to-populate-parameters/25347 "2024-02-01T21:43:56Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Neil](https://avatars.discourse-cdn.com/v4/letter/n/839c29/32.png) [@Neil](https://community.amazonquick.com/u/Neil)\
**Post date:** [February 1, 2024, 9:43pm UTC](https://community.amazonquick.com/t/powershell-start-qsassetbundleimportjob-cmdlet-how-to-populate-parameters/25347/1 "2024-02-01T21:43:56Z")

</div>

Hello,

Have successfully written CLI commands to export/import Quick Sight resources using the “bundle” commands, e.g.

aws quicksight start-asset-bundle-export-job `	--aws-account-id <id>`  
–asset-bundle-export-job-id 1234 `	--resource-arns <arn>`  
–include-all-dependencies `	--export-format QUICKSIGHT_JSON`  
–profile

Am now converting these to use PowerShell Cmdlets, e.g.

Start-QSAssetBundleExportJob `	-AssetBundleExportJobId 1234`  
-AwsAccountId `	-IncludeAllDependency 1`  
-ResourceArn `	-ExportFormat QUICKSIGHT_JSON`  
-ProfileName

For the corresponding “import” cmdlet - “Start-QSAssetBundleImportJob” - I am not sure how to handle the “override” parameters, e.g. “-OverrideParameters\_DataSource”. The type is “\<AssetBundleImportJobDataSourceOverrideParameters\>”.

For the “aws quicksight start-asset-bundle-import-job” equivalent, I have created a JSON file containing the override parameters, and use the “–override-parameters” parameter to point to this JSON file. This is straightforward.

Could someone please point me in the right direction for how to populate a PowerShell parameter to pass to the “\<AssetBundleImportJobDataSourceOverrideParameters\>” parameter of the “Start-QSAssetBundleImportJob” cmdlet? Can JSON be used in some way?

Many thanks in advance,

Neil

---

<div class="post-metadata">

**Author:** ![WLS-D](https://d2orw1595917va.cloudfront.net/user_avatar/community.amazonquick.com/wls-d/32/36109_2.png) [@WLS-D](https://community.amazonquick.com/u/WLS-D)\
**Post date:** [February 2, 2024, 3:57pm UTC](https://community.amazonquick.com/t/powershell-start-qsassetbundleimportjob-cmdlet-how-to-populate-parameters/25347/2 "2024-02-02T15:57:44Z")

</div>

Hey @Neil !

I would check out the docs below:

> **[AssetBundleImportJobDataSourceOverrideParameters.Builder (AWS SDK for Java -...](https://sdk.amazonaws.com/java/api/latest/software/amazon/awssdk/services/quicksight/model/AssetBundleImportJobDataSourceOverrideParameters.Builder.html)**
>
> declaration: package: software.amazon.awssdk.services.quicksight.model, class: AssetBundleImportJobDataSourceOverrideParameters, interface: Builder

> **[AssetBundleImportJobDataSourceOverrideParameters - Amazon QuickSight](https://docs.aws.amazon.com/quicksight/latest/APIReference/API_AssetBundleImportJobDataSourceOverrideParameters.html)**
>
> The override parameters for a single data source that is being imported.

---

<div class="post-metadata">

**Author:** ![Neil](https://avatars.discourse-cdn.com/v4/letter/n/839c29/32.png) [@Neil](https://community.amazonquick.com/u/Neil)\
**Post date:** [February 2, 2024, 6:31pm UTC](https://community.amazonquick.com/t/powershell-start-qsassetbundleimportjob-cmdlet-how-to-populate-parameters/25347/3 "2024-02-02T18:31:05Z")

</div>

Hi Duncan,

Thanks for your reply.  
Your first link relates to Java. I’m working with PowerShell on Windows.

I’ve made some progress today. If I get it working I will upload the outline of the solution.

Thanks,

Neil

---

<div class="post-metadata">

**Author:** ![Neil](https://avatars.discourse-cdn.com/v4/letter/n/839c29/32.png) [@Neil](https://community.amazonquick.com/u/Neil)\
**Post date:** [February 7, 2024, 11:11am UTC](https://community.amazonquick.com/t/powershell-start-qsassetbundleimportjob-cmdlet-how-to-populate-parameters/25347/4 "2024-02-07T11:11:33Z")

</div>

Here is an outline solution.

Pre-requisites:

1. The “AWS.Tools.Quick Sight” module is installed.
2. “$OverrideParametersFilename” is a script parameter which points to a JSON file containing Data Source override parameters in the following format:

{  
“DataSources”:[  
{  
“DataSourceId”:“Id value”,  
“DataSourceParameters”:  
{  
“S3Parameters”:  
{  
“ManifestFileLocation”:  
{  
“Bucket”:“Bucket Name”,  
“Key”:“Key Name containing name of manifest file”  
}  
}  
}  
}]  
}

Script code:

Import-Module AWS.Tools.Quick Sight

# Read JSON file for containing override parameters.

$OverrideParametersFile = Get-Content -Path $OverrideParametersFilename -Raw | Out-String | ConvertFrom-Json

# Initialise array.

[Amazon.Quick Sight.Model.AssetBundleImportJobDataSourceOverrideParameters] $DataSourcesOverrideParameters = @()

# Loop through each Data Source.

foreach ($DataSource in $OverrideParametersFile.DataSources)  
{  
$DataSourceOverrideParameters = [Amazon.Quick Sight.Model.AssetBundleImportJobDataSourceOverrideParameters]::new()

```
$DataSourceOverrideParameters.DataSourceId = $DataSource.DataSourceId
$DataSourceOverrideParameters.DataSourceParameters = [Amazon.Quick Sight.Model.DataSourceParameters]::new()
$DataSourceOverrideParameters.DataSourceParameters.S3Parameters = [Amazon.Quick Sight.Model.S3Parameters]::new()
$DataSourceOverrideParameters.DataSourceParameters.S3Parameters.ManifestFileLocation = [Amazon.Quick Sight.Model.ManifestFileLocation]::new()
$DataSourceOverrideParameters.DataSourceParameters.S3Parameters.ManifestFileLocation.Bucket = $DataSource.DataSourceParameters.S3Parameters.ManifestFileLocation.Bucket
$DataSourceOverrideParameters.DataSourceParameters.S3Parameters.ManifestFileLocation.Key = $DataSource.DataSourceParameters.S3Parameters.ManifestFileLocation.Key

$DataSourcesOverrideParameters += $DataSourceOverrideParameters

```

}

“$DataSourcesOverrideParameters” can then be passed to the “OverrideParameters\_DataSource” parameter of the “Start-QSAssetBundleImportJob” cmdlet.

Similar code can be written to populate parameters for the override permissions.

Hope the above will be useful for someone.
