diff --git a/Documentation/USAGE.md b/Documentation/USAGE.md index 20231ff7..404d7c5f 100644 --- a/Documentation/USAGE.md +++ b/Documentation/USAGE.md @@ -260,28 +260,37 @@ manually. * Clone the existing published submission so that you can generate an update. - $sub = New-ApplicationSubmission -IapId [-Force] + $sub = New-ApplicationSubmission -AppId [-Force] * By using the `-Force` switch, it will call `Remove-ApplicationSubmission` behind the scenes if it finds that there's an existing pending submission for your app. * Read in the content of the json file from your `New-SubmissionPackage` payload: - $json = (Get-Content .\submission.json -Encoding UTF8) | ConvertFrom-Json + $json = (Get-Content .\submission.json -Encoding UTF8) | ConvertFrom-Json - * At this point we'd "patch in" the changes requested based on the switches provided into `$sub`. + * If you need to update any content for the cloned submission, here is where you'd "patch in" + applicable values from `$json` into `$sub`. + + * For example, here's how you can change a simple content that has a single value: + + $sub.hardwarePreferences = $json.hardwarePreferences + + * For nested content, you will need to use `DeepCopy-Object` so that all nested values are applied: + + $sub.allowTargetFutureDeviceFamilies = DeepCopy-Object $json.allowTargetFutureDeviceFamilies * Send the updated submission content so that the API knows what should be updated: - Set-ApplicationSubmission -AppId $appId -UpdatedSubmission $sub + Set-ApplicationSubmission -AppId $appId -UpdatedSubmission $sub * If you're updating screenshots or packages, you'll need to upload the supporting .zip file: - Set-SubmissionPackage -PackagePath -UploadUrl ($sub.fileUploadUrl) + Set-SubmissionPackage -PackagePath -UploadUrl ($sub.fileUploadUrl) * Tell the API that you're done with the submission and to start validation / certification: - Complete-ApplicationSubmission -AppId $appId -SubmissionId ($sub.id) + Complete-ApplicationSubmission -AppId $appId -SubmissionId ($sub.id) The `-AutoCommit` switch should not be confused with publishing of the submission. A submission won't enter into certification until it has been "committed", and a submission can only be committed diff --git a/StoreBroker/Helpers.ps1 b/StoreBroker/Helpers.ps1 index 0e670134..8e6473cd 100644 --- a/StoreBroker/Helpers.ps1 +++ b/StoreBroker/Helpers.ps1 @@ -225,7 +225,7 @@ function Format-SimpleTableString } } -function DeepCopy-Object +function Copy-ObjectDeep <# .SYNOPSIS Creates a deep copy of a serializable object. @@ -253,7 +253,7 @@ function DeepCopy-Object #> { [CmdletBinding()] - [Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseApprovedVerbs", "", Justification="Intentional. This isn't exported, and needed to be explicit relative to Copy-Object.")] + [Alias('DeepCopy-Object')] param( [Parameter(Mandatory)] [PSCustomObject] $Object diff --git a/StoreBroker/StoreBroker.psd1 b/StoreBroker/StoreBroker.psd1 index 2aeb72dd..d36343d0 100644 --- a/StoreBroker/StoreBroker.psd1 +++ b/StoreBroker/StoreBroker.psd1 @@ -6,7 +6,7 @@ CompanyName = 'Microsoft Corporation' Copyright = 'Copyright (C) Microsoft Corporation. All rights reserved.' - ModuleVersion = '1.0.0' + ModuleVersion = '1.0.1' Description = 'Provides command-line access to the Windows Store Submission REST API.' RootModule = 'StoreIngestionApi' @@ -29,6 +29,7 @@ 'Complete-ApplicationFlightSubmission', 'Complete-ApplicationSubmission', 'Complete-InAppProductSubmission', + 'Copy-ObjectDeep', 'Format-Application', 'Format-ApplicationFlight', 'Format-ApplicationFlightSubmission', @@ -88,6 +89,7 @@ 'Commit-IapSubmission', 'Commit-InAppProductSubmission', 'Complete-InAppProductSubmission', + 'DeepCopy-Object', 'Format-ApplicationIaps', 'Format-Iap', 'Format-IapSubmission',