Skip to content

BUG: The 200 argument is greater than the maximum allowed range of 100 #81

@DamaniN

Description

@DamaniN

The counter for Backup Plan Selections throws this error:

./rubrik/rubrik-sizing-scripts/CLOUD/Get-AWSSizingInfo.ps1 -OrgCrossAccountRoleName OrganizationAccountAccessRole -Regions "us-west-1,us-west-2,us-east-1,us-east-2" 

Transcript started, output file is ./output_aws_2024-10-09_202508.log Source Profile/Credential is: arn:aws:sts::XXXXXXXXXXXX:assumed-role/<redacted>/<redacted> Searching account id: XXXXXXXXXXXX account name: <redacted> 
Current identity: Account Arn UserId ------- --- ------ XXXXXXXXXXX arn:aws:sts::XXXXXXXXXXXX:<redacted>/OrganizationAccountAccessRole/Get-AWSSizingInfo.ps1 <redacted>:Get-AWSSizingInfo.ps1 
Write-Error: An error occurred and the script has exited prematurely: 
Write-Error: Cannot validate argument on parameter 'PercentComplete'. The 200 argument is greater than the maximum allowed range of 100. Supply an argument that is less than or equal to 100 and then try the command again. 
Write-Error: at getAWSData, /home/cloudshell-user/rubrik/rubrik-sizing-scripts/CLOUD/Get-AWSSizingInfo.ps1: line 1200 at <ScriptBlock>, /home/cloudshell-user/rubrik/rubrik-sizing-scripts/CLOUD/Get-AWSSizingInfo.ps1: line 1547 at <ScriptBlock>, <No file>: line 1 Transcript stopped, output file is /home/cloudshell-user/output_aws_2024-10-09_202508.log

This is the offending section of code:

     $selectionCounter = 1
      foreach ($selection in $selections) {
        Write-Progress -ID 12 -Activity "Processing Backup Plan/Selection: $($selection.SelectionId)" -Status "Backup Plan/Selection $($selectionCounter) of $($BackupPlans.Count)" -PercentComplete (($selectionCounter / $BackupPlans.Count) * 100)
        $selectionCounter++

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions