Skip to content

Latest commit

 

History

History

bill-adjustments

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Optima Bill Adjustment Scripts

Helpful Information

  • Links
  • Information
    • By default, these scripts are designed to run with little to no feedback. Add -Verbose to the end of any command to get more detailed information.
    • If copying from your web browser, make sure to click the Raw button before copying.

For macOS users, install PowerShell with brew:

$ brew cask install powershell

Then you can start a session: pwsh

To get all Bill Adjustments in an Org:

$orgId = 123
$endpoint = "us-3.rightscale.com"
$refreshToken = "abc...123"
./Get-OptimaBillAdjustment.ps1 -OrganizationId $orgId -Endpoint $endpoint -RefreshToken $refreshToken

To get a Bill Adjustment based on name:

$orgId = 123
$endpoint = "us-3.rightscale.com"
$refreshToken = "abc...123"
$name = "Foo Bar"
./Get-OptimaBillAdjustment.ps1 -OrganizationId $orgId -Endpoint $endpoint -RefreshToken $refreshToken -BillingAdjustmentName $name

To send the Bill Adjustment to a file for future reference:

$orgId = 123
$endpoint = "us-3.rightscale.com"
$refreshToken = "abc...123"
$outputJSON = "org-123_bill_adj.json"
./Get-OptimaBillAdjustment.ps1 -OrganizationId $orgId -Endpoint $endpoint -RefreshToken $refreshToken -SendToFile $outputJSON

To output the Bill Adjustment as a PowerShell object:

$orgId = 123
$endpoint = "us-3.rightscale.com"
$refreshToken = "abc...123"
$outputJSON = "org-123_bill_adj.json"
./Get-OptimaBillAdjustment.ps1 -OrganizationId $orgId -Endpoint $endpoint -RefreshToken $refreshToken -PrettyPrint $false

To set a Bill Adjustment, you will need to already have generated the JSON file!

To replace all Bill Adjustments in the org:

$orgId = 123
$endpoint = "us-3.rightscale.com"
$refreshToken = "abc...123"
$inputJSON = "path/to/file.json"
./Set-OptimaBillAdjustment.ps1 -OrganizationId $orgId -Endpoint $endpoint -RefreshToken $refreshToken -BillAdjustmentJSON $inputJSON